From 3cd117ed4f9aa33b49f52664cc1010ad476690b5 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Mon, 4 Jun 2018 16:22:10 +1000 Subject: [PATCH] Bug 1466448 - Part 2: Remove unused ReflowOutput::mFlags. r=mats --HG-- extra : rebase_source : 41f141ad1f9830c45a4a11cab825ea3d956051ea --- layout/forms/nsFieldSetFrame.cpp | 3 +-- layout/generic/ReflowOutput.cpp | 9 ++------- layout/generic/ReflowOutput.h | 19 ++++--------------- layout/generic/nsColumnSetFrame.cpp | 2 +- layout/generic/nsGfxScrollFrame.cpp | 2 +- layout/generic/nsHTMLCanvasFrame.cpp | 2 +- layout/mathml/nsMathMLContainerFrame.cpp | 3 +-- layout/mathml/nsMathMLTokenFrame.cpp | 3 +-- layout/mathml/nsMathMLmfencedFrame.cpp | 3 +-- layout/mathml/nsMathMLmrootFrame.cpp | 3 +-- layout/tables/nsTableCellFrame.cpp | 2 +- layout/tables/nsTableRowGroupFrame.cpp | 5 +---- 12 files changed, 16 insertions(+), 40 deletions(-) diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index 17d93d8e1ecf4..2e340ed82dfc3 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -490,8 +490,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext, std::max(0, aReflowInput.ComputedMaxBSize() - mLegendSpace); } - ReflowOutput kidDesiredSize(kidReflowInput, - aDesiredSize.mFlags); + ReflowOutput kidDesiredSize(kidReflowInput); // Reflow the frame NS_ASSERTION(kidReflowInput.ComputedPhysicalMargin() == nsMargin(0,0,0,0), "Margins on anonymous fieldset child not supported!"); diff --git a/layout/generic/ReflowOutput.cpp b/layout/generic/ReflowOutput.cpp index 1603c9576bf73..56c5251d77ed0 100644 --- a/layout/generic/ReflowOutput.cpp +++ b/layout/generic/ReflowOutput.cpp @@ -39,13 +39,8 @@ nsOverflowAreas::SetAllTo(const nsRect& aRect) namespace mozilla { -ReflowOutput::ReflowOutput(const ReflowInput& aReflowInput, - uint32_t aFlags) - : mISize(0) - , mBSize(0) - , mBlockStartAscent(ASK_FOR_BASELINE) - , mFlags(aFlags) - , mWritingMode(aReflowInput.GetWritingMode()) +ReflowOutput::ReflowOutput(const ReflowInput& aReflowInput) + : ReflowOutput(aReflowInput.GetWritingMode()) { } diff --git a/layout/generic/ReflowOutput.h b/layout/generic/ReflowOutput.h index fe869fc92076c..19f959eb2053e 100644 --- a/layout/generic/ReflowOutput.h +++ b/layout/generic/ReflowOutput.h @@ -200,21 +200,15 @@ namespace mozilla { */ class ReflowOutput { public: - // XXXldb Should |aFlags| generally be passed from parent to child? - // Some places do it, and some don't. |aFlags| should perhaps go away - // entirely. - // XXX width/height/ascent are OUT parameters and so they shouldn't - // have to be initialized, but there are some bad frame classes that - // aren't properly setting them when returning from Reflow()... - explicit ReflowOutput(mozilla::WritingMode aWritingMode, uint32_t aFlags = 0) + explicit ReflowOutput(mozilla::WritingMode aWritingMode) : mISize(0) , mBSize(0) , mBlockStartAscent(ASK_FOR_BASELINE) - , mFlags(aFlags) , mWritingMode(aWritingMode) - {} + { + } - explicit ReflowOutput(const ReflowInput& aState, uint32_t aFlags = 0); + explicit ReflowOutput(const ReflowInput& aReflowInput); // ISize and BSize are logical-coordinate dimensions: // ISize is the size in the writing mode's inline direction (which equates to @@ -328,11 +322,6 @@ class ReflowOutput { private: nscoord mISize, mBSize; // [OUT] desired width and height (border-box) nscoord mBlockStartAscent; // [OUT] baseline (in Block direction), or ASK_FOR_BASELINE - -public: - uint32_t mFlags; - -private: mozilla::WritingMode mWritingMode; }; diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index a76d74ed798f0..1ebbdc0c44ca4 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -747,7 +747,7 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize, kidReflowInput.mFlags.mNextInFlowUntouched = true; } - ReflowOutput kidDesiredSize(wm, aDesiredSize.mFlags); + ReflowOutput kidDesiredSize(wm); // XXX it would be cool to consult the float manager for the // previous block to figure out the region of floats from the diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index e48f538a1118b..f872d97629504 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -674,7 +674,7 @@ void nsHTMLScrollFrame::ReflowContents(ScrollReflowInput* aState, const ReflowOutput& aDesiredSize) { - ReflowOutput kidDesiredSize(aDesiredSize.GetWritingMode(), aDesiredSize.mFlags); + ReflowOutput kidDesiredSize(aDesiredSize.GetWritingMode()); ReflowScrolledFrame(aState, GuessHScrollbarNeeded(*aState), GuessVScrollbarNeeded(*aState), &kidDesiredSize, true); diff --git a/layout/generic/nsHTMLCanvasFrame.cpp b/layout/generic/nsHTMLCanvasFrame.cpp index bc3693d6452d0..47f0a8d696cc8 100644 --- a/layout/generic/nsHTMLCanvasFrame.cpp +++ b/layout/generic/nsHTMLCanvasFrame.cpp @@ -375,7 +375,7 @@ nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext, LogicalSize availSize = aReflowInput.ComputedSize(childWM); availSize.BSize(childWM) = NS_UNCONSTRAINEDSIZE; NS_ASSERTION(!childFrame->GetNextSibling(), "HTML canvas should have 1 kid"); - ReflowOutput childDesiredSize(aReflowInput.GetWritingMode(), aMetrics.mFlags); + ReflowOutput childDesiredSize(aReflowInput.GetWritingMode()); ReflowInput childReflowInput(aPresContext, aReflowInput, childFrame, availSize); ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowInput, diff --git a/layout/mathml/nsMathMLContainerFrame.cpp b/layout/mathml/nsMathMLContainerFrame.cpp index b53ab3f830d75..3209220d703e4 100644 --- a/layout/mathml/nsMathMLContainerFrame.cpp +++ b/layout/mathml/nsMathMLContainerFrame.cpp @@ -882,8 +882,7 @@ nsMathMLContainerFrame::Reflow(nsPresContext* aPresContext, nsReflowStatus childStatus; nsIFrame* childFrame = mFrames.FirstChild(); while (childFrame) { - ReflowOutput childDesiredSize(aReflowInput, // ??? - aDesiredSize.mFlags); + ReflowOutput childDesiredSize(aReflowInput); WritingMode wm = childFrame->GetWritingMode(); LogicalSize availSize = aReflowInput.ComputedSize(wm); availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE; diff --git a/layout/mathml/nsMathMLTokenFrame.cpp b/layout/mathml/nsMathMLTokenFrame.cpp index 78703ab3f536d..93f23ea3c16c3 100644 --- a/layout/mathml/nsMathMLTokenFrame.cpp +++ b/layout/mathml/nsMathMLTokenFrame.cpp @@ -136,8 +136,7 @@ nsMathMLTokenFrame::Reflow(nsPresContext* aPresContext, for (nsIFrame* childFrame : PrincipalChildList()) { // ask our children to compute their bounding metrics - ReflowOutput childDesiredSize(aReflowInput.GetWritingMode(), - aDesiredSize.mFlags); + ReflowOutput childDesiredSize(aReflowInput.GetWritingMode()); WritingMode wm = childFrame->GetWritingMode(); LogicalSize availSize = aReflowInput.ComputedSize(wm); availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE; diff --git a/layout/mathml/nsMathMLmfencedFrame.cpp b/layout/mathml/nsMathMLmfencedFrame.cpp index 28c74851fc82f..c92b2243350ca 100644 --- a/layout/mathml/nsMathMLmfencedFrame.cpp +++ b/layout/mathml/nsMathMLmfencedFrame.cpp @@ -260,8 +260,7 @@ nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext, descent = fm->MaxDescent(); } while (childFrame) { - ReflowOutput childDesiredSize(aReflowInput, - aDesiredSize.mFlags); + ReflowOutput childDesiredSize(aReflowInput); WritingMode wm = childFrame->GetWritingMode(); LogicalSize availSize = aReflowInput.ComputedSize(wm); availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE; diff --git a/layout/mathml/nsMathMLmrootFrame.cpp b/layout/mathml/nsMathMLmrootFrame.cpp index eb1389644e2ac..51ea047d99c09 100644 --- a/layout/mathml/nsMathMLmrootFrame.cpp +++ b/layout/mathml/nsMathMLmrootFrame.cpp @@ -187,8 +187,7 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext, nsIFrame* childFrame = mFrames.FirstChild(); while (childFrame) { // ask our children to compute their bounding metrics - ReflowOutput childDesiredSize(aReflowInput, - aDesiredSize.mFlags); + ReflowOutput childDesiredSize(aReflowInput); WritingMode wm = childFrame->GetWritingMode(); LogicalSize availSize = aReflowInput.ComputedSize(wm); availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE; diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index fa1d163732ef5..d40ee54a341a0 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -877,7 +877,7 @@ nsTableCellFrame::Reflow(nsPresContext* aPresContext, availSize.BSize(wm) = 1; } - ReflowOutput kidSize(wm, aDesiredSize.mFlags); + ReflowOutput kidSize(wm); kidSize.ClearSize(); SetPriorAvailISize(aReflowInput.AvailableISize()); nsIFrame* firstKid = mFrames.FirstChild(); diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index b400f25aceb76..9b7200448d219 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -391,10 +391,7 @@ nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext, LogicalRect oldKidRect = kidFrame->GetLogicalRect(wm, containerSize); nsRect oldKidVisualOverflow = kidFrame->GetVisualOverflowRect(); - // XXXldb We used to only pass aDesiredSize.mFlags through for the - // incremental reflow codepath. - ReflowOutput desiredSize(aReflowInput.reflowInput, - aDesiredSize.mFlags); + ReflowOutput desiredSize(aReflowInput.reflowInput); desiredSize.ClearSize(); // Reflow the child into the available space, giving it as much bsize as