Bug 1421088 - Don't pass an nsIFrame* to DrawTabPanel. r?spohl
MozReview-Commit-ID: JeWt76t7rRQ
--- a/widget/cocoa/nsNativeThemeCocoa.h
+++ b/widget/cocoa/nsNativeThemeCocoa.h
@@ -327,17 +327,18 @@ protected:
// HITheme drawing routines
void DrawTextBox(CGContextRef context, const HIRect& inBoxRect,
TextBoxParams aParams);
void DrawMeter(CGContextRef context, const HIRect& inBoxRect,
const MeterParams& aParams);
void DrawSegment(CGContextRef cgContext, const HIRect& inBoxRect,
const SegmentParams& aParams);
- void DrawTabPanel(CGContextRef context, const HIRect& inBoxRect, nsIFrame* aFrame);
+ void DrawTabPanel(CGContextRef context, const HIRect& inBoxRect,
+ bool aIsInsideActiveWindow);
void DrawScale(CGContextRef context, const HIRect& inBoxRect,
const ScaleParams& aParams);
void DrawCheckboxOrRadio(CGContextRef cgContext, bool inCheckbox,
const HIRect& inBoxRect,
const CheckboxOrRadioParams& aParams);
void DrawSearchField(CGContextRef cgContext, const HIRect& inBoxRect,
const SearchFieldParams& aParams);
void DrawRoundedBezelPushButton(CGContextRef cgContext,
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -2264,24 +2264,24 @@ nsNativeThemeCocoa::DrawMeter(CGContextR
CGContextRestoreGState(cgContext);
NS_OBJC_END_TRY_ABORT_BLOCK
}
void
nsNativeThemeCocoa::DrawTabPanel(CGContextRef cgContext, const HIRect& inBoxRect,
- nsIFrame* aFrame)
+ bool aIsInsideActiveWindow)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
HIThemeTabPaneDrawInfo tpdi;
tpdi.version = 1;
- tpdi.state = FrameIsInActiveWindow(aFrame) ? kThemeStateActive : kThemeStateInactive;
+ tpdi.state = aIsInsideActiveWindow ? kThemeStateActive : kThemeStateInactive;
tpdi.direction = kThemeTabNorth;
tpdi.size = kHIThemeTabSizeNormal;
tpdi.kind = kHIThemeTabKindNormal;
HIThemeDrawTabPane(&inBoxRect, &tpdi, cgContext, HITHEME_ORIENTATION);
NS_OBJC_END_TRY_ABORT_BLOCK;
}
@@ -3367,17 +3367,17 @@ nsNativeThemeCocoa::DrawWidgetBackground
SegmentParams params =
ComputeSegmentParams(aFrame, eventState, SegmentType::eTab);
params.pressed = params.pressed && !params.selected;
DrawSegment(cgContext, macRect, params);
}
break;
case NS_THEME_TABPANELS:
- DrawTabPanel(cgContext, macRect, aFrame);
+ DrawTabPanel(cgContext, macRect, FrameIsInActiveWindow(aFrame));
break;
case NS_THEME_RESIZER:
DrawResizer(cgContext, macRect, aFrame);
break;
case NS_THEME_MAC_VIBRANCY_LIGHT:
case NS_THEME_MAC_VIBRANCY_DARK: