Bug 528719 - When rendering popup buttons, use the open attribute to determine whether the control is highlighted, not the mousedown state. r=josh
--- 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()