Disabled Native Theme for styled widgets
authorOleg Romashin <romaxa@gmail.com>
Tue, 29 Apr 2008 11:03:54 +0300
changeset 16934 59cfb67c6ab6c968fcb713408d51013321cbb2e0
parent 16933 3d7dd0ede4af2f4760b617a8a32703ee453e6a5a
child 16935 3168ceda2be4e111c1d33fb5caaff3e8493300d8
push id1298
push userpavlov@mozilla.com
push dateSun, 17 Aug 2008 05:03:09 +0000
treeherderautoland@4a506fa751d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0a1pre
Disabled Native Theme for styled widgets Probably fixed performance issue on dhtml benchmark
widget/src/qt/nsNativeThemeQt.cpp
--- a/widget/src/qt/nsNativeThemeQt.cpp
+++ b/widget/src/qt/nsNativeThemeQt.cpp
@@ -544,23 +544,28 @@ nsNativeThemeQt::ThemeSupportsWidget(nsP
     case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
     case NS_THEME_RADIO:
     case NS_THEME_RADIO_SMALL:
     case NS_THEME_CHECKBOX:
     case NS_THEME_CHECKBOX_SMALL:
     case NS_THEME_BUTTON_BEVEL:
     case NS_THEME_BUTTON:
     case NS_THEME_DROPDOWN:
-    case NS_THEME_DROPDOWN_BUTTON:
     case NS_THEME_DROPDOWN_TEXT:
     case NS_THEME_DROPDOWN_TEXTFIELD:
     case NS_THEME_TEXTFIELD:
     case NS_THEME_TEXTFIELD_MULTILINE:
     case NS_THEME_LISTBOX:
-        return PR_TRUE;
+        return !IsWidgetStyled(aPresContext, aFrame, aWidgetType);
+
+    case NS_THEME_DROPDOWN_BUTTON:
+        // "Native" dropdown buttons cause padding and margin problems, but only
+        // in HTML so allow them in XUL.
+        return (!aFrame || aFrame->GetContent()->IsNodeOfType(nsINode::eXUL)) &&
+                !IsWidgetStyled(aPresContext, aFrame, aWidgetType);
     default:
         break;
     }
     return PR_FALSE;
 }
 
 PRBool
 nsNativeThemeQt::WidgetIsContainer(PRUint8 aWidgetType)