Bug 384112 - "-moz-appearance: menulist-button broken in GTK" [p=ventnor.bugzilla@yahoo.com.au (Michael Ventnor) r+sr=roc aM9=beltzner]
authorreed@reedloden.com
Thu, 25 Oct 2007 13:23:13 -0700
changeset 7180 efe0218d5c47d2932e4fd6e7c978e54bbdfe0689
parent 7179 97f3b95a74a3d9e974e19543eca5180eba278795
child 7181 f4a94a737c33c4f49098e94271fc0b7be17d5edc
push idunknown
push userunknown
push dateunknown
bugs384112
milestone1.9a9pre
Bug 384112 - "-moz-appearance: menulist-button broken in GTK" [p=ventnor.bugzilla@yahoo.com.au (Michael Ventnor) r+sr=roc aM9=beltzner]
widget/src/gtk2/nsNativeThemeGTK.cpp
--- a/widget/src/gtk2/nsNativeThemeGTK.cpp
+++ b/widget/src/gtk2/nsNativeThemeGTK.cpp
@@ -970,17 +970,16 @@ nsNativeThemeGTK::ThemeSupportsWidget(ns
   case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
   case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
   case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
     // case NS_THEME_SCROLLBAR_GRIPPER_HORIZONTAL:  (n/a for gtk)
     // case NS_THEME_SCROLLBAR_GRIPPER_VERTICAL:  (n/a for gtk)
   case NS_THEME_TEXTFIELD:
   case NS_THEME_TEXTFIELD_MULTILINE:
     // case NS_THEME_TEXTFIELD_CARET:
-    // case NS_THEME_DROPDOWN_BUTTON:
   case NS_THEME_DROPDOWN_TEXTFIELD:
   case NS_THEME_SCALE_HORIZONTAL:
   case NS_THEME_SCALE_THUMB_HORIZONTAL:
   case NS_THEME_SCALE_VERTICAL:
   case NS_THEME_SCALE_THUMB_VERTICAL:
     // case NS_THEME_SCALE_THUMB_START:
     // case NS_THEME_SCALE_THUMB_END:
     // case NS_THEME_SCALE_TICK:
@@ -993,16 +992,23 @@ nsNativeThemeGTK::ThemeSupportsWidget(ns
   case NS_THEME_MENUITEM:
   case NS_THEME_CHECKMENUITEM:
   case NS_THEME_RADIOMENUITEM:
   case NS_THEME_WINDOW:
   case NS_THEME_DIALOG:
   case NS_THEME_DROPDOWN:
   case NS_THEME_DROPDOWN_TEXT:
     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);
+
   }
 
   return PR_FALSE;
 }
 
 NS_IMETHODIMP_(PRBool)
 nsNativeThemeGTK::WidgetIsContainer(PRUint8 aWidgetType)
 {