From 79cff0524369bbd206490ef5bf9958a11d12849a Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Thu, 23 Mar 2017 23:13:18 +0100 Subject: [PATCH] Bug 1333482 part 2 - [css-ui] Change all consumers of StyleDisplay::mAppearance to use the accessor UsedAppearance() instead, and make mAppearance/mMozAppearance private. r=dholbert MozReview-Commit-ID: 8JwLsY1CLDJ --- layout/base/GeckoRestyleManager.cpp | 6 +++--- layout/base/RestyleManager.cpp | 2 +- layout/base/nsCSSFrameConstructor.cpp | 2 +- layout/base/nsLayoutUtils.cpp | 6 +++--- layout/forms/nsButtonFrameRenderer.cpp | 4 ++-- layout/forms/nsComboboxControlFrame.cpp | 6 +++--- layout/forms/nsFormControlFrame.cpp | 8 ++++---- layout/forms/nsMeterFrame.cpp | 4 ++-- layout/forms/nsNumberControlFrame.cpp | 6 +++--- layout/forms/nsProgressFrame.cpp | 4 ++-- layout/forms/nsRangeFrame.cpp | 4 ++-- layout/generic/ReflowInput.cpp | 4 ++-- layout/generic/nsFlexContainerFrame.cpp | 2 +- layout/generic/nsFrame.cpp | 18 +++++++++--------- layout/generic/nsIFrame.h | 6 +++--- layout/painting/nsCSSRendering.cpp | 20 ++++++++++---------- layout/painting/nsDisplayList.cpp | 14 +++++++------- layout/style/nsStyleStruct.h | 2 +- layout/tables/nsTableCellFrame.cpp | 2 +- layout/tables/nsTableFrame.cpp | 2 +- layout/xul/nsBox.cpp | 18 +++++++++--------- layout/xul/nsBoxFrame.cpp | 2 +- layout/xul/nsImageBoxFrame.cpp | 6 +++--- layout/xul/nsMenuPopupFrame.cpp | 2 +- layout/xul/nsScrollbarFrame.cpp | 6 +++--- layout/xul/tree/nsTreeBodyFrame.cpp | 20 ++++++++++---------- widget/cocoa/nsNativeThemeCocoa.mm | 18 +++++++++--------- widget/nsNativeTheme.cpp | 4 ++-- widget/windows/nsNativeThemeWin.cpp | 2 +- 29 files changed, 100 insertions(+), 100 deletions(-) diff --git a/layout/base/GeckoRestyleManager.cpp b/layout/base/GeckoRestyleManager.cpp index 8a80b8e06e1c..11b80c71301f 100644 --- a/layout/base/GeckoRestyleManager.cpp +++ b/layout/base/GeckoRestyleManager.cpp @@ -300,11 +300,11 @@ GeckoRestyleManager::AttributeChanged(Element* aElement, if (primaryFrame) { // See if we have appearance information for a theme. const nsStyleDisplay* disp = primaryFrame->StyleDisplay(); - if (disp->mAppearance) { + if (disp->UsedAppearance()) { nsITheme* theme = PresContext()->GetTheme(); - if (theme && theme->ThemeSupportsWidget(PresContext(), primaryFrame, disp->mAppearance)) { + if (theme && theme->ThemeSupportsWidget(PresContext(), primaryFrame, disp->UsedAppearance())) { bool repaint = false; - theme->WidgetStateChanged(primaryFrame, disp->mAppearance, aAttribute, + theme->WidgetStateChanged(primaryFrame, disp->UsedAppearance(), aAttribute, &repaint, aOldValue); if (repaint) hint |= nsChangeHint_RepaintFrame; diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index 521738f01493..65f37acfb0ea 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -355,7 +355,7 @@ RestyleManager::ContentStateChangedInternal(Element* aElement, NS_EVENT_STATE_LOADING)) { *aOutChangeHint = nsChangeHint_ReconstructFrame; } else { - uint8_t app = primaryFrame->StyleDisplay()->mAppearance; + uint8_t app = primaryFrame->StyleDisplay()->UsedAppearance(); if (app) { nsITheme* theme = PresContext()->GetTheme(); if (theme && diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index b05d1c462571..27a62853520a 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -3739,7 +3739,7 @@ nsCSSFrameConstructor::FindInputData(Element* aElement, // not (respectively) NS_THEME_RADIO and NS_THEME_CHECKBOX.) if ((controlType == NS_FORM_INPUT_CHECKBOX || controlType == NS_FORM_INPUT_RADIO) && - aStyleContext->StyleDisplay()->mAppearance == NS_THEME_NONE) { + aStyleContext->StyleDisplay()->UsedAppearance() == NS_THEME_NONE) { return nullptr; } #endif diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index da9191b5fb9c..194074fdf92f 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -5037,7 +5037,7 @@ AddIntrinsicSizeOffset(nsRenderingContext* aRenderingContext, LayoutDeviceIntSize devSize; bool canOverride = true; nsPresContext* pc = aFrame->PresContext(); - pc->GetTheme()->GetMinimumWidgetSize(pc, aFrame, disp->mAppearance, + pc->GetTheme()->GetMinimumWidgetSize(pc, aFrame, disp->UsedAppearance(), &devSize, &canOverride); nscoord themeSize = pc->DevPixelsToAppUnits(aAxis == eAxisVertical ? devSize.height @@ -6947,10 +6947,10 @@ nsLayoutUtils::GetFrameTransparency(nsIFrame* aBackgroundFrame, if (HasNonZeroCorner(aCSSRootFrame->StyleBorder()->mBorderRadius)) return eTransparencyTransparent; - if (aCSSRootFrame->StyleDisplay()->mAppearance == NS_THEME_WIN_GLASS) + if (aCSSRootFrame->StyleDisplay()->UsedAppearance() == NS_THEME_WIN_GLASS) return eTransparencyGlass; - if (aCSSRootFrame->StyleDisplay()->mAppearance == NS_THEME_WIN_BORDERLESS_GLASS) + if (aCSSRootFrame->StyleDisplay()->UsedAppearance() == NS_THEME_WIN_BORDERLESS_GLASS) return eTransparencyBorderlessGlass; nsITheme::Transparency transparency; diff --git a/layout/forms/nsButtonFrameRenderer.cpp b/layout/forms/nsButtonFrameRenderer.cpp index 1ce15465e583..5517361f3f1a 100644 --- a/layout/forms/nsButtonFrameRenderer.cpp +++ b/layout/forms/nsButtonFrameRenderer.cpp @@ -318,7 +318,7 @@ void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder, nsPresContext *presContext = mFrame->PresContext(); const nsStyleDisplay *disp = mFrame->StyleDisplay(); if (!mFrame->IsThemed(disp) || - !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) { + !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->UsedAppearance())) { nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize()); // Draw the -moz-focus-inner border @@ -340,7 +340,7 @@ nsDisplayButtonForeground::GetLayerState(nsDisplayListBuilder* aBuilder, nsPresContext *presContext = mFrame->PresContext(); const nsStyleDisplay *disp = mFrame->StyleDisplay(); if (!mFrame->IsThemed(disp) || - !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) { + !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->UsedAppearance())) { nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize()); br = mBFR->CreateInnerFocusBorderRenderer(aBuilder, presContext, nullptr, mVisibleRect, r); } diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 55afd7a97cec..b9ed7e9761b5 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -781,7 +781,7 @@ nsComboboxControlFrame::GetIntrinsicISize(nsRenderingContext* aRenderingContext, // add room for the dropmarker button if there is one if ((!IsThemed() || presContext->GetTheme()->ThemeNeedsComboboxDropmarker()) && - StyleDisplay()->mAppearance != NS_THEME_NONE) { + StyleDisplay()->UsedAppearance() != NS_THEME_NONE) { displayISize += scrollbarWidth; } @@ -864,7 +864,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext, nscoord buttonISize; const nsStyleDisplay *disp = StyleDisplay(); if ((IsThemed(disp) && !aPresContext->GetTheme()->ThemeNeedsComboboxDropmarker()) || - StyleDisplay()->mAppearance == NS_THEME_NONE) { + StyleDisplay()->UsedAppearance() == NS_THEME_NONE) { buttonISize = 0; } else { @@ -1580,7 +1580,7 @@ nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, nsPresContext *presContext = PresContext(); const nsStyleDisplay *disp = StyleDisplay(); if ((!IsThemed(disp) || - !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) && + !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->UsedAppearance())) && mDisplayFrame && IsVisibleForPainting(aBuilder)) { aLists.Content()->AppendNewToTop( new (aBuilder) nsDisplayComboboxFocus(aBuilder, this)); diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp index 1a44339fc0d5..7290d875e8f7 100644 --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -50,7 +50,7 @@ nsFormControlFrame::GetMinISize(nsRenderingContext *aRenderingContext) nscoord result; DISPLAY_MIN_WIDTH(this, result); #if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK) - result = StyleDisplay()->mAppearance == NS_THEME_NONE ? 0 : DefaultSize(); + result = StyleDisplay()->UsedAppearance() == NS_THEME_NONE ? 0 : DefaultSize(); #else result = DefaultSize(); #endif @@ -63,7 +63,7 @@ nsFormControlFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nscoord result; DISPLAY_PREF_WIDTH(this, result); #if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK) - result = StyleDisplay()->mAppearance == NS_THEME_NONE ? 0 : DefaultSize(); + result = StyleDisplay()->UsedAppearance() == NS_THEME_NONE ? 0 : DefaultSize(); #else result = DefaultSize(); #endif @@ -83,7 +83,7 @@ nsFormControlFrame::ComputeAutoSize(nsRenderingContext* aRC, { LogicalSize size(aWM, 0, 0); #if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK) - if (StyleDisplay()->mAppearance == NS_THEME_NONE) { + if (StyleDisplay()->UsedAppearance() == NS_THEME_NONE) { return size; } #endif @@ -107,7 +107,7 @@ nsFormControlFrame::GetLogicalBaseline(WritingMode aWritingMode) const #if !defined(MOZ_WIDGET_ANDROID) // For appearance:none we use a standard CSS baseline, i.e. synthesized from // our margin-box. - if (StyleDisplay()->mAppearance == NS_THEME_NONE) { + if (StyleDisplay()->UsedAppearance() == NS_THEME_NONE) { return nsAtomicContainerFrame::GetLogicalBaseline(aWritingMode); } #endif diff --git a/layout/forms/nsMeterFrame.cpp b/layout/forms/nsMeterFrame.cpp index ff25cce4b84c..bd8b08ce9307 100644 --- a/layout/forms/nsMeterFrame.cpp +++ b/layout/forms/nsMeterFrame.cpp @@ -272,11 +272,11 @@ nsMeterFrame::ShouldUseNativeStyle() const // - both frames use the native appearance; // - neither frame has author specified rules setting the border or the // background. - return StyleDisplay()->mAppearance == NS_THEME_METERBAR && + return StyleDisplay()->UsedAppearance() == NS_THEME_METERBAR && !PresContext()->HasAuthorSpecifiedRules(this, NS_AUTHOR_SPECIFIED_BORDER | NS_AUTHOR_SPECIFIED_BACKGROUND) && barFrame && - barFrame->StyleDisplay()->mAppearance == NS_THEME_METERCHUNK && + barFrame->StyleDisplay()->UsedAppearance() == NS_THEME_METERCHUNK && !PresContext()->HasAuthorSpecifiedRules(barFrame, NS_AUTHOR_SPECIFIED_BORDER | NS_AUTHOR_SPECIFIED_BACKGROUND); } diff --git a/layout/forms/nsNumberControlFrame.cpp b/layout/forms/nsNumberControlFrame.cpp index 90146771c409..28e1eea78d59 100644 --- a/layout/forms/nsNumberControlFrame.cpp +++ b/layout/forms/nsNumberControlFrame.cpp @@ -416,7 +416,7 @@ nsNumberControlFrame::CreateAnonymousContent(nsTArray& aElements) nsContentUtils::AddScriptRunner(focusJob); } - if (StyleDisplay()->mAppearance == NS_THEME_TEXTFIELD) { + if (StyleDisplay()->UsedAppearance() == NS_THEME_TEXTFIELD) { // The author has elected to hide the spinner by setting this // -moz-appearance. We will reframe if it changes. return rv; @@ -621,11 +621,11 @@ nsNumberControlFrame::ShouldUseNativeStyleForSpinner() const nsIFrame* spinDownFrame = mSpinDown->GetPrimaryFrame(); return spinUpFrame && - spinUpFrame->StyleDisplay()->mAppearance == NS_THEME_SPINNER_UPBUTTON && + spinUpFrame->StyleDisplay()->UsedAppearance() == NS_THEME_SPINNER_UPBUTTON && !PresContext()->HasAuthorSpecifiedRules(spinUpFrame, STYLES_DISABLING_NATIVE_THEMING) && spinDownFrame && - spinDownFrame->StyleDisplay()->mAppearance == NS_THEME_SPINNER_DOWNBUTTON && + spinDownFrame->StyleDisplay()->UsedAppearance() == NS_THEME_SPINNER_DOWNBUTTON && !PresContext()->HasAuthorSpecifiedRules(spinDownFrame, STYLES_DISABLING_NATIVE_THEMING); } diff --git a/layout/forms/nsProgressFrame.cpp b/layout/forms/nsProgressFrame.cpp index c931c705dc44..08781609d43d 100644 --- a/layout/forms/nsProgressFrame.cpp +++ b/layout/forms/nsProgressFrame.cpp @@ -285,11 +285,11 @@ nsProgressFrame::ShouldUseNativeStyle() const // - both frames use the native appearance; // - neither frame has author specified rules setting the border or the // background. - return StyleDisplay()->mAppearance == NS_THEME_PROGRESSBAR && + return StyleDisplay()->UsedAppearance() == NS_THEME_PROGRESSBAR && !PresContext()->HasAuthorSpecifiedRules(this, NS_AUTHOR_SPECIFIED_BORDER | NS_AUTHOR_SPECIFIED_BACKGROUND) && barFrame && - barFrame->StyleDisplay()->mAppearance == NS_THEME_PROGRESSCHUNK && + barFrame->StyleDisplay()->UsedAppearance() == NS_THEME_PROGRESSCHUNK && !PresContext()->HasAuthorSpecifiedRules(barFrame, NS_AUTHOR_SPECIFIED_BORDER | NS_AUTHOR_SPECIFIED_BACKGROUND); } diff --git a/layout/forms/nsRangeFrame.cpp b/layout/forms/nsRangeFrame.cpp index c6065c7f6c58..ced378aaad01 100644 --- a/layout/forms/nsRangeFrame.cpp +++ b/layout/forms/nsRangeFrame.cpp @@ -300,7 +300,7 @@ nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsStyleDisplay *disp = StyleDisplay(); if (IsThemed(disp) && - PresContext()->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) { + PresContext()->GetTheme()->ThemeDrawsFocusForWidget(disp->UsedAppearance())) { return; // the native theme displays its own visual indication of focus } @@ -883,7 +883,7 @@ nsRangeFrame::ShouldUseNativeStyle() const nsIFrame* progressFrame = mProgressDiv->GetPrimaryFrame(); nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame(); - return (StyleDisplay()->mAppearance == NS_THEME_RANGE) && + return (StyleDisplay()->UsedAppearance() == NS_THEME_RANGE) && !PresContext()->HasAuthorSpecifiedRules(this, (NS_AUTHOR_SPECIFIED_BORDER | NS_AUTHOR_SPECIFIED_BACKGROUND)) && diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index 77d3a2f6fd58..99aea7171f8e 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -2527,7 +2527,7 @@ SizeComputationInput::InitOffsets(WritingMode aWM, nsIntMargin widget; if (isThemed && presContext->GetTheme()->GetWidgetPadding(presContext->DeviceContext(), - mFrame, disp->mAppearance, + mFrame, disp->UsedAppearance(), &widget)) { ComputedPhysicalPadding().top = presContext->DevPixelsToAppUnits(widget.top); ComputedPhysicalPadding().right = presContext->DevPixelsToAppUnits(widget.right); @@ -2578,7 +2578,7 @@ SizeComputationInput::InitOffsets(WritingMode aWM, if (isThemed) { nsIntMargin widget; presContext->GetTheme()->GetWidgetBorder(presContext->DeviceContext(), - mFrame, disp->mAppearance, + mFrame, disp->UsedAppearance(), &widget); ComputedPhysicalBorderPadding().top = presContext->DevPixelsToAppUnits(widget.top); diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 0621721597e3..bc763449f4bc 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -1405,7 +1405,7 @@ nsFlexContainerFrame::GenerateFlexItemForChild( bool canOverride = true; aPresContext->GetTheme()-> GetMinimumWidgetSize(aPresContext, aChildFrame, - disp->mAppearance, + disp->UsedAppearance(), &widgetMinSize, &canOverride); nscoord widgetMainMinSize = diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 4001b49737f2..60e4ecbec548 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1155,7 +1155,7 @@ nsIFrame::GetUsedBorder() const nsIntMargin result; nsPresContext *presContext = PresContext(); presContext->GetTheme()->GetWidgetBorder(presContext->DeviceContext(), - mutable_this, disp->mAppearance, + mutable_this, disp->UsedAppearance(), &result); border.left = presContext->DevPixelsToAppUnits(result.left); border.top = presContext->DevPixelsToAppUnits(result.top); @@ -1191,7 +1191,7 @@ nsIFrame::GetUsedPadding() const nsIntMargin widget; if (presContext->GetTheme()->GetWidgetPadding(presContext->DeviceContext(), mutable_this, - disp->mAppearance, + disp->UsedAppearance(), &widget)) { padding.top = presContext->DevPixelsToAppUnits(widget.top); padding.right = presContext->DevPixelsToAppUnits(widget.right); @@ -2060,7 +2060,7 @@ nsFrame::DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder, // receive a propagated background should just set aForceBackground to // true. if (aBuilder->IsForEventDelivery() || aForceBackground || - !StyleBackground()->IsTransparent(this) || StyleDisplay()->mAppearance) { + !StyleBackground()->IsTransparent(this) || StyleDisplay()->UsedAppearance()) { return nsDisplayBackgroundImage::AppendBackgroundItemsToTop( aBuilder, this, GetRectRelativeToSelf(), aLists.BorderBackground()); } @@ -2984,7 +2984,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder, // REVIEW: Taken from nsBoxFrame::Paint // Don't paint our children if the theme object is a leaf. if (IsThemed(ourDisp) && - !PresContext()->GetTheme()->WidgetIsContainer(ourDisp->mAppearance)) + !PresContext()->GetTheme()->WidgetIsContainer(ourDisp->UsedAppearance())) return; // Since we're now sure that we're adding this frame to the display list @@ -4884,7 +4884,7 @@ IntrinsicSizeOffsets(nsIFrame* aFrame, bool aForISize) nsIntMargin border; presContext->GetTheme()->GetWidgetBorder(presContext->DeviceContext(), - aFrame, disp->mAppearance, + aFrame, disp->UsedAppearance(), &border); result.hBorder = presContext->DevPixelsToAppUnits(verticalAxis ? border.TopBottom() @@ -4892,7 +4892,7 @@ IntrinsicSizeOffsets(nsIFrame* aFrame, bool aForISize) nsIntMargin padding; if (presContext->GetTheme()->GetWidgetPadding(presContext->DeviceContext(), - aFrame, disp->mAppearance, + aFrame, disp->UsedAppearance(), &padding)) { result.hPadding = presContext->DevPixelsToAppUnits(verticalAxis ? padding.TopBottom() @@ -5164,7 +5164,7 @@ nsFrame::ComputeSize(nsRenderingContext* aRenderingContext, bool canOverride = true; nsPresContext *presContext = PresContext(); presContext->GetTheme()-> - GetMinimumWidgetSize(presContext, this, disp->mAppearance, + GetMinimumWidgetSize(presContext, this, disp->UsedAppearance(), &widget, &canOverride); // Convert themed widget's physical dimensions to logical coords @@ -5624,7 +5624,7 @@ nsFrame::ComputeSimpleTightBounds(DrawTarget* aDrawTarget) const { if (StyleOutline()->mOutlineStyle != NS_STYLE_BORDER_STYLE_NONE || StyleBorder()->HasBorder() || !StyleBackground()->IsTransparent(this) || - StyleDisplay()->mAppearance) { + StyleDisplay()->UsedAppearance()) { // Not necessarily tight, due to clipping, negative // outline-offset, and lots of other issues, but that's OK return GetVisualOverflowRect(); @@ -8985,7 +8985,7 @@ nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas, nsPresContext *presContext = PresContext(); if (presContext->GetTheme()-> GetWidgetOverflow(presContext->DeviceContext(), this, - disp->mAppearance, &r)) { + disp->UsedAppearance(), &r)) { nsRect& vo = aOverflowAreas.VisualOverflow(); vo.UnionRectEdges(vo, r); } diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index ba49c928543e..445e0d9cd1e6 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -1584,16 +1584,16 @@ public: bool IsThemed(const nsStyleDisplay* aDisp, nsITheme::Transparency* aTransparencyState = nullptr) const { nsIFrame* mutable_this = const_cast(this); - if (!aDisp->mAppearance) + if (!aDisp->UsedAppearance()) return false; nsPresContext* pc = PresContext(); nsITheme *theme = pc->GetTheme(); if(!theme || - !theme->ThemeSupportsWidget(pc, mutable_this, aDisp->mAppearance)) + !theme->ThemeSupportsWidget(pc, mutable_this, aDisp->UsedAppearance())) return false; if (aTransparencyState) { *aTransparencyState = - theme->GetWidgetTransparency(mutable_this, aDisp->mAppearance); + theme->GetWidgetTransparency(mutable_this, aDisp->UsedAppearance()); } return true; } diff --git a/layout/painting/nsCSSRendering.cpp b/layout/painting/nsCSSRendering.cpp index 4a012c765daf..f8f454b46863 100644 --- a/layout/painting/nsCSSRendering.cpp +++ b/layout/painting/nsCSSRendering.cpp @@ -822,11 +822,11 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext, // renderer draw the border. DO not get the data from aForFrame, since the passed in style context // may be different! Always use |aStyleContext|! const nsStyleDisplay* displayData = aStyleContext->StyleDisplay(); - if (displayData->mAppearance) { + if (displayData->UsedAppearance()) { nsITheme *theme = aPresContext->GetTheme(); if (theme && theme->ThemeSupportsWidget(aPresContext, aForFrame, - displayData->mAppearance)) { + displayData->UsedAppearance())) { return DrawResult::SUCCESS; // Let the theme handle it. } } @@ -906,11 +906,11 @@ nsCSSRendering::CreateBorderRendererWithStyleBorder(nsPresContext* aPresContext, Sides aSkipSides) { const nsStyleDisplay* displayData = aStyleContext->StyleDisplay(); - if (displayData->mAppearance) { + if (displayData->UsedAppearance()) { nsITheme *theme = aPresContext->GetTheme(); if (theme && theme->ThemeSupportsWidget(aPresContext, aForFrame, - displayData->mAppearance)) { + displayData->UsedAppearance())) { return Nothing(); } } @@ -1592,7 +1592,7 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext, nativeRect.IntersectRect(frameRect, nativeRect); nsRenderingContext wrapperCtx(shadowContext); aPresContext->GetTheme()->DrawWidgetBackground(&wrapperCtx, aForFrame, - styleDisplay->mAppearance, aFrameArea, nativeRect); + styleDisplay->UsedAppearance(), aFrameArea, nativeRect); blurringArea.DoPaint(); renderContext->Restore(); @@ -1937,7 +1937,7 @@ nsCSSRendering::PaintStyleImageLayer(const PaintBGParams& aParams) // a root, otherwise keep going in order to let the theme stuff // draw the background. The canvas really should be drawing the // bg, but there's no way to hook that up via css. - if (!aParams.frame->StyleDisplay()->mAppearance) { + if (!aParams.frame->StyleDisplay()->UsedAppearance()) { return DrawResult::SUCCESS; } @@ -3386,18 +3386,18 @@ nsCSSRendering::PaintStyleImageLayerWithSC(const PaintBGParams& aParams, // renderer draw the background and bail out. // XXXzw this ignores aParams.bgClipRect. const nsStyleDisplay* displayData = aParams.frame->StyleDisplay(); - if (displayData->mAppearance) { + if (displayData->UsedAppearance()) { nsITheme *theme = aParams.presCtx.GetTheme(); if (theme && theme->ThemeSupportsWidget(&aParams.presCtx, aParams.frame, - displayData->mAppearance)) { + displayData->UsedAppearance())) { nsRect drawing(aParams.borderArea); theme->GetWidgetOverflow(aParams.presCtx.DeviceContext(), - aParams.frame, displayData->mAppearance, + aParams.frame, displayData->UsedAppearance(), &drawing); drawing.IntersectRect(drawing, aParams.dirtyRect); theme->DrawWidgetBackground(&aParams.renderingCtx, aParams.frame, - displayData->mAppearance, aParams.borderArea, + displayData->UsedAppearance(), aParams.borderArea, drawing); return DrawResult::SUCCESS; } diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 53b4fa0190d5..ae091d2e1ce8 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -2924,7 +2924,7 @@ static nsStyleContext* GetBackgroundStyleContext(nsIFrame* aFrame) // a root, other wise keep going in order to let the theme stuff // draw the background. The canvas really should be drawing the // bg, but there's no way to hook that up via css. - if (!aFrame->StyleDisplay()->mAppearance) { + if (!aFrame->StyleDisplay()->UsedAppearance()) { return nullptr; } @@ -3071,7 +3071,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil if (isThemed) { nsITheme* theme = presContext->GetTheme(); - if (theme->NeedToClearBackgroundBehindWidget(aFrame, aFrame->StyleDisplay()->mAppearance) && + if (theme->NeedToClearBackgroundBehindWidget(aFrame, aFrame->StyleDisplay()->UsedAppearance()) && aBuilder->IsInChromeDocumentOrPopup() && !aBuilder->IsInTransform()) { bgItemList.AppendNewToTop( new (aBuilder) nsDisplayClearBackground(aBuilder, aFrame)); @@ -3624,19 +3624,19 @@ nsDisplayThemedBackground::nsDisplayThemedBackground(nsDisplayListBuilder* aBuil MOZ_COUNT_CTOR(nsDisplayThemedBackground); const nsStyleDisplay* disp = mFrame->StyleDisplay(); - mAppearance = disp->mAppearance; + mAppearance = disp->UsedAppearance(); mFrame->IsThemed(disp, &mThemeTransparency); // Perform necessary RegisterThemeGeometry nsITheme* theme = mFrame->PresContext()->GetTheme(); nsITheme::ThemeGeometryType type = - theme->ThemeGeometryTypeForWidget(mFrame, disp->mAppearance); + theme->ThemeGeometryTypeForWidget(mFrame, disp->UsedAppearance()); if (type != nsITheme::eThemeGeometryTypeUnknown) { RegisterThemeGeometry(aBuilder, aFrame, type); } - if (disp->mAppearance == NS_THEME_WIN_BORDERLESS_GLASS || - disp->mAppearance == NS_THEME_WIN_GLASS) { + if (disp->UsedAppearance() == NS_THEME_WIN_BORDERLESS_GLASS || + disp->UsedAppearance() == NS_THEME_WIN_GLASS) { aBuilder->SetGlassDisplayItem(this); } @@ -3770,7 +3770,7 @@ nsDisplayThemedBackground::GetBoundsInternal() { nsRect r = mBackgroundRect - ToReferenceFrame(); presContext->GetTheme()-> GetWidgetOverflow(presContext->DeviceContext(), mFrame, - mFrame->StyleDisplay()->mAppearance, &r); + mFrame->StyleDisplay()->UsedAppearance(), &r); return r + ToReferenceFrame(); } diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 7b5bd47567cf..eeb5f73da6b3 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -2661,7 +2661,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay // otherwise equal to // mDisplay uint8_t mContain; // [reset] see nsStyleConsts.h NS_STYLE_CONTAIN_* -//private: XXX not yet +private: friend class nsComputedDOMStyle; friend class nsRuleNode; uint8_t mMozAppearance; // [reset] diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index 04a67290ed8e..0e53704722c5 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -508,7 +508,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // display background if we need to. if (aBuilder->IsForEventDelivery() || !StyleBackground()->IsTransparent(this) || - StyleDisplay()->mAppearance) { + StyleDisplay()->UsedAppearance()) { if (!tableFrame->IsBorderCollapse()) { nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, this, diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index e0805e534542..1d3e0eb82fee 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -1401,7 +1401,7 @@ static inline bool FrameHasBorderOrBackground(nsTableFrame* tableFrame, nsIFrame return true; } if (!f->StyleBackground()->IsTransparent(f) || - f->StyleDisplay()->mAppearance) { + f->StyleDisplay()->UsedAppearance()) { nsTableCellFrame *cellFrame = do_QueryFrame(f); // We could also return false here if the current frame is the root diff --git a/layout/xul/nsBox.cpp b/layout/xul/nsBox.cpp index f7ec5fead4e6..5d37d6c8d67c 100644 --- a/layout/xul/nsBox.cpp +++ b/layout/xul/nsBox.cpp @@ -299,13 +299,13 @@ nsBox::GetXULBorder(nsMargin& aMargin) aMargin.SizeTo(0,0,0,0); const nsStyleDisplay* disp = StyleDisplay(); - if (disp->mAppearance && gTheme) { + if (disp->UsedAppearance() && gTheme) { // Go to the theme for the border. nsPresContext *context = PresContext(); - if (gTheme->ThemeSupportsWidget(context, this, disp->mAppearance)) { + if (gTheme->ThemeSupportsWidget(context, this, disp->UsedAppearance())) { nsIntMargin margin(0, 0, 0, 0); gTheme->GetWidgetBorder(context->DeviceContext(), this, - disp->mAppearance, &margin); + disp->UsedAppearance(), &margin); aMargin.top = context->DevPixelsToAppUnits(margin.top); aMargin.right = context->DevPixelsToAppUnits(margin.right); aMargin.bottom = context->DevPixelsToAppUnits(margin.bottom); @@ -323,15 +323,15 @@ nsresult nsBox::GetXULPadding(nsMargin& aMargin) { const nsStyleDisplay *disp = StyleDisplay(); - if (disp->mAppearance && gTheme) { + if (disp->UsedAppearance() && gTheme) { // Go to the theme for the padding. nsPresContext *context = PresContext(); - if (gTheme->ThemeSupportsWidget(context, this, disp->mAppearance)) { + if (gTheme->ThemeSupportsWidget(context, this, disp->UsedAppearance())) { nsIntMargin margin(0, 0, 0, 0); bool useThemePadding; useThemePadding = gTheme->GetWidgetPadding(context->DeviceContext(), - this, disp->mAppearance, + this, disp->UsedAppearance(), &margin); if (useThemePadding) { aMargin.top = context->DevPixelsToAppUnits(margin.top); @@ -669,12 +669,12 @@ nsIFrame::AddXULMinSize(nsBoxLayoutState& aState, nsIFrame* aBox, nsSize& aSize, // See if a native theme wants to supply a minimum size. const nsStyleDisplay* display = aBox->StyleDisplay(); - if (display->mAppearance) { + if (display->UsedAppearance()) { nsITheme *theme = aState.PresContext()->GetTheme(); - if (theme && theme->ThemeSupportsWidget(aState.PresContext(), aBox, display->mAppearance)) { + if (theme && theme->ThemeSupportsWidget(aState.PresContext(), aBox, display->UsedAppearance())) { LayoutDeviceIntSize size; theme->GetMinimumWidgetSize(aState.PresContext(), aBox, - display->mAppearance, &size, &canOverride); + display->UsedAppearance(), &size, &canOverride); if (size.width) { aSize.width = aState.PresContext()->DevPixelsToAppUnits(size.width); aWidthSet = true; diff --git a/layout/xul/nsBoxFrame.cpp b/layout/xul/nsBoxFrame.cpp index dd9e5dd3e640..3a36831bfe76 100644 --- a/layout/xul/nsBoxFrame.cpp +++ b/layout/xul/nsBoxFrame.cpp @@ -1323,7 +1323,7 @@ nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // Check for frames that are marked as a part of the region used // in calculating glass margins on Windows. const nsStyleDisplay* styles = StyleDisplay(); - if (styles && styles->mAppearance == NS_THEME_WIN_EXCLUDE_GLASS) { + if (styles && styles->UsedAppearance() == NS_THEME_WIN_EXCLUDE_GLASS) { aBuilder->AddWindowExcludeGlassRegion( nsRect(aBuilder->ToReferenceFrame(this), GetSize())); } diff --git a/layout/xul/nsImageBoxFrame.cpp b/layout/xul/nsImageBoxFrame.cpp index bab24227ec7b..8ec460d6adaa 100644 --- a/layout/xul/nsImageBoxFrame.cpp +++ b/layout/xul/nsImageBoxFrame.cpp @@ -256,7 +256,7 @@ nsImageBoxFrame::UpdateImage() } else { // Only get the list-style-image if we aren't being drawn // by a native theme. - uint8_t appearance = StyleDisplay()->mAppearance; + uint8_t appearance = StyleDisplay()->UsedAppearance(); if (!(appearance && nsBox::gTheme && nsBox::gTheme->ThemeSupportsWidget(nullptr, this, appearance))) { // get the list-style-image @@ -532,8 +532,8 @@ nsImageBoxFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext) // If we're using a native theme implementation, we shouldn't draw anything. const nsStyleDisplay* disp = StyleDisplay(); - if (disp->mAppearance && nsBox::gTheme && - nsBox::gTheme->ThemeSupportsWidget(nullptr, this, disp->mAppearance)) + if (disp->UsedAppearance() && nsBox::gTheme && + nsBox::gTheme->ThemeSupportsWidget(nullptr, this, disp->UsedAppearance())) return; // If list-style-image changes, we have a new image. diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index 1be0362bf02f..68d8e1fc6e50 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -338,7 +338,7 @@ nsMenuPopupFrame::GetShadowStyle() if (shadow != NS_STYLE_WINDOW_SHADOW_DEFAULT) return shadow; - switch (StyleDisplay()->mAppearance) { + switch (StyleDisplay()->UsedAppearance()) { case NS_THEME_TOOLTIP: return NS_STYLE_WINDOW_SHADOW_TOOLTIP; case NS_THEME_MENUPOPUP: diff --git a/layout/xul/nsScrollbarFrame.cpp b/layout/xul/nsScrollbarFrame.cpp index 5beaf6d1b400..60bea378194a 100644 --- a/layout/xul/nsScrollbarFrame.cpp +++ b/layout/xul/nsScrollbarFrame.cpp @@ -296,13 +296,13 @@ nsScrollbarFrame::MoveToNewPosition() // See if we have appearance information for a theme. const nsStyleDisplay* disp = StyleDisplay(); nsPresContext* presContext = PresContext(); - if (disp->mAppearance) { + if (disp->UsedAppearance()) { nsITheme *theme = presContext->GetTheme(); - if (theme && theme->ThemeSupportsWidget(presContext, this, disp->mAppearance)) { + if (theme && theme->ThemeSupportsWidget(presContext, this, disp->UsedAppearance())) { bool repaint; nsAttrValue oldValue; oldValue.SetTo(oldCurpos); - theme->WidgetStateChanged(this, disp->mAppearance, nsGkAtoms::curpos, + theme->WidgetStateChanged(this, disp->UsedAppearance(), nsGkAtoms::curpos, &repaint, &oldValue); } } diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index 4ac6cf65d32c..10b4315fa2b2 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -2075,16 +2075,16 @@ nsTreeBodyFrame::GetTwistyRect(int32_t aRowIndex, bool useTheme = false; nsITheme *theme = nullptr; const nsStyleDisplay* twistyDisplayData = aTwistyContext->StyleDisplay(); - if (twistyDisplayData->mAppearance) { + if (twistyDisplayData->UsedAppearance()) { theme = aPresContext->GetTheme(); - if (theme && theme->ThemeSupportsWidget(aPresContext, nullptr, twistyDisplayData->mAppearance)) + if (theme && theme->ThemeSupportsWidget(aPresContext, nullptr, twistyDisplayData->UsedAppearance())) useTheme = true; } if (useTheme) { LayoutDeviceIntSize minTwistySizePx; bool canOverride = true; - theme->GetMinimumWidgetSize(aPresContext, this, twistyDisplayData->mAppearance, + theme->GetMinimumWidgetSize(aPresContext, this, twistyDisplayData->UsedAppearance(), &minTwistySizePx, &canOverride); // GMWS() returns size in pixels, we need to convert it back to app units @@ -2851,7 +2851,7 @@ nsTreeBodyFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // geometrics for the row. In order to make the vibrancy effect to work // properly, we also need the tree to be themed as a source list. if (selection && treeFrame && theme && - treeFrame->StyleDisplay()->mAppearance == NS_THEME_MAC_SOURCE_LIST) { + treeFrame->StyleDisplay()->UsedAppearance() == NS_THEME_MAC_SOURCE_LIST) { // Loop through our onscreen rows. If the row is selected and a // -moz-appearance is provided, RegisterThemeGeometry might be necessary. const auto end = std::min(mRowCount, LastVisibleRow() + 1); @@ -2865,7 +2865,7 @@ nsTreeBodyFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, nsTreeUtils::TokenizeProperties(properties, mScratchArray); nsStyleContext* rowContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreerow); - auto appearance = rowContext->StyleDisplay()->mAppearance; + auto appearance = rowContext->StyleDisplay()->UsedAppearance(); if (appearance) { if (theme->ThemeSupportsWidget(PresContext(), this, appearance)) { nsITheme::ThemeGeometryType type = @@ -3045,7 +3045,7 @@ nsTreeBodyFrame::PaintRow(int32_t aRowIndex, // Paint our borders and background for our row rect. nsITheme* theme = nullptr; - auto appearance = rowContext->StyleDisplay()->mAppearance; + auto appearance = rowContext->StyleDisplay()->UsedAppearance(); if (appearance) { theme = aPresContext->GetTheme(); } @@ -3186,9 +3186,9 @@ nsTreeBodyFrame::PaintSeparator(int32_t aRowIndex, bool useTheme = false; nsITheme *theme = nullptr; const nsStyleDisplay* displayData = separatorContext->StyleDisplay(); - if ( displayData->mAppearance ) { + if ( displayData->UsedAppearance() ) { theme = aPresContext->GetTheme(); - if (theme && theme->ThemeSupportsWidget(aPresContext, nullptr, displayData->mAppearance)) + if (theme && theme->ThemeSupportsWidget(aPresContext, nullptr, displayData->UsedAppearance())) useTheme = true; } @@ -3199,7 +3199,7 @@ nsTreeBodyFrame::PaintSeparator(int32_t aRowIndex, nsRect dirty; dirty.IntersectRect(aSeparatorRect, aDirtyRect); theme->DrawWidgetBackground(&aRenderingContext, this, - displayData->mAppearance, aSeparatorRect, dirty); + displayData->UsedAppearance(), aSeparatorRect, dirty); } else { const nsStylePosition* stylePosition = separatorContext->StylePosition(); @@ -3503,7 +3503,7 @@ nsTreeBodyFrame::PaintTwisty(int32_t aRowIndex, nsRect dirty; dirty.IntersectRect(twistyRect, aDirtyRect); theme->DrawWidgetBackground(&aRenderingContext, this, - twistyContext->StyleDisplay()->mAppearance, twistyRect, dirty); + twistyContext->StyleDisplay()->UsedAppearance(), twistyRect, dirty); } else { // Time to paint the twisty. diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index 3c869544241d..8f999eba2e3b 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -311,7 +311,7 @@ static BOOL IsToolbarStyleContainer(nsIFrame* aFrame) nsGkAtoms::statusbar)) return YES; - switch (aFrame->StyleDisplay()->mAppearance) { + switch (aFrame->StyleDisplay()->UsedAppearance()) { case NS_THEME_TOOLBAR: case NS_THEME_STATUSBAR: return YES; @@ -516,7 +516,7 @@ static BOOL IsActive(nsIFrame* aFrame, BOOL aIsToolbarControl) static bool IsInSourceList(nsIFrame* aFrame) { for (nsIFrame* frame = aFrame->GetParent(); frame; frame = frame->GetParent()) { - if (frame->StyleDisplay()->mAppearance == NS_THEME_MAC_SOURCE_LIST) { + if (frame->StyleDisplay()->UsedAppearance() == NS_THEME_MAC_SOURCE_LIST) { return true; } } @@ -2761,7 +2761,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext, BOOL isHorizontal = (aWidgetType == NS_THEME_SCROLLBARTHUMB_HORIZONTAL); BOOL isRolledOver = IsParentScrollbarRolledOver(aFrame); nsIFrame* scrollbarFrame = GetParentScrollbarFrame(aFrame); - bool isSmall = (scrollbarFrame && scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL); + bool isSmall = (scrollbarFrame && scrollbarFrame->StyleDisplay()->UsedAppearance() == NS_THEME_SCROLLBAR_SMALL); if (isOverlay && !isRolledOver) { if (isHorizontal) { macRect.origin.y += 4; @@ -2811,7 +2811,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext, if (!isOverlay || IsParentScrollbarRolledOver(aFrame)) { BOOL isHorizontal = (aWidgetType == NS_THEME_SCROLLBARTRACK_HORIZONTAL); nsIFrame* scrollbarFrame = GetParentScrollbarFrame(aFrame); - bool isSmall = (scrollbarFrame && scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL); + bool isSmall = (scrollbarFrame && scrollbarFrame->StyleDisplay()->UsedAppearance() == NS_THEME_SCROLLBAR_SMALL); const BOOL isOnTopOfDarkBackground = IsDarkBackground(aFrame); RenderWithCoreUI(macRect, cgContext, [NSDictionary dictionaryWithObjectsAndKeys: @@ -3382,7 +3382,7 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, if (!scrollbarFrame) return NS_ERROR_FAILURE; - bool isSmall = (scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL); + bool isSmall = (scrollbarFrame->StyleDisplay()->UsedAppearance() == NS_THEME_SCROLLBAR_SMALL); bool isHorizontal = (aWidgetType == NS_THEME_SCROLLBARTHUMB_HORIZONTAL); int32_t& minSize = isHorizontal ? aResult->width : aResult->height; minSize = isSmall ? kSmallScrollbarThumbMinSize : kRegularScrollbarThumbMinSize; @@ -3399,7 +3399,7 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, if (nsLookAndFeel::UseOverlayScrollbars()) { nsIFrame* scrollbarFrame = GetParentScrollbarFrame(aFrame); if (scrollbarFrame && - scrollbarFrame->StyleDisplay()->mAppearance == + scrollbarFrame->StyleDisplay()->UsedAppearance() == NS_THEME_SCROLLBAR_SMALL) { aResult->SizeTo(14, 14); } @@ -3417,7 +3417,7 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame *scrollbarFrame = GetParentScrollbarFrame(aFrame); if (!scrollbarFrame) return NS_ERROR_FAILURE; - int32_t themeMetric = (scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL) ? + int32_t themeMetric = (scrollbarFrame->StyleDisplay()->UsedAppearance() == NS_THEME_SCROLLBAR_SMALL) ? kThemeMetricSmallScrollBarWidth : kThemeMetricScrollBarWidth; SInt32 scrollbarWidth = 0; @@ -3433,7 +3433,7 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, if (aFrame) { nsIFrame* scrollbarFrame = GetParentScrollbarFrame(aFrame); if (scrollbarFrame && - scrollbarFrame->StyleDisplay()->mAppearance == + scrollbarFrame->StyleDisplay()->UsedAppearance() == NS_THEME_SCROLLBAR_SMALL) { // XXX We're interested in the width of non-disappearing scrollbars // to leave enough space for a dropmarker in non-native styled @@ -3458,7 +3458,7 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, if (!scrollbarFrame) return NS_ERROR_FAILURE; // Since there is no NS_THEME_SCROLLBARBUTTON_UP_SMALL we need to ask the parent what appearance style it has. - int32_t themeMetric = (scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL) ? + int32_t themeMetric = (scrollbarFrame->StyleDisplay()->UsedAppearance() == NS_THEME_SCROLLBAR_SMALL) ? kThemeMetricSmallScrollBarWidth : kThemeMetricScrollBarWidth; SInt32 scrollbarWidth = 0; diff --git a/widget/nsNativeTheme.cpp b/widget/nsNativeTheme.cpp index d6e473f86160..24eb7dca39ec 100644 --- a/widget/nsNativeTheme.cpp +++ b/widget/nsNativeTheme.cpp @@ -287,7 +287,7 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame, parentFrame = parentFrame->GetParent(); if (parentFrame) { return IsWidgetStyled(aPresContext, parentFrame, - parentFrame->StyleDisplay()->mAppearance); + parentFrame->StyleDisplay()->UsedAppearance()); } } } @@ -698,7 +698,7 @@ nsNativeTheme::GetAdjacentSiblingFrameWithSameAppearance(nsIFrame* aFrame, // Check same appearance and adjacency. if (!sibling || - sibling->StyleDisplay()->mAppearance != aFrame->StyleDisplay()->mAppearance || + sibling->StyleDisplay()->UsedAppearance() != aFrame->StyleDisplay()->UsedAppearance() || (sibling->GetRect().XMost() != aFrame->GetRect().x && aFrame->GetRect().XMost() != sibling->GetRect().x)) return nullptr; diff --git a/widget/windows/nsNativeThemeWin.cpp b/widget/windows/nsNativeThemeWin.cpp index e4224e127464..a03a7de7c7b8 100644 --- a/widget/windows/nsNativeThemeWin.cpp +++ b/widget/windows/nsNativeThemeWin.cpp @@ -926,7 +926,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType, else { nsIFrame *parent = aFrame->GetParent(); EventStates parentState = - GetContentState(parent, parent->StyleDisplay()->mAppearance); + GetContentState(parent, parent->StyleDisplay()->UsedAppearance()); if (eventState.HasAllStates(NS_EVENT_STATE_HOVER | NS_EVENT_STATE_ACTIVE)) aState += TS_ACTIVE; else if (eventState.HasState(NS_EVENT_STATE_HOVER))