Bug 528719 - When rendering popup buttons, use the open attribute to determine whether the control is highlighted, not the mousedown state. r=josh
authorMarkus Stange <mstange@themasta.com>
Fri, 11 Dec 2009 23:01:38 +0100
changeset 35624 cd75e8543626c0178956431228840b0d22b05e5f
parent 35623 4b093b03ee24dfadcb910a99cd017d907b9885ec
child 35625 893ff985d3c95f60385124e79827b2fb7c191025
push id10649
push usermstange@themasta.com
push dateSat, 12 Dec 2009 09:19:37 +0000
treeherdermozilla-central@d379a17cbf8f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjosh
bugs528719
milestone1.9.3a1pre
Bug 528719 - When rendering popup buttons, use the open attribute to determine whether the control is highlighted, not the mousedown state. r=josh
widget/src/cocoa/nsNativeThemeCocoa.mm
--- a/widget/src/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/src/cocoa/nsNativeThemeCocoa.mm
@@ -967,17 +967,17 @@ nsNativeThemeCocoa::DrawDropdown(CGConte
 
   [mDropdownCell setPullsDown:(aWidgetType == NS_THEME_BUTTON)];
 
   BOOL isEditable = (aWidgetType == NS_THEME_DROPDOWN_TEXTFIELD);
   NSCell* cell = isEditable ? (NSCell*)mComboBoxCell : (NSCell*)mDropdownCell;
 
   [cell setEnabled:!IsDisabled(aFrame)];
   [cell setShowsFirstResponder:(IsFocused(aFrame) || (inState & NS_EVENT_STATE_FOCUS))];
-  [cell setHighlighted:((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER))];
+  [cell setHighlighted:IsOpenButton(aFrame)];
   [cell setControlTint:(FrameIsInActiveWindow(aFrame) ? [NSColor currentControlTint] : NSClearControlTint)];
 
   const CellRenderSettings& settings = isEditable ? editableMenulistSettings : dropdownSettings;
   DrawCellWithSnapping(cell, cgContext, inBoxRect, settings,
                        0.5f, mCellDrawView, IsFrameRTL(aFrame));
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
@@ -2360,17 +2360,18 @@ nsNativeThemeCocoa::WidgetStateChanged(n
     *aShouldRepaint = PR_FALSE;
     if (aAttribute == nsWidgetAtoms::disabled ||
         aAttribute == nsWidgetAtoms::checked ||
         aAttribute == nsWidgetAtoms::selected ||
         aAttribute == nsWidgetAtoms::mozmenuactive ||
         aAttribute == nsWidgetAtoms::sortdirection ||
         aAttribute == nsWidgetAtoms::focused ||
         aAttribute == nsWidgetAtoms::_default ||
-        aAttribute == nsWidgetAtoms::step)
+        aAttribute == nsWidgetAtoms::step ||
+        aAttribute == nsWidgetAtoms::open)
       *aShouldRepaint = PR_TRUE;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNativeThemeCocoa::ThemeChanged()