From ffce5ed7d6070ccfc726e546e91279279e07b89f Mon Sep 17 00:00:00 2001 From: Ting-Yu Lin Date: Mon, 25 Jan 2021 22:29:31 +0000 Subject: [PATCH] Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert This patch adds the struct as a parameter to various functions. The struct is cached in ReflowInput so that we don't need to pass it down to the internal method where nsIFrame::ComputeSize() is called. In the subsequent patches, we'll use it to revise the implementation of flex container's flex base size resolution, and size overrides. Differential Revision: https://phabricator.services.mozilla.com/D101793 --- layout/forms/nsCheckboxRadioFrame.cpp | 6 ++-- layout/forms/nsCheckboxRadioFrame.h | 3 +- layout/forms/nsMeterFrame.cpp | 3 +- layout/forms/nsMeterFrame.h | 1 + layout/forms/nsProgressFrame.cpp | 3 +- layout/forms/nsProgressFrame.h | 1 + layout/forms/nsRangeFrame.cpp | 3 +- layout/forms/nsRangeFrame.h | 3 +- layout/forms/nsTextControlFrame.cpp | 11 ++++--- layout/forms/nsTextControlFrame.h | 1 + layout/generic/BlockReflowInput.cpp | 2 +- layout/generic/ReflowInput.cpp | 16 ++++++---- layout/generic/ReflowInput.h | 21 ++++++++++++- layout/generic/nsBackdropFrame.cpp | 3 +- layout/generic/nsBackdropFrame.h | 3 +- layout/generic/nsBlockFrame.cpp | 2 +- layout/generic/nsContainerFrame.cpp | 6 ++-- layout/generic/nsContainerFrame.h | 2 ++ layout/generic/nsFirstLetterFrame.cpp | 5 +-- layout/generic/nsFirstLetterFrame.h | 14 ++++----- layout/generic/nsFlexContainerFrame.cpp | 2 +- layout/generic/nsGridContainerFrame.cpp | 6 ++-- layout/generic/nsHTMLCanvasFrame.cpp | 5 +-- layout/generic/nsHTMLCanvasFrame.h | 14 ++++----- layout/generic/nsIFrame.cpp | 10 +++--- layout/generic/nsIFrame.h | 16 ++++++++-- layout/generic/nsImageFrame.cpp | 5 +-- layout/generic/nsImageFrame.h | 14 ++++----- layout/generic/nsInlineFrame.cpp | 3 +- layout/generic/nsInlineFrame.h | 14 ++++----- layout/generic/nsLeafFrame.cpp | 3 +- layout/generic/nsLeafFrame.h | 3 +- layout/generic/nsRubyBaseContainerFrame.cpp | 3 +- layout/generic/nsRubyBaseContainerFrame.h | 14 ++++----- layout/generic/nsSubDocumentFrame.cpp | 10 +++--- layout/generic/nsSubDocumentFrame.h | 15 ++++----- layout/generic/nsTextFrame.cpp | 3 +- layout/generic/nsTextFrame.h | 14 ++++----- layout/generic/nsVideoFrame.cpp | 11 ++++--- layout/generic/nsVideoFrame.h | 14 ++++----- layout/mathml/nsMathMLSelectedFrame.cpp | 6 ++-- layout/mathml/nsMathMLSelectedFrame.h | 14 ++++----- layout/svg/SVGOuterSVGFrame.cpp | 4 +-- layout/svg/SVGOuterSVGFrame.h | 13 ++++---- layout/tables/nsTableFrame.cpp | 12 ++++--- layout/tables/nsTableFrame.h | 19 +++++------ layout/tables/nsTableWrapperFrame.cpp | 35 ++++++++++++--------- layout/tables/nsTableWrapperFrame.h | 14 +++++---- layout/xul/nsLeafBoxFrame.cpp | 5 +-- layout/xul/nsLeafBoxFrame.h | 3 +- 50 files changed, 245 insertions(+), 168 deletions(-) diff --git a/layout/forms/nsCheckboxRadioFrame.cpp b/layout/forms/nsCheckboxRadioFrame.cpp index 13c131e72031..c4eb0530c12d 100644 --- a/layout/forms/nsCheckboxRadioFrame.cpp +++ b/layout/forms/nsCheckboxRadioFrame.cpp @@ -67,7 +67,8 @@ nscoord nsCheckboxRadioFrame::GetPrefISize(gfxContext* aRenderingContext) { LogicalSize nsCheckboxRadioFrame::ComputeAutoSize( gfxContext* aRC, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { LogicalSize size(aWM, 0, 0); if (!StyleDisplay()->HasAppearance()) { return size; @@ -75,7 +76,8 @@ LogicalSize nsCheckboxRadioFrame::ComputeAutoSize( // Note: this call always set the BSize to NS_UNCONSTRAINEDSIZE. size = nsAtomicContainerFrame::ComputeAutoSize( - aRC, aWM, aCBSize, aAvailableISize, aMargin, aBorderPadding, aFlags); + aRC, aWM, aCBSize, aAvailableISize, aMargin, aBorderPadding, + aSizeOverrides, aFlags); size.BSize(aWM) = DefaultSize(); return size; } diff --git a/layout/forms/nsCheckboxRadioFrame.h b/layout/forms/nsCheckboxRadioFrame.h index f35fa5471f2b..ada215eedef6 100644 --- a/layout/forms/nsCheckboxRadioFrame.h +++ b/layout/forms/nsCheckboxRadioFrame.h @@ -48,11 +48,12 @@ class nsCheckboxRadioFrame final : public nsAtomicContainerFrame, /** * Our auto size is just intrinsic width and intrinsic height. */ - virtual mozilla::LogicalSize ComputeAutoSize( + mozilla::LogicalSize ComputeAutoSize( gfxContext* aRenderingContext, mozilla::WritingMode aWM, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; /** diff --git a/layout/forms/nsMeterFrame.cpp b/layout/forms/nsMeterFrame.cpp index 71cdf81ec268..d43b9d17a403 100644 --- a/layout/forms/nsMeterFrame.cpp +++ b/layout/forms/nsMeterFrame.cpp @@ -187,7 +187,8 @@ nsresult nsMeterFrame::AttributeChanged(int32_t aNameSpaceID, LogicalSize nsMeterFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { RefPtr fontMet = nsLayoutUtils::GetFontMetricsForFrame(this, 1.0f); diff --git a/layout/forms/nsMeterFrame.h b/layout/forms/nsMeterFrame.h index feb055b1e034..04fd4634ac02 100644 --- a/layout/forms/nsMeterFrame.h +++ b/layout/forms/nsMeterFrame.h @@ -53,6 +53,7 @@ class nsMeterFrame final : public nsContainerFrame, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; virtual nscoord GetMinISize(gfxContext* aRenderingContext) override; diff --git a/layout/forms/nsProgressFrame.cpp b/layout/forms/nsProgressFrame.cpp index deefa92e59b2..5b81e784ea76 100644 --- a/layout/forms/nsProgressFrame.cpp +++ b/layout/forms/nsProgressFrame.cpp @@ -204,7 +204,8 @@ nsresult nsProgressFrame::AttributeChanged(int32_t aNameSpaceID, LogicalSize nsProgressFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { const WritingMode wm = GetWritingMode(); LogicalSize autoSize(wm); autoSize.BSize(wm) = autoSize.ISize(wm) = diff --git a/layout/forms/nsProgressFrame.h b/layout/forms/nsProgressFrame.h index 98e8eb369e8d..2e14fda10947 100644 --- a/layout/forms/nsProgressFrame.h +++ b/layout/forms/nsProgressFrame.h @@ -58,6 +58,7 @@ class nsProgressFrame final : public nsContainerFrame, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; virtual nscoord GetMinISize(gfxContext* aRenderingContext) override; diff --git a/layout/forms/nsRangeFrame.cpp b/layout/forms/nsRangeFrame.cpp index 5bcee56754ae..ff220e14fe9a 100644 --- a/layout/forms/nsRangeFrame.cpp +++ b/layout/forms/nsRangeFrame.cpp @@ -610,7 +610,8 @@ static mozilla::Length OneEm(nsRangeFrame* aFrame) { LogicalSize nsRangeFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { bool isInlineOriented = IsInlineOriented(); auto em = OneEm(this); diff --git a/layout/forms/nsRangeFrame.h b/layout/forms/nsRangeFrame.h index 1202c5cccafa..a877a04bf82a 100644 --- a/layout/forms/nsRangeFrame.h +++ b/layout/forms/nsRangeFrame.h @@ -71,11 +71,12 @@ class nsRangeFrame final : public nsContainerFrame, virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute, int32_t aModType) override; - virtual mozilla::LogicalSize ComputeAutoSize( + mozilla::LogicalSize ComputeAutoSize( gfxContext* aRenderingContext, mozilla::WritingMode aWM, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; virtual nscoord GetMinISize(gfxContext* aRenderingContext) override; diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index d193db08813d..b9f627fc6f5d 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -560,7 +560,8 @@ nscoord nsTextControlFrame::GetMinISize(gfxContext* aRenderingContext) { LogicalSize nsTextControlFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { float inflation = nsLayoutUtils::FontSizeInflationFor(this); LogicalSize autoSize = CalcIntrinsicSize(aRenderingContext, aWM, inflation); @@ -573,16 +574,16 @@ LogicalSize nsTextControlFrame::ComputeAutoSize( // fall back to nsContainerFrame's ComputeAutoSize to handle that. // XXX maybe a font-inflation issue here? (per the assertion below). autoSize.ISize(aWM) = - nsContainerFrame::ComputeAutoSize(aRenderingContext, aWM, aCBSize, - aAvailableISize, aMargin, - aBorderPadding, aFlags) + nsContainerFrame::ComputeAutoSize( + aRenderingContext, aWM, aCBSize, aAvailableISize, aMargin, + aBorderPadding, aSizeOverrides, aFlags) .ISize(aWM); } #ifdef DEBUG else { LogicalSize ancestorAutoSize = nsContainerFrame::ComputeAutoSize( aRenderingContext, aWM, aCBSize, aAvailableISize, aMargin, - aBorderPadding, aFlags); + aBorderPadding, aSizeOverrides, aFlags); // Disabled when there's inflation; see comment in GetXULPrefSize. MOZ_ASSERT(inflation != 1.0f || ancestorAutoSize.ISize(aWM) == autoSize.ISize(aWM), diff --git a/layout/forms/nsTextControlFrame.h b/layout/forms/nsTextControlFrame.h index 2f844ad49a0c..2965a40d17bc 100644 --- a/layout/forms/nsTextControlFrame.h +++ b/layout/forms/nsTextControlFrame.h @@ -70,6 +70,7 @@ class nsTextControlFrame : public nsContainerFrame, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, diff --git a/layout/generic/BlockReflowInput.cpp b/layout/generic/BlockReflowInput.cpp index 5ad417b16cbf..31193aef8bbf 100644 --- a/layout/generic/BlockReflowInput.cpp +++ b/layout/generic/BlockReflowInput.cpp @@ -621,7 +621,7 @@ static nscoord FloatMarginISize(const ReflowInput& aCBReflowInput, aCBReflowInput.mRenderingContext, wm, aCBReflowInput.ComputedSize(wm), aFloatAvailableISize, aFloatOffsetState.ComputedLogicalMargin(wm).Size(wm), - aFloatOffsetState.ComputedLogicalBorderPadding(wm).Size(wm), + aFloatOffsetState.ComputedLogicalBorderPadding(wm).Size(wm), {}, ComputeSizeFlag::ShrinkWrap); WritingMode cbwm = aCBReflowInput.GetWritingMode(); diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index e90f9e679b5e..4607c7d31fe1 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -156,7 +156,9 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext, const ReflowInput& aParentReflowInput, nsIFrame* aFrame, const LogicalSize& aAvailableSpace, const Maybe& aContainingBlockSize, - InitFlags aFlags, ComputeSizeFlags aComputeSizeFlags) + InitFlags aFlags, + const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aComputeSizeFlags) : SizeComputationInput(aFrame, aParentReflowInput.mRenderingContext), mParentReflowInput(&aParentReflowInput), mFloatManager(aParentReflowInput.mFloatManager), @@ -169,6 +171,7 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext, ? aParentReflowInput.mPercentBSizeObserver : nullptr), mFlags(aParentReflowInput.mFlags), + mStyleSizeOverrides(aSizeOverrides), mComputeSizeFlags(aComputeSizeFlags), mReflowDepth(aParentReflowInput.mReflowDepth + 1), mAvailableSize(aAvailableSpace) { @@ -1620,7 +1623,7 @@ void ReflowInput::InitAbsoluteConstraints(nsPresContext* aPresContext, cbSize.ConvertTo(wm, cbwm).ISize(wm), // XXX or AvailableISize()? ComputedLogicalMargin(wm).Size(wm) + ComputedLogicalOffsets(wm).Size(wm), - ComputedLogicalBorderPadding(wm).Size(wm), mComputeSizeFlags); + ComputedLogicalBorderPadding(wm).Size(wm), {}, mComputeSizeFlags); ComputedISize() = sizeResult.mLogicalSize.ISize(wm); ComputedBSize() = sizeResult.mLogicalSize.BSize(wm); NS_ASSERTION(ComputedISize() >= 0, "Bogus inline-size"); @@ -2346,10 +2349,11 @@ void ReflowInput::InitConstraints( cbSize.ISize(wm) = AvailableISize(); } - auto size = mFrame->ComputeSize( - mRenderingContext, wm, cbSize, AvailableISize(), - ComputedLogicalMargin(wm).Size(wm), - ComputedLogicalBorderPadding(wm).Size(wm), mComputeSizeFlags); + auto size = + mFrame->ComputeSize(mRenderingContext, wm, cbSize, AvailableISize(), + ComputedLogicalMargin(wm).Size(wm), + ComputedLogicalBorderPadding(wm).Size(wm), + mStyleSizeOverrides, mComputeSizeFlags); ComputedISize() = size.mLogicalSize.ISize(wm); ComputedBSize() = size.mLogicalSize.BSize(wm); diff --git a/layout/generic/ReflowInput.h b/layout/generic/ReflowInput.h index e86abc0f7629..305d0f0a4d23 100644 --- a/layout/generic/ReflowInput.h +++ b/layout/generic/ReflowInput.h @@ -30,7 +30,20 @@ class nsReflowStatus; namespace mozilla { enum class LayoutFrameType : uint8_t; -} + +/** + * A set of StyleSizes used as an input parameter to various functions that + * compute sizes like nsIFrame::ComputeSize(). If any of the member fields has a + * value, the function may use the value instead of retrieving it from the + * frame's style. + * + * The logical sizes are assumed to be in the associated frame's writing-mode. + */ +struct StyleSizeOverrides { + Maybe mStyleISize; + Maybe mStyleBSize; +}; +} // namespace mozilla /** * @return aValue clamped to [aMinValue, aMaxValue]. @@ -512,6 +525,9 @@ struct ReflowInput : public SizeComputationInput { bool mIsBSizeSetByAspectRatio : 1; }; Flags mFlags; + + mozilla::StyleSizeOverrides mStyleSizeOverrides; + mozilla::ComputeSizeFlags mComputeSizeFlags; // This value keeps track of how deeply nested a given reflow input @@ -612,6 +628,8 @@ struct ReflowInput : public SizeComputationInput { * Init() instead. * @param aFlags A set of flags used for additional boolean parameters (see * InitFlags above). + * @param aStyleSizeOverrides The style data used to override mFrame's when we + * call nsIFrame::ComputeSize() internally. * @param aComputeSizeFlags A set of flags used when we call * nsIFrame::ComputeSize() internally. */ @@ -621,6 +639,7 @@ struct ReflowInput : public SizeComputationInput { const mozilla::Maybe& aContainingBlockSize = mozilla::Nothing(), InitFlags aFlags = {}, + const mozilla::StyleSizeOverrides& aSizeOverrides = {}, mozilla::ComputeSizeFlags aComputeSizeFlags = {}); /** diff --git a/layout/generic/nsBackdropFrame.cpp b/layout/generic/nsBackdropFrame.cpp index ce7ec87d9b27..1b39ab3184aa 100644 --- a/layout/generic/nsBackdropFrame.cpp +++ b/layout/generic/nsBackdropFrame.cpp @@ -49,7 +49,8 @@ void nsBackdropFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, LogicalSize nsBackdropFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { // Note that this frame is a child of the viewport frame. LogicalSize result(aWM, 0xdeadbeef, NS_UNCONSTRAINEDSIZE); if (aFlags.contains(ComputeSizeFlag::ShrinkWrap)) { diff --git a/layout/generic/nsBackdropFrame.h b/layout/generic/nsBackdropFrame.h index 65c3810c0b1e..acc509e593ba 100644 --- a/layout/generic/nsBackdropFrame.h +++ b/layout/generic/nsBackdropFrame.h @@ -25,11 +25,12 @@ class nsBackdropFrame final : public nsIFrame { nsIFrame** aProviderFrame) const override; virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists) override; - virtual mozilla::LogicalSize ComputeAutoSize( + mozilla::LogicalSize ComputeAutoSize( gfxContext* aRenderingContext, mozilla::WritingMode aWM, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput, diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index c5fc6f371831..749b18b1a5fd 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -7411,7 +7411,7 @@ void nsBlockFrame::ReflowOutsideMarker(nsIFrame* aMarkerFrame, availSize.BSize(markerWM) = NS_UNCONSTRAINEDSIZE; ReflowInput reflowInput(aState.mPresContext, ri, aMarkerFrame, availSize, - Nothing(), {}, {ComputeSizeFlag::ShrinkWrap}); + Nothing(), {}, {}, {ComputeSizeFlag::ShrinkWrap}); nsReflowStatus status; aMarkerFrame->Reflow(aState.mPresContext, aMetrics, reflowInput, status); diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index 9e99ab7e8222..98d875a8fc36 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -977,7 +977,8 @@ void nsContainerFrame::DoInlineIntrinsicISize(gfxContext* aRenderingContext, LogicalSize nsContainerFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const mozilla::LogicalSize& aBorderPadding, + const StyleSizeOverrides& aSizeOverrides, ComputeSizeFlags aFlags) { LogicalSize result(aWM, 0xdeadbeef, NS_UNCONSTRAINEDSIZE); nscoord availBased = aAvailableISize - aMargin.ISize(aWM) - aBorderPadding.ISize(aWM); @@ -2390,7 +2391,8 @@ LogicalSize nsContainerFrame::ComputeSizeWithIntrinsicDimensions( gfxContext* aRenderingContext, WritingMode aWM, const IntrinsicSize& aIntrinsicSize, const AspectRatio& aAspectRatio, const LogicalSize& aCBSize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { const nsStylePosition* stylePos = StylePosition(); const auto* inlineStyleCoord = &stylePos->ISize(aWM); const auto* blockStyleCoord = &stylePos->BSize(aWM); diff --git a/layout/generic/nsContainerFrame.h b/layout/generic/nsContainerFrame.h index 7495ca0d0bbb..28117ca4c435 100644 --- a/layout/generic/nsContainerFrame.h +++ b/layout/generic/nsContainerFrame.h @@ -225,6 +225,7 @@ class nsContainerFrame : public nsSplittableFrame { const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; /** @@ -872,6 +873,7 @@ class nsContainerFrame : public nsSplittableFrame { const mozilla::AspectRatio& aAspectRatio, const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags); // Compute tight bounds assuming this frame honours its border, background diff --git a/layout/generic/nsFirstLetterFrame.cpp b/layout/generic/nsFirstLetterFrame.cpp index 220bf9fc4cea..5573d7400b9f 100644 --- a/layout/generic/nsFirstLetterFrame.cpp +++ b/layout/generic/nsFirstLetterFrame.cpp @@ -129,7 +129,8 @@ nscoord nsFirstLetterFrame::GetPrefISize(gfxContext* aRenderingContext) { nsIFrame::SizeComputationResult nsFirstLetterFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { if (GetPrevInFlow()) { // We're wrapping the text *after* the first letter, so behave like an // inline frame. @@ -138,7 +139,7 @@ nsIFrame::SizeComputationResult nsFirstLetterFrame::ComputeSize( } return nsContainerFrame::ComputeSize(aRenderingContext, aWM, aCBSize, aAvailableISize, aMargin, aBorderPadding, - aFlags); + aSizeOverrides, aFlags); } void nsFirstLetterFrame::Reflow(nsPresContext* aPresContext, diff --git a/layout/generic/nsFirstLetterFrame.h b/layout/generic/nsFirstLetterFrame.h index e79f8b071004..caeb5e858d5f 100644 --- a/layout/generic/nsFirstLetterFrame.h +++ b/layout/generic/nsFirstLetterFrame.h @@ -47,13 +47,13 @@ class nsFirstLetterFrame final : public nsContainerFrame { virtual void AddInlinePrefISize(gfxContext* aRenderingContext, InlinePrefISizeData* aData) override; - SizeComputationResult ComputeSize(gfxContext* aRenderingContext, - mozilla::WritingMode aWM, - const mozilla::LogicalSize& aCBSize, - nscoord aAvailableISize, - const mozilla::LogicalSize& aMargin, - const mozilla::LogicalSize& aBorderPadding, - mozilla::ComputeSizeFlags aFlags) override; + SizeComputationResult ComputeSize( + gfxContext* aRenderingContext, mozilla::WritingMode aWM, + const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, + const mozilla::LogicalSize& aMargin, + const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, + mozilla::ComputeSizeFlags aFlags) override; virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput, diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 18b3988749d2..56a4152f2809 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -1597,7 +1597,7 @@ void nsFlexContainerFrame::ResolveAutoFlexBasisAndMinSize( aItemReflowInput.mContainingBlockSize, availISize, aItemReflowInput.ComputedLogicalMargin(itemWM).Size(itemWM), aItemReflowInput.ComputedLogicalBorderPadding(itemWM).Size(itemWM), - {ComputeSizeFlag::UseAutoISize, ComputeSizeFlag::ShrinkWrap}); + {}, {ComputeSizeFlag::UseAutoISize, ComputeSizeFlag::ShrinkWrap}); contentSizeSuggestion = aAxisTracker.MainComponent( sizeInItemWM.mLogicalSize.ConvertTo(cbWM, itemWM)); diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index b584938c79c3..815965a62efa 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -4984,7 +4984,7 @@ static nscoord MeasuringReflow(nsIFrame* aChild, } else { aChild->RemoveProperty(nsIFrame::BClampMarginBoxMinSizeProperty()); } - ReflowInput childRI(pc, *rs, aChild, aAvailableSize, Some(aCBSize), {}, + ReflowInput childRI(pc, *rs, aChild, aAvailableSize, Some(aCBSize), {}, {}, csFlags); // Because we pass ComputeSizeFlag::UseAutoBSize, and the @@ -5036,7 +5036,7 @@ static void PostReflowStretchChild( aChild->RemoveProperty(nsIFrame::BClampMarginBoxMinSizeProperty()); } ReflowInput ri(pc, aReflowInput, aChild, aAvailableSize, Some(aCBSize), {}, - csFlags); + {}, csFlags); if (aChildAxis == eLogicalAxisBlock) { ri.SetComputedBSize(ri.ApplyMinMaxBSize(aNewContentBoxSize)); } else { @@ -7245,7 +7245,7 @@ void nsGridContainerFrame::ReflowInFlowChild( } LogicalSize percentBasis(cb.Size(wm).ConvertTo(childWM, wm)); ReflowInput childRI(pc, *aState.mReflowInput, aChild, childCBSize, - Some(percentBasis), {}, csFlags); + Some(percentBasis), {}, {}, csFlags); childRI.mFlags.mIsTopOfPage = aFragmentainer ? aFragmentainer->mIsTopOfPage : false; diff --git a/layout/generic/nsHTMLCanvasFrame.cpp b/layout/generic/nsHTMLCanvasFrame.cpp index 044720314097..5e252236e495 100644 --- a/layout/generic/nsHTMLCanvasFrame.cpp +++ b/layout/generic/nsHTMLCanvasFrame.cpp @@ -404,10 +404,11 @@ AspectRatio nsHTMLCanvasFrame::GetIntrinsicRatio() const { nsIFrame::SizeComputationResult nsHTMLCanvasFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { return {ComputeSizeWithIntrinsicDimensions( aRenderingContext, aWM, GetIntrinsicSize(), GetAspectRatio(), - aCBSize, aMargin, aBorderPadding, aFlags), + aCBSize, aMargin, aBorderPadding, aSizeOverrides, aFlags), AspectRatioUsage::None}; } diff --git a/layout/generic/nsHTMLCanvasFrame.h b/layout/generic/nsHTMLCanvasFrame.h index aed68018826f..f54fe22b5903 100644 --- a/layout/generic/nsHTMLCanvasFrame.h +++ b/layout/generic/nsHTMLCanvasFrame.h @@ -69,13 +69,13 @@ class nsHTMLCanvasFrame final : public nsContainerFrame { virtual mozilla::IntrinsicSize GetIntrinsicSize() override; mozilla::AspectRatio GetIntrinsicRatio() const override; - SizeComputationResult ComputeSize(gfxContext* aRenderingContext, - mozilla::WritingMode aWM, - const mozilla::LogicalSize& aCBSize, - nscoord aAvailableISize, - const mozilla::LogicalSize& aMargin, - const mozilla::LogicalSize& aBorderPadding, - mozilla::ComputeSizeFlags aFlags) override; + SizeComputationResult ComputeSize( + gfxContext* aRenderingContext, mozilla::WritingMode aWM, + const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, + const mozilla::LogicalSize& aMargin, + const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, + mozilla::ComputeSizeFlags aFlags) override; virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput, diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp index 89b063596adb..862b8cd28b39 100644 --- a/layout/generic/nsIFrame.cpp +++ b/layout/generic/nsIFrame.cpp @@ -6076,13 +6076,14 @@ static MinMaxSize ComputeTransferredMinMaxInlineSize( nsIFrame::SizeComputationResult nsIFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { MOZ_ASSERT(!GetIntrinsicRatio(), "Please override this method and call " "nsContainerFrame::ComputeSizeWithIntrinsicDimensions instead."); LogicalSize result = ComputeAutoSize(aRenderingContext, aWM, aCBSize, aAvailableISize, aMargin, - aBorderPadding, aFlags); + aBorderPadding, aSizeOverrides, aFlags); const nsStylePosition* stylePos = StylePosition(); const nsStyleDisplay* disp = StyleDisplay(); auto aspectRatioUsage = AspectRatioUsage::None; @@ -6431,7 +6432,8 @@ LogicalSize nsIFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, - const mozilla::LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const mozilla::LogicalSize& aBorderPadding, + const StyleSizeOverrides& aSizeOverrides, ComputeSizeFlags aFlags) { // Use basic shrink-wrapping as a default implementation. LogicalSize result(aWM, 0xdeadbeef, NS_UNCONSTRAINEDSIZE); @@ -10682,7 +10684,7 @@ void nsIFrame::BoxReflow(nsBoxLayoutState& aState, nsPresContext* aPresContext, ComputeSize( aRenderingContext, wm, logicalSize, logicalSize.ISize(wm), reflowInput.ComputedLogicalMargin(wm).Size(wm), - reflowInput.ComputedLogicalBorderPadding(wm).Size(wm), {}) + reflowInput.ComputedLogicalBorderPadding(wm).Size(wm), {}, {}) .mLogicalSize.Height(wm)); } } diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 935560688f82..1ae999de1a76 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -2741,6 +2741,9 @@ class nsIFrame : public nsQueryFrame { * @param aBorderPadding The sum of the frame's inline / block border-widths * and padding (including actual values resulting from * percentage padding values). + * @param aSizeOverride Optional override values for size properties, which + * this function will use internally instead of the + * actual property values. * @param aFlags Flags to further customize behavior (definitions in * LayoutConstants.h). * @@ -2767,6 +2770,7 @@ class nsIFrame : public nsQueryFrame { const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags); protected: @@ -2780,15 +2784,21 @@ class nsIFrame : public nsQueryFrame { * should override only ComputeAutoSize, and frames that cannot do so need to * override ComputeSize to enforce their inline-size/block-size invariants. * - * Implementations may optimize by returning a garbage width if - * StylePosition()->ISize() is not 'auto', and likewise for BSize(), since in - * such cases the result is guaranteed to be unused. + * Implementations may optimize by returning a garbage inline-size if + * StylePosition()->ISize() is not 'auto' (or inline-size override in + * aSizeOverrides is not 'auto' if provided), and likewise for BSize(), since + * in such cases the result is guaranteed to be unused. + * + * Most of the frame are not expected to check the aSizeOverrides parameter + * apart from checking the inline size override for 'auto' if they want to + * optimize and return garbage inline-size. */ virtual mozilla::LogicalSize ComputeAutoSize( gfxContext* aRenderingContext, mozilla::WritingMode aWM, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags); /** diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 41b846e56d09..7ab3790f58bd 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -962,11 +962,12 @@ void nsImageFrame::EnsureIntrinsicSizeAndRatio() { nsIFrame::SizeComputationResult nsImageFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { EnsureIntrinsicSizeAndRatio(); return {ComputeSizeWithIntrinsicDimensions( aRenderingContext, aWM, mIntrinsicSize, GetAspectRatio(), aCBSize, - aMargin, aBorderPadding, aFlags), + aMargin, aBorderPadding, aSizeOverrides, aFlags), AspectRatioUsage::None}; } diff --git a/layout/generic/nsImageFrame.h b/layout/generic/nsImageFrame.h index f2689c080d79..cb4366e448d4 100644 --- a/layout/generic/nsImageFrame.h +++ b/layout/generic/nsImageFrame.h @@ -215,13 +215,13 @@ class nsImageFrame : public nsAtomicContainerFrame, public nsIReflowCallback { return !HasAnyStateBits(NS_FRAME_FIRST_REFLOW); } - SizeComputationResult ComputeSize(gfxContext* aRenderingContext, - mozilla::WritingMode aWM, - const mozilla::LogicalSize& aCBSize, - nscoord aAvailableISize, - const mozilla::LogicalSize& aMargin, - const mozilla::LogicalSize& aBorderPadding, - mozilla::ComputeSizeFlags aFlags) final; + SizeComputationResult ComputeSize( + gfxContext* aRenderingContext, mozilla::WritingMode aWM, + const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, + const mozilla::LogicalSize& aMargin, + const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, + mozilla::ComputeSizeFlags aFlags) final; bool IsServerImageMap(); diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index 824cf56c2298..e463d53eaad3 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -243,7 +243,8 @@ void nsInlineFrame::AddInlinePrefISize(gfxContext* aRenderingContext, nsIFrame::SizeComputationResult nsInlineFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { // Inlines and text don't compute size before reflow. return {LogicalSize(aWM, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE), AspectRatioUsage::None}; diff --git a/layout/generic/nsInlineFrame.h b/layout/generic/nsInlineFrame.h index 77da4618e4e1..353d9cbe79fd 100644 --- a/layout/generic/nsInlineFrame.h +++ b/layout/generic/nsInlineFrame.h @@ -76,13 +76,13 @@ class nsInlineFrame : public nsContainerFrame { InlineMinISizeData* aData) override; virtual void AddInlinePrefISize(gfxContext* aRenderingContext, InlinePrefISizeData* aData) override; - SizeComputationResult ComputeSize(gfxContext* aRenderingContext, - mozilla::WritingMode aWM, - const mozilla::LogicalSize& aCBSize, - nscoord aAvailableISize, - const mozilla::LogicalSize& aMargin, - const mozilla::LogicalSize& aBorderPadding, - mozilla::ComputeSizeFlags aFlags) override; + SizeComputationResult ComputeSize( + gfxContext* aRenderingContext, mozilla::WritingMode aWM, + const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, + const mozilla::LogicalSize& aMargin, + const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, + mozilla::ComputeSizeFlags aFlags) override; virtual nsRect ComputeTightBounds(DrawTarget* aDrawTarget) const override; virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput, diff --git a/layout/generic/nsLeafFrame.cpp b/layout/generic/nsLeafFrame.cpp index 4bafc74142bb..2688da3d4bfc 100644 --- a/layout/generic/nsLeafFrame.cpp +++ b/layout/generic/nsLeafFrame.cpp @@ -42,7 +42,8 @@ nscoord nsLeafFrame::GetPrefISize(gfxContext* aRenderingContext) { LogicalSize nsLeafFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { const WritingMode wm = GetWritingMode(); LogicalSize result(wm, GetIntrinsicISize(), GetIntrinsicBSize()); return result.ConvertTo(aWM, wm); diff --git a/layout/generic/nsLeafFrame.h b/layout/generic/nsLeafFrame.h index 5dd5d88367ae..cc2780c4f046 100644 --- a/layout/generic/nsLeafFrame.h +++ b/layout/generic/nsLeafFrame.h @@ -37,11 +37,12 @@ class nsLeafFrame : public nsIFrame { /** * Our auto size is just intrinsic width and intrinsic height. */ - virtual mozilla::LogicalSize ComputeAutoSize( + mozilla::LogicalSize ComputeAutoSize( gfxContext* aRenderingContext, mozilla::WritingMode aWM, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; /** diff --git a/layout/generic/nsRubyBaseContainerFrame.cpp b/layout/generic/nsRubyBaseContainerFrame.cpp index 898876e96333..2a137fd17906 100644 --- a/layout/generic/nsRubyBaseContainerFrame.cpp +++ b/layout/generic/nsRubyBaseContainerFrame.cpp @@ -251,7 +251,8 @@ bool nsRubyBaseContainerFrame::CanContinueTextRun() const { return true; } nsIFrame::SizeComputationResult nsRubyBaseContainerFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { // Ruby base container frame is inline, // hence don't compute size before reflow. return {LogicalSize(aWM, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE), diff --git a/layout/generic/nsRubyBaseContainerFrame.h b/layout/generic/nsRubyBaseContainerFrame.h index a774a6580549..64df76c355cb 100644 --- a/layout/generic/nsRubyBaseContainerFrame.h +++ b/layout/generic/nsRubyBaseContainerFrame.h @@ -35,13 +35,13 @@ class nsRubyBaseContainerFrame final : public nsContainerFrame { InlineMinISizeData* aData) override; virtual void AddInlinePrefISize(gfxContext* aRenderingContext, InlinePrefISizeData* aData) override; - SizeComputationResult ComputeSize(gfxContext* aRenderingContext, - mozilla::WritingMode aWM, - const mozilla::LogicalSize& aCBSize, - nscoord aAvailableISize, - const mozilla::LogicalSize& aMargin, - const mozilla::LogicalSize& aBorderPadding, - mozilla::ComputeSizeFlags aFlags) override; + SizeComputationResult ComputeSize( + gfxContext* aRenderingContext, mozilla::WritingMode aWM, + const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, + const mozilla::LogicalSize& aMargin, + const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, + mozilla::ComputeSizeFlags aFlags) override; virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput, nsReflowStatus& aStatus) override; diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index 78ab42475730..b3b9389340ee 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -671,11 +671,12 @@ AspectRatio nsSubDocumentFrame::GetIntrinsicRatio() const { LogicalSize nsSubDocumentFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { if (!IsInline()) { return nsIFrame::ComputeAutoSize(aRenderingContext, aWM, aCBSize, aAvailableISize, aMargin, aBorderPadding, - aFlags); + aSizeOverrides, aFlags); } const WritingMode wm = GetWritingMode(); @@ -687,10 +688,11 @@ LogicalSize nsSubDocumentFrame::ComputeAutoSize( nsIFrame::SizeComputationResult nsSubDocumentFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { return {ComputeSizeWithIntrinsicDimensions( aRenderingContext, aWM, GetIntrinsicSize(), GetAspectRatio(), - aCBSize, aMargin, aBorderPadding, aFlags), + aCBSize, aMargin, aBorderPadding, aSizeOverrides, aFlags), AspectRatioUsage::None}; } diff --git a/layout/generic/nsSubDocumentFrame.h b/layout/generic/nsSubDocumentFrame.h index 875c5b9d6a7c..feb240399e9a 100644 --- a/layout/generic/nsSubDocumentFrame.h +++ b/layout/generic/nsSubDocumentFrame.h @@ -69,15 +69,16 @@ class nsSubDocumentFrame final : public nsAtomicContainerFrame, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; - SizeComputationResult ComputeSize(gfxContext* aRenderingContext, - mozilla::WritingMode aWM, - const mozilla::LogicalSize& aCBSize, - nscoord aAvailableISize, - const mozilla::LogicalSize& aMargin, - const mozilla::LogicalSize& aBorderPadding, - mozilla::ComputeSizeFlags aFlags) override; + SizeComputationResult ComputeSize( + gfxContext* aRenderingContext, mozilla::WritingMode aWM, + const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, + const mozilla::LogicalSize& aMargin, + const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, + mozilla::ComputeSizeFlags aFlags) override; void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput, diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index ef2652f791c4..527b5f75e1c7 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -8676,7 +8676,8 @@ void nsTextFrame::AddInlinePrefISize(gfxContext* aRenderingContext, nsIFrame::SizeComputationResult nsTextFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { // Inlines and text don't compute size before reflow. return {LogicalSize(aWM, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE), AspectRatioUsage::None}; diff --git a/layout/generic/nsTextFrame.h b/layout/generic/nsTextFrame.h index 66ed7eb17524..34a6b28f5d17 100644 --- a/layout/generic/nsTextFrame.h +++ b/layout/generic/nsTextFrame.h @@ -398,13 +398,13 @@ class nsTextFrame : public nsIFrame { InlineMinISizeData* aData) override; void AddInlinePrefISize(gfxContext* aRenderingContext, InlinePrefISizeData* aData) override; - SizeComputationResult ComputeSize(gfxContext* aRenderingContext, - mozilla::WritingMode aWM, - const mozilla::LogicalSize& aCBSize, - nscoord aAvailableISize, - const mozilla::LogicalSize& aMargin, - const mozilla::LogicalSize& aBorderPadding, - mozilla::ComputeSizeFlags aFlags) final; + SizeComputationResult ComputeSize( + gfxContext* aRenderingContext, mozilla::WritingMode aWM, + const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, + const mozilla::LogicalSize& aMargin, + const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, + mozilla::ComputeSizeFlags aFlags) final; nsRect ComputeTightBounds(DrawTarget* aDrawTarget) const final; nsresult GetPrefWidthTightBounds(gfxContext* aContext, nscoord* aX, nscoord* aXMost) final; diff --git a/layout/generic/nsVideoFrame.cpp b/layout/generic/nsVideoFrame.cpp index 9509a458f524..643d6f9b7c2f 100644 --- a/layout/generic/nsVideoFrame.cpp +++ b/layout/generic/nsVideoFrame.cpp @@ -556,16 +556,17 @@ nsresult nsVideoFrame::GetFrameName(nsAString& aResult) const { nsIFrame::SizeComputationResult nsVideoFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { if (!HasVideoElement()) { - return nsContainerFrame::ComputeSize(aRenderingContext, aWM, aCBSize, - aAvailableISize, aMargin, - aBorderPadding, aFlags); + return nsContainerFrame::ComputeSize( + aRenderingContext, aWM, aCBSize, aAvailableISize, aMargin, + aBorderPadding, aSizeOverrides, aFlags); } return {ComputeSizeWithIntrinsicDimensions( aRenderingContext, aWM, GetIntrinsicSize(), GetAspectRatio(), - aCBSize, aMargin, aBorderPadding, aFlags), + aCBSize, aMargin, aBorderPadding, aSizeOverrides, aFlags), AspectRatioUsage::None}; } diff --git a/layout/generic/nsVideoFrame.h b/layout/generic/nsVideoFrame.h index 46615e953c1c..5bf833cd1212 100644 --- a/layout/generic/nsVideoFrame.h +++ b/layout/generic/nsVideoFrame.h @@ -57,13 +57,13 @@ class nsVideoFrame final : public nsContainerFrame, nsSize GetVideoIntrinsicSize() const; mozilla::IntrinsicSize GetIntrinsicSize() override; mozilla::AspectRatio GetIntrinsicRatio() const override; - SizeComputationResult ComputeSize(gfxContext* aRenderingContext, - mozilla::WritingMode aWM, - const mozilla::LogicalSize& aCBSize, - nscoord aAvailableISize, - const mozilla::LogicalSize& aMargin, - const mozilla::LogicalSize& aBorderPadding, - mozilla::ComputeSizeFlags aFlags) override; + SizeComputationResult ComputeSize( + gfxContext* aRenderingContext, mozilla::WritingMode aWM, + const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, + const mozilla::LogicalSize& aMargin, + const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, + mozilla::ComputeSizeFlags aFlags) override; nscoord GetMinISize(gfxContext* aRenderingContext) override; nscoord GetPrefISize(gfxContext* aRenderingContext) override; void DestroyFrom(nsIFrame* aDestructRoot, diff --git a/layout/mathml/nsMathMLSelectedFrame.cpp b/layout/mathml/nsMathMLSelectedFrame.cpp index 677401a72275..af615158f769 100644 --- a/layout/mathml/nsMathMLSelectedFrame.cpp +++ b/layout/mathml/nsMathMLSelectedFrame.cpp @@ -80,7 +80,8 @@ void nsMathMLSelectedFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, nsIFrame::SizeComputationResult nsMathMLSelectedFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { nsIFrame* childFrame = GetSelectedFrame(); if (childFrame) { // Delegate size computation to the child frame. @@ -94,7 +95,8 @@ nsIFrame::SizeComputationResult nsMathMLSelectedFrame::ComputeSize( const auto bpSize = offsetState.ComputedLogicalBorderPadding(aWM).Size(aWM); auto size = childFrame->ComputeSize( aRenderingContext, aWM, cbSize, availableISize, - offsetState.ComputedLogicalMargin(aWM).Size(aWM), bpSize, aFlags); + offsetState.ComputedLogicalMargin(aWM).Size(aWM), bpSize, + aSizeOverrides, aFlags); return {size.mLogicalSize + bpSize, size.mAspectRatioUsage}; } return {LogicalSize(aWM), AspectRatioUsage::None}; diff --git a/layout/mathml/nsMathMLSelectedFrame.h b/layout/mathml/nsMathMLSelectedFrame.h index 34e1b288d361..c9f599a50167 100644 --- a/layout/mathml/nsMathMLSelectedFrame.h +++ b/layout/mathml/nsMathMLSelectedFrame.h @@ -27,13 +27,13 @@ class nsMathMLSelectedFrame : public nsMathMLContainerFrame { virtual nsresult Place(DrawTarget* aDrawTarget, bool aPlaceOrigin, ReflowOutput& aDesiredSize) override; - SizeComputationResult ComputeSize(gfxContext* aRenderingContext, - mozilla::WritingMode aWM, - const mozilla::LogicalSize& aCBSize, - nscoord aAvailableISize, - const mozilla::LogicalSize& aMargin, - const mozilla::LogicalSize& aBorderPadding, - mozilla::ComputeSizeFlags aFlags) override; + SizeComputationResult ComputeSize( + gfxContext* aRenderingContext, mozilla::WritingMode aWM, + const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, + const mozilla::LogicalSize& aMargin, + const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, + mozilla::ComputeSizeFlags aFlags) override; virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput, diff --git a/layout/svg/SVGOuterSVGFrame.cpp b/layout/svg/SVGOuterSVGFrame.cpp index 25ab213caaf3..43444da0e796 100644 --- a/layout/svg/SVGOuterSVGFrame.cpp +++ b/layout/svg/SVGOuterSVGFrame.cpp @@ -291,7 +291,7 @@ nsIFrame::SizeComputationResult SVGOuterSVGFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWritingMode, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, const LogicalSize& aBorderPadding, - ComputeSizeFlags aFlags) { + const StyleSizeOverrides& aSizeOverrides, ComputeSizeFlags aFlags) { if (IsRootOfImage() || mIsInObjectOrEmbed) { // The embedding element has sized itself using the CSS replaced element // sizing rules, using our intrinsic dimensions as necessary. The SVG spec @@ -353,7 +353,7 @@ nsIFrame::SizeComputationResult SVGOuterSVGFrame::ComputeSize( return {ComputeSizeWithIntrinsicDimensions( aRenderingContext, aWritingMode, intrinsicSize, GetAspectRatio(), - cbSize, aMargin, aBorderPadding, aFlags), + cbSize, aMargin, aBorderPadding, aSizeOverrides, aFlags), AspectRatioUsage::None}; } diff --git a/layout/svg/SVGOuterSVGFrame.h b/layout/svg/SVGOuterSVGFrame.h index a908a597fc1e..900064b0b6e8 100644 --- a/layout/svg/SVGOuterSVGFrame.h +++ b/layout/svg/SVGOuterSVGFrame.h @@ -62,13 +62,12 @@ class SVGOuterSVGFrame final : public SVGDisplayContainerFrame, virtual IntrinsicSize GetIntrinsicSize() override; AspectRatio GetIntrinsicRatio() const override; - SizeComputationResult ComputeSize(gfxContext* aRenderingContext, - WritingMode aWritingMode, - const LogicalSize& aCBSize, - nscoord aAvailableISize, - const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, - ComputeSizeFlags aFlags) override; + SizeComputationResult ComputeSize( + gfxContext* aRenderingContext, WritingMode aWritingMode, + const LogicalSize& aCBSize, nscoord aAvailableISize, + const LogicalSize& aMargin, const LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) override; virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput, diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 9a7b67be379d..a71c1786545c 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -1523,10 +1523,11 @@ nsTableFrame::IntrinsicISizeOffsets(nscoord aPercentageBasis) { nsIFrame::SizeComputationResult nsTableFrame::ComputeSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { - auto result = nsContainerFrame::ComputeSize(aRenderingContext, aWM, aCBSize, - aAvailableISize, aMargin, - aBorderPadding, aFlags); + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { + auto result = nsContainerFrame::ComputeSize( + aRenderingContext, aWM, aCBSize, aAvailableISize, aMargin, aBorderPadding, + aSizeOverrides, aFlags); // XXX The code below doesn't make sense if the caller's writing mode // is orthogonal to this frame's. Not sure yet what should happen then; @@ -1580,7 +1581,8 @@ nscoord nsTableFrame::TableShrinkISizeToFit(gfxContext* aRenderingContext, LogicalSize nsTableFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { // Tables always shrink-wrap. nscoord cbBased = aAvailableISize - aMargin.ISize(aWM) - aBorderPadding.ISize(aWM); diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h index ee2340342986..feef575de4d8 100644 --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -295,19 +295,20 @@ class nsTableFrame : public nsContainerFrame { IntrinsicSizeOffsetData IntrinsicISizeOffsets( nscoord aPercentageBasis = NS_UNCONSTRAINEDSIZE) override; - SizeComputationResult ComputeSize(gfxContext* aRenderingContext, - mozilla::WritingMode aWM, - const mozilla::LogicalSize& aCBSize, - nscoord aAvailableISize, - const mozilla::LogicalSize& aMargin, - const mozilla::LogicalSize& aBorderPadding, - mozilla::ComputeSizeFlags aFlags) override; - - virtual mozilla::LogicalSize ComputeAutoSize( + SizeComputationResult ComputeSize( gfxContext* aRenderingContext, mozilla::WritingMode aWM, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, + mozilla::ComputeSizeFlags aFlags) override; + + mozilla::LogicalSize ComputeAutoSize( + gfxContext* aRenderingContext, mozilla::WritingMode aWM, + const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, + const mozilla::LogicalSize& aMargin, + const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; /** diff --git a/layout/tables/nsTableWrapperFrame.cpp b/layout/tables/nsTableWrapperFrame.cpp index 32aca85a6c24..9ef6ae621d70 100644 --- a/layout/tables/nsTableWrapperFrame.cpp +++ b/layout/tables/nsTableWrapperFrame.cpp @@ -360,7 +360,7 @@ nscoord nsTableWrapperFrame::GetPrefISize(gfxContext* aRenderingContext) { nscoord nsTableWrapperFrame::ChildShrinkWrapISize( gfxContext* aRenderingContext, nsIFrame* aChildFrame, WritingMode aWM, LogicalSize aCBSize, nscoord aAvailableISize, - nscoord* aMarginResult) const { + const StyleSizeOverrides& aSizeOverrides, nscoord* aMarginResult) const { AutoMaybeDisableFontInflation an(aChildFrame); SizeComputationInput offsets(aChildFrame, aRenderingContext, aWM, @@ -384,7 +384,7 @@ nscoord nsTableWrapperFrame::ChildShrinkWrapISize( auto size = aChildFrame->ComputeSize(aRenderingContext, aWM, aCBSize, aAvailableISize, - marginSize, bpSize, flags); + marginSize, bpSize, aSizeOverrides, flags); if (aMarginResult) { *aMarginResult = offsets.ComputedLogicalMargin(aWM).IStartEnd(aWM); } @@ -396,7 +396,8 @@ nscoord nsTableWrapperFrame::ChildShrinkWrapISize( LogicalSize nsTableWrapperFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { nscoord kidAvailableISize = aAvailableISize - aMargin.ISize(aWM); NS_ASSERTION(aBorderPadding.IsAllZero(), "Table wrapper frames cannot have borders or paddings"); @@ -410,24 +411,27 @@ LogicalSize nsTableWrapperFrame::ComputeAutoSize( uint8_t captionSide = GetCaptionSide(); nscoord inlineSize; if (captionSide == NO_SIDE) { - inlineSize = ChildShrinkWrapISize(aRenderingContext, InnerTableFrame(), aWM, - aCBSize, kidAvailableISize); + inlineSize = + ChildShrinkWrapISize(aRenderingContext, InnerTableFrame(), aWM, aCBSize, + kidAvailableISize, aSizeOverrides); } else if (captionSide == NS_STYLE_CAPTION_SIDE_LEFT || captionSide == NS_STYLE_CAPTION_SIDE_RIGHT) { nscoord capISize = ChildShrinkWrapISize(aRenderingContext, mCaptionFrames.FirstChild(), - aWM, aCBSize, kidAvailableISize); - inlineSize = capISize + - ChildShrinkWrapISize(aRenderingContext, InnerTableFrame(), aWM, - aCBSize, kidAvailableISize - capISize); + aWM, aCBSize, kidAvailableISize, aSizeOverrides); + inlineSize = + capISize + + ChildShrinkWrapISize(aRenderingContext, InnerTableFrame(), aWM, aCBSize, + kidAvailableISize - capISize, aSizeOverrides); } else if (captionSide == NS_STYLE_CAPTION_SIDE_TOP || captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM) { nscoord margin; - inlineSize = ChildShrinkWrapISize(aRenderingContext, InnerTableFrame(), aWM, - aCBSize, kidAvailableISize, &margin); + inlineSize = + ChildShrinkWrapISize(aRenderingContext, InnerTableFrame(), aWM, aCBSize, + kidAvailableISize, aSizeOverrides, &margin); nscoord capISize = ChildShrinkWrapISize(aRenderingContext, mCaptionFrames.FirstChild(), - aWM, aCBSize, inlineSize - margin); + aWM, aCBSize, inlineSize - margin, aSizeOverrides); if (capISize > inlineSize) { inlineSize = capISize; } @@ -435,11 +439,12 @@ LogicalSize nsTableWrapperFrame::ComputeAutoSize( NS_ASSERTION(captionSide == NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE || captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE, "unexpected caption-side"); - inlineSize = ChildShrinkWrapISize(aRenderingContext, InnerTableFrame(), aWM, - aCBSize, kidAvailableISize); + inlineSize = + ChildShrinkWrapISize(aRenderingContext, InnerTableFrame(), aWM, aCBSize, + kidAvailableISize, aSizeOverrides); nscoord capISize = ChildShrinkWrapISize(aRenderingContext, mCaptionFrames.FirstChild(), - aWM, aCBSize, kidAvailableISize); + aWM, aCBSize, kidAvailableISize, aSizeOverrides); if (capISize > inlineSize) { inlineSize = capISize; } diff --git a/layout/tables/nsTableWrapperFrame.h b/layout/tables/nsTableWrapperFrame.h index 1dc16df3bc2b..b8312619d5ce 100644 --- a/layout/tables/nsTableWrapperFrame.h +++ b/layout/tables/nsTableWrapperFrame.h @@ -92,11 +92,12 @@ class nsTableWrapperFrame : public nsContainerFrame { virtual nscoord GetMinISize(gfxContext* aRenderingContext) override; virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override; - virtual mozilla::LogicalSize ComputeAutoSize( + mozilla::LogicalSize ComputeAutoSize( gfxContext* aRenderingContext, mozilla::WritingMode aWM, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; /** process a reflow command for the table. @@ -266,11 +267,12 @@ class nsTableWrapperFrame : public nsContainerFrame { * If aMarginResult is non-null, fill it with the part of the * margin-isize that was contributed by the margin. */ - nscoord ChildShrinkWrapISize(gfxContext* aRenderingContext, - nsIFrame* aChildFrame, mozilla::WritingMode aWM, - mozilla::LogicalSize aCBSize, - nscoord aAvailableISize, - nscoord* aMarginResult = nullptr) const; + nscoord ChildShrinkWrapISize( + gfxContext* aRenderingContext, nsIFrame* aChildFrame, + mozilla::WritingMode aWM, mozilla::LogicalSize aCBSize, + nscoord aAvailableISize, + const mozilla::StyleSizeOverrides& aSizeOverrides, + nscoord* aMarginResult = nullptr) const; private: nsFrameList mCaptionFrames; diff --git a/layout/xul/nsLeafBoxFrame.cpp b/layout/xul/nsLeafBoxFrame.cpp index 3f1f78202c8d..7da06bbea107 100644 --- a/layout/xul/nsLeafBoxFrame.cpp +++ b/layout/xul/nsLeafBoxFrame.cpp @@ -116,11 +116,12 @@ nscoord nsLeafBoxFrame::GetIntrinsicISize() { LogicalSize nsLeafBoxFrame::ComputeAutoSize( gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize, nscoord aAvailableISize, const LogicalSize& aMargin, - const LogicalSize& aBorderPadding, ComputeSizeFlags aFlags) { + const LogicalSize& aBorderPadding, const StyleSizeOverrides& aSizeOverrides, + ComputeSizeFlags aFlags) { // Important: NOT calling our direct superclass here! return nsIFrame::ComputeAutoSize(aRenderingContext, aWM, aCBSize, aAvailableISize, aMargin, aBorderPadding, - aFlags); + aSizeOverrides, aFlags); } void nsLeafBoxFrame::Reflow(nsPresContext* aPresContext, diff --git a/layout/xul/nsLeafBoxFrame.h b/layout/xul/nsLeafBoxFrame.h index 20dbd737708c..cb69f2670090 100644 --- a/layout/xul/nsLeafBoxFrame.h +++ b/layout/xul/nsLeafBoxFrame.h @@ -44,11 +44,12 @@ class nsLeafBoxFrame : public nsLeafFrame { virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override; // Our auto size is that provided by nsFrame, not nsLeafFrame - virtual mozilla::LogicalSize ComputeAutoSize( + mozilla::LogicalSize ComputeAutoSize( gfxContext* aRenderingContext, mozilla::WritingMode aWM, const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorderPadding, + const mozilla::StyleSizeOverrides& aSizeOverrides, mozilla::ComputeSizeFlags aFlags) override; virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,