Bug 590468. Part 4: Make Windows theme aware that scrollbars and status bars are always opaque. r=jmathies
authorRobert O'Callahan <roc@ocallahan.org>
Thu, 26 Aug 2010 22:01:43 -0500
changeset 54038 c13c0d97d2068d4b6504f9d026ab7d287641e09a
parent 54037 f5974cb774007b384f4f208c7e9259b5f98effa8
child 54039 7dd7010e3dc7fe4b6660a2e42b8ca3d0c32c9ae2
push idunknown
push userunknown
push dateunknown
reviewersjmathies
bugs590468
milestone2.0b5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 590468. Part 4: Make Windows theme aware that scrollbars and status bars are always opaque. r=jmathies
widget/src/windows/nsNativeThemeWin.cpp
--- a/widget/src/windows/nsNativeThemeWin.cpp
+++ b/widget/src/windows/nsNativeThemeWin.cpp
@@ -2043,16 +2043,27 @@ PRBool
 nsNativeThemeWin::ThemeNeedsComboboxDropmarker()
 {
   return PR_TRUE;
 }
 
 nsITheme::Transparency
 nsNativeThemeWin::GetWidgetTransparency(nsIFrame* aFrame, PRUint8 aWidgetType)
 {
+  switch (aWidgetType) {
+  case NS_THEME_SCROLLBAR_SMALL:
+  case NS_THEME_SCROLLBAR:
+  case NS_THEME_STATUSBAR:
+    // Knowing that scrollbars and statusbars are opaque improves
+    // performance, because we create layers for them. This better be
+    // true across all Windows themes! If it's not true, we should
+    // paint an opaque background for them to make it true!
+    return eOpaque;
+  }
+
   HANDLE theme = GetTheme(aWidgetType);
   // For the classic theme we don't really have a way of knowing
   if (!theme)
     return eUnknownTransparency;
 
   PRInt32 part, state;
   nsresult rv = GetThemePartAndState(aFrame, aWidgetType, part, state);
   // Fail conservatively