From e6769617e9cfae18159f260e65e710c56936b684 Mon Sep 17 00:00:00 2001 From: Ting-Yu Lin Date: Tue, 14 Feb 2017 17:55:48 +0800 Subject: [PATCH] Bug 775624 Part 22 - Remove NS_FRAME_COMPLETE. r=dholbert This patch is written by the following script with some manual adjustment to the comment in nsRubyTextContainerFrame.cpp and nsRubyFrame.cpp, and nsColumnSetFrame's constructor. function rename() { find layout\ -type f\ \( -name "*.cpp" -or\ -name "*.h" \)\ -exec sed -i -r "s/$1/$2/g" "{}" \; } rename "nsReflowStatus *([a-zA-Z0-9]*) = NS_FRAME_COMPLETE" "nsReflowStatus \1" rename "([a-zA-Z0-9.*]*) *= NS_FRAME_COMPLETE;" "\1.Reset();" rename "([a-zA-Z0-9.*]*) == NS_FRAME_COMPLETE" "\1.IsEmpty()" MozReview-Commit-ID: 9tqQAHvdQex --- layout/base/PresShell.cpp | 2 +- layout/forms/nsComboboxControlFrame.cpp | 4 ++-- layout/forms/nsDateTimeControlFrame.cpp | 2 +- layout/forms/nsFieldSetFrame.cpp | 4 ++-- layout/forms/nsFormControlFrame.cpp | 2 +- layout/forms/nsHTMLButtonControlFrame.cpp | 4 ++-- layout/forms/nsMeterFrame.cpp | 2 +- layout/forms/nsNumberControlFrame.cpp | 2 +- layout/forms/nsProgressFrame.cpp | 2 +- layout/forms/nsRangeFrame.cpp | 2 +- layout/forms/nsTextControlFrame.cpp | 2 +- layout/generic/BRFrame.cpp | 2 +- layout/generic/BlockReflowInput.cpp | 2 +- layout/generic/ViewportFrame.cpp | 2 +- layout/generic/nsAbsoluteContainingBlock.cpp | 4 ++-- layout/generic/nsBackdropFrame.cpp | 2 +- layout/generic/nsBlockFrame.cpp | 12 ++++++------ layout/generic/nsBulletFrame.cpp | 2 +- layout/generic/nsCanvasFrame.cpp | 2 +- layout/generic/nsColumnSetFrame.cpp | 10 +++++----- layout/generic/nsFlexContainerFrame.cpp | 2 +- layout/generic/nsFrame.cpp | 6 +++--- layout/generic/nsFrameSetFrame.cpp | 8 ++++---- layout/generic/nsGfxScrollFrame.cpp | 2 +- layout/generic/nsGridContainerFrame.cpp | 10 +++++----- layout/generic/nsHTMLCanvasFrame.cpp | 2 +- layout/generic/nsIFrame.h | 13 +++++++++++-- layout/generic/nsImageFrame.cpp | 2 +- layout/generic/nsInlineFrame.cpp | 2 +- layout/generic/nsLeafFrame.cpp | 2 +- layout/generic/nsPageContentFrame.cpp | 4 ++-- layout/generic/nsPageFrame.cpp | 4 ++-- layout/generic/nsPlaceholderFrame.cpp | 2 +- layout/generic/nsPluginFrame.cpp | 6 +++--- layout/generic/nsRubyBaseContainerFrame.cpp | 10 +++++----- layout/generic/nsRubyFrame.cpp | 10 +++++----- layout/generic/nsRubyTextContainerFrame.cpp | 4 ++-- layout/generic/nsSimplePageSequenceFrame.cpp | 2 +- layout/generic/nsSubDocumentFrame.cpp | 2 +- layout/generic/nsTextFrame.cpp | 6 +++--- layout/generic/nsVideoFrame.cpp | 2 +- layout/mathml/nsMathMLContainerFrame.cpp | 2 +- layout/mathml/nsMathMLSelectedFrame.cpp | 2 +- layout/mathml/nsMathMLTokenFrame.cpp | 2 +- layout/mathml/nsMathMLmfencedFrame.cpp | 2 +- layout/mathml/nsMathMLmrootFrame.cpp | 4 ++-- layout/mathml/nsMathMLmspaceFrame.cpp | 2 +- layout/svg/nsSVGForeignObjectFrame.cpp | 2 +- layout/svg/nsSVGOuterSVGFrame.cpp | 2 +- layout/tables/nsTableCellFrame.cpp | 2 +- layout/tables/nsTableColFrame.cpp | 2 +- layout/tables/nsTableColGroupFrame.cpp | 2 +- layout/tables/nsTableFrame.cpp | 6 +++--- layout/tables/nsTableRowFrame.cpp | 2 +- layout/tables/nsTableRowGroupFrame.cpp | 8 ++++---- layout/tables/nsTableWrapperFrame.cpp | 2 +- layout/xul/nsBoxFrame.cpp | 4 ++-- layout/xul/nsLeafBoxFrame.cpp | 2 +- 58 files changed, 112 insertions(+), 103 deletions(-) diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index f95badaa36a3..acbfee206365 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -9217,7 +9217,7 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible) NS_ASSERTION(target == rootFrame || desiredSize.ScrollableOverflow().IsEqualEdges(boundsRelativeToTarget), "non-root reflow roots must not have scrollable overflow"); - NS_ASSERTION(status == NS_FRAME_COMPLETE, + NS_ASSERTION(status.IsEmpty(), "reflow roots should never split"); target->SetSize(boundsRelativeToTarget.Size()); diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 5708c24b42d0..dc90e8bf77b2 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -901,7 +901,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext, !aStatus.IsFullyComplete()) { // This frame didn't fit inside a fragmentation container. Splitting // a nsComboboxControlFrame makes no sense, so we override the status here. - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); } } @@ -1328,7 +1328,7 @@ nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext, } state.SetComputedISize(computedISize); nsBlockFrame::Reflow(aPresContext, aDesiredSize, state, aStatus); - aStatus = NS_FRAME_COMPLETE; // this type of frame can't be split + aStatus.Reset(); // this type of frame can't be split } void diff --git a/layout/forms/nsDateTimeControlFrame.cpp b/layout/forms/nsDateTimeControlFrame.cpp index 19ae8eccbaed..7611f536693c 100644 --- a/layout/forms/nsDateTimeControlFrame.cpp +++ b/layout/forms/nsDateTimeControlFrame.cpp @@ -293,7 +293,7 @@ nsDateTimeControlFrame::Reflow(nsPresContext* aPresContext, FinishAndStoreOverflow(&aDesiredSize); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, ("exit nsDateTimeControlFrame::Reflow: size=%d,%d", diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index 2279d3754d35..32f1cc38ac81 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -339,10 +339,10 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext, "Should have a precomputed inline-size!"); // Initialize OUT parameter - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); nsOverflowAreas ocBounds; - nsReflowStatus ocStatus = NS_FRAME_COMPLETE; + nsReflowStatus ocStatus; if (GetPrevInFlow()) { ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0, ocStatus); diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp index a31f2c541e19..8acecb40cbbe 100644 --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -131,7 +131,7 @@ nsFormControlFrame::Reflow(nsPresContext* aPresContext, RegUnRegAccessKey(static_cast(this), true); } - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); aDesiredSize.SetSize(aReflowInput.GetWritingMode(), aReflowInput.ComputedSizeWithBorderPadding()); diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index da7ef19ee60a..7f1eb85d37cb 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -214,13 +214,13 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext, // else, we ignore child overflow -- anything that overflows beyond our // own border-box will get clipped when painting. - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus); // We're always complete and we don't support overflow containers // so we shouldn't have a next-in-flow ever. - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); MOZ_ASSERT(!GetNextInFlow()); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); diff --git a/layout/forms/nsMeterFrame.cpp b/layout/forms/nsMeterFrame.cpp index 6ef362820f71..ff25cce4b84c 100644 --- a/layout/forms/nsMeterFrame.cpp +++ b/layout/forms/nsMeterFrame.cpp @@ -128,7 +128,7 @@ nsMeterFrame::Reflow(nsPresContext* aPresContext, ConsiderChildOverflow(aDesiredSize.mOverflowAreas, barFrame); FinishAndStoreOverflow(&aDesiredSize); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/forms/nsNumberControlFrame.cpp b/layout/forms/nsNumberControlFrame.cpp index 5cbc722ea8b4..90146771c409 100644 --- a/layout/forms/nsNumberControlFrame.cpp +++ b/layout/forms/nsNumberControlFrame.cpp @@ -242,7 +242,7 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext, FinishAndStoreOverflow(&aDesiredSize); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/forms/nsProgressFrame.cpp b/layout/forms/nsProgressFrame.cpp index 6d6db7a1fdb9..c931c705dc44 100644 --- a/layout/forms/nsProgressFrame.cpp +++ b/layout/forms/nsProgressFrame.cpp @@ -137,7 +137,7 @@ nsProgressFrame::Reflow(nsPresContext* aPresContext, FinishAndStoreOverflow(&aDesiredSize); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/forms/nsRangeFrame.cpp b/layout/forms/nsRangeFrame.cpp index 55418d3d8ba6..c6065c7f6c58 100644 --- a/layout/forms/nsRangeFrame.cpp +++ b/layout/forms/nsRangeFrame.cpp @@ -363,7 +363,7 @@ nsRangeFrame::Reflow(nsPresContext* aPresContext, FinishAndStoreOverflow(&aDesiredSize); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index 3cfbc1e4ace0..cee4bbc5cb08 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -541,7 +541,7 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext, // take into account css properties that affect overflow handling FinishAndStoreOverflow(&aDesiredSize); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/generic/BRFrame.cpp b/layout/generic/BRFrame.cpp index 04c85446d473..672c6f565f49 100644 --- a/layout/generic/BRFrame.cpp +++ b/layout/generic/BRFrame.cpp @@ -159,7 +159,7 @@ BRFrame::Reflow(nsPresContext* aPresContext, ll->SetLineEndsInBR(true); } else { - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); } aMetrics.SetSize(wm, finalSize); diff --git a/layout/generic/BlockReflowInput.cpp b/layout/generic/BlockReflowInput.cpp index e2336ff4c6a5..3d89b7535651 100644 --- a/layout/generic/BlockReflowInput.cpp +++ b/layout/generic/BlockReflowInput.cpp @@ -104,7 +104,7 @@ BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowInput, FloatManager()->GetTranslation(mFloatManagerI, mFloatManagerB); FloatManager()->PushState(&mFloatManagerStateBefore); // never popped - mReflowStatus = NS_FRAME_COMPLETE; + mReflowStatus.Reset(); mNextInFlow = static_cast(mBlock->GetNextInFlow()); diff --git a/layout/generic/ViewportFrame.cpp b/layout/generic/ViewportFrame.cpp index 74374b30e0e1..a8638621f96e 100644 --- a/layout/generic/ViewportFrame.cpp +++ b/layout/generic/ViewportFrame.cpp @@ -290,7 +290,7 @@ ViewportFrame::Reflow(nsPresContext* aPresContext, NS_FRAME_TRACE_REFLOW_IN("ViewportFrame::Reflow"); // Initialize OUT parameters - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); // Because |Reflow| sets ComputedBSize() on the child to our // ComputedBSize(). diff --git a/layout/generic/nsAbsoluteContainingBlock.cpp b/layout/generic/nsAbsoluteContainingBlock.cpp index b4761ff5fd57..1f893f89eedc 100644 --- a/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/layout/generic/nsAbsoluteContainingBlock.cpp @@ -119,7 +119,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame, AbsPosReflowFlags aFlags, nsOverflowAreas* aOverflowAreas) { - nsReflowStatus reflowStatus = NS_FRAME_COMPLETE; + nsReflowStatus reflowStatus; const bool reflowAll = aReflowInput.ShouldReflowAllKids(); const bool isGrid = !!(aFlags & AbsPosReflowFlags::eIsGridContainerCB); @@ -132,7 +132,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame, !!(aFlags & AbsPosReflowFlags::eCBHeightChanged)); if (kidNeedsReflow && !aPresContext->HasPendingInterrupt()) { // Reflow the frame - nsReflowStatus kidStatus = NS_FRAME_COMPLETE; + nsReflowStatus kidStatus; const nsRect& cb = isGrid ? nsGridContainerFrame::GridItemCB(kidFrame) : aContainingBlock; ReflowAbsoluteFrame(aDelegatingFrame, aPresContext, aReflowInput, cb, diff --git a/layout/generic/nsBackdropFrame.cpp b/layout/generic/nsBackdropFrame.cpp index 687c5b2e3666..0ddc7842edab 100644 --- a/layout/generic/nsBackdropFrame.cpp +++ b/layout/generic/nsBackdropFrame.cpp @@ -92,5 +92,5 @@ nsBackdropFrame::Reflow(nsPresContext* aPresContext, nscoord isize = aReflowInput.ComputedISize() + borderPadding.IStartEnd(wm); nscoord bsize = aReflowInput.ComputedBSize() + borderPadding.BStartEnd(wm); aDesiredSize.SetSize(wm, LogicalSize(wm, isize, bsize)); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); } diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index e308561914e5..f60466d2ed55 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -1195,7 +1195,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext, // Handle paginated overflow (see nsContainerFrame.h) nsOverflowAreas ocBounds; - nsReflowStatus ocStatus = NS_FRAME_COMPLETE; + nsReflowStatus ocStatus; if (GetPrevInFlow()) { ReflowOverflowContainerChildren(aPresContext, *reflowInput, ocBounds, 0, ocStatus); @@ -1209,7 +1209,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext, // Drain & handle pushed floats DrainPushedFloats(); nsOverflowAreas fcBounds; - nsReflowStatus fcStatus = NS_FRAME_COMPLETE; + nsReflowStatus fcStatus; ReflowPushedFloats(state, fcBounds, fcStatus); // If we're not dirty (which means we'll mark everything dirty later) @@ -3458,7 +3458,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState, aState.mReflowInput.mDiscoveredClearance; } - frameReflowStatus = NS_FRAME_COMPLETE; + frameReflowStatus.Reset(); brc.ReflowBlock(availSpace, applyBStartMargin, aState.mPrevBEndMargin, clearance, aState.IsAdjacentWithTop(), aLine.get(), *blockHtmlRI, frameReflowStatus, aState); @@ -6215,7 +6215,7 @@ nsBlockFrame::ReflowFloat(BlockReflowInput& aState, NS_PRECONDITION(aFloat->GetStateBits() & NS_FRAME_OUT_OF_FLOW, "aFloat must be an out-of-flow frame"); // Reflow the float. - aReflowStatus = NS_FRAME_COMPLETE; + aReflowStatus.Reset(); WritingMode wm = aState.mReflowInput.GetWritingMode(); #ifdef NOISY_FLOAT @@ -6282,7 +6282,7 @@ nsBlockFrame::ReflowFloat(BlockReflowInput& aState, (NS_UNCONSTRAINEDSIZE == aAdjustedAvailableSpace.BSize(wm))) { // An incomplete reflow status means we should split the float // if the height is constrained (bug 145305). - aReflowStatus = NS_FRAME_COMPLETE; + aReflowStatus.Reset(); } if (aReflowStatus.NextInFlowNeedsReflow()) { @@ -6294,7 +6294,7 @@ nsBlockFrame::ReflowFloat(BlockReflowInput& aState, // such frames simply means that there is more content to be // reflowed on the line. if (aReflowStatus.IsIncomplete()) - aReflowStatus = NS_FRAME_COMPLETE; + aReflowStatus.Reset(); } // Capture the margin and offsets information for the caller diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp index 65ecdde454c7..372d6a2ec33f 100644 --- a/layout/generic/nsBulletFrame.cpp +++ b/layout/generic/nsBulletFrame.cpp @@ -1063,7 +1063,7 @@ nsBulletFrame::Reflow(nsPresContext* aPresContext, // 397294). aMetrics.SetOverflowAreasToDesiredBounds(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics); } diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp index 8bb48d772e0a..0bee60dd302f 100644 --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -649,7 +649,7 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext, NS_FRAME_TRACE_REFLOW_IN("nsCanvasFrame::Reflow"); // Initialize OUT parameter - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); nsCanvasFrame* prevCanvasFrame = static_cast (GetPrevInFlow()); diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index 80c4aa12394c..7809f72605b1 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -32,8 +32,8 @@ NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrame NS_IMPL_FRAMEARENA_HELPERS(nsColumnSetFrame) nsColumnSetFrame::nsColumnSetFrame(nsStyleContext* aContext) - : nsContainerFrame(aContext), mLastBalanceBSize(NS_INTRINSICSIZE), - mLastFrameStatus(NS_FRAME_COMPLETE) + : nsContainerFrame(aContext) + , mLastBalanceBSize(NS_INTRINSICSIZE) { } @@ -1036,7 +1036,7 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext, DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus); // Initialize OUT parameter - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); // Our children depend on our block-size if we have a fixed block-size. if (aReflowInput.ComputedBSize() != NS_AUTOHEIGHT) { @@ -1057,7 +1057,7 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext, #endif nsOverflowAreas ocBounds; - nsReflowStatus ocStatus = NS_FRAME_COMPLETE; + nsReflowStatus ocStatus; if (GetPrevInFlow()) { ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0, ocStatus); @@ -1102,7 +1102,7 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext, aReflowInput.AvailableBSize() == NS_UNCONSTRAINEDSIZE) { // In this situation, we might be lying about our reflow status, because // our last kid (the one that got interrupted) was incomplete. Fix that. - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); } NS_ASSERTION(aStatus.IsFullyComplete() || diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 18ef5824a975..70b2ad7290c8 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -4329,7 +4329,7 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext, nsTArray& aStruts, const FlexboxAxisTracker& aAxisTracker) { - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); LinkedList lines; nsTArray placeholderKids; diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index a85fbdc6711c..fa97d7449a23 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -5724,7 +5724,7 @@ nsFrame::Reflow(nsPresContext* aPresContext, MarkInReflow(); DO_GLOBAL_REFLOW_COUNT("nsFrame"); aDesiredSize.ClearSize(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } @@ -9740,7 +9740,7 @@ nsFrame::DoXULLayout(nsBoxLayoutState& aState) AddStateBits(NS_FRAME_IN_REFLOW); // Set up a |reflowStatus| to pass into ReflowAbsoluteFrames // (just a dummy value; hopefully that's OK) - nsReflowStatus reflowStatus = NS_FRAME_COMPLETE; + nsReflowStatus reflowStatus; ReflowAbsoluteFrames(aState.PresContext(), desiredSize, reflowInput, reflowStatus); RemoveStateBits(NS_FRAME_IN_REFLOW); @@ -9777,7 +9777,7 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState, #endif nsBoxLayoutMetrics *metrics = BoxMetrics(); - nsReflowStatus status = NS_FRAME_COMPLETE; + nsReflowStatus status; WritingMode wm = aDesiredSize.GetWritingMode(); bool needsReflow = NS_SUBTREE_DIRTY(this); diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp index 9d5c513af8f3..a41633e857d4 100644 --- a/layout/generic/nsFrameSetFrame.cpp +++ b/layout/generic/nsFrameSetFrame.cpp @@ -849,7 +849,7 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext, // If the number of cols or rows has changed, the frame for the frameset // will be re-created. if (mNumRows != rows || mNumCols != cols) { - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); mDrag.UnSet(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); return; @@ -1084,7 +1084,7 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext, mChildBorderColors.reset(); } - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); mDrag.UnSet(); aDesiredSize.SetOverflowAreasToDesiredBounds(); @@ -1394,7 +1394,7 @@ nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext, SizeToAvailSize(aReflowInput, aDesiredSize); aDesiredSize.SetOverflowAreasToDesiredBounds(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); } class nsDisplayFramesetBorder : public nsDisplayItem { @@ -1609,7 +1609,7 @@ nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext, SizeToAvailSize(aReflowInput, aDesiredSize); aDesiredSize.SetOverflowAreasToDesiredBounds(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); } class nsDisplayFramesetBlank : public nsDisplayItem { diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 9ca009289a0f..6e676f7fbdac 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1106,7 +1106,7 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext, mHelper.UpdatePrevScrolledRect(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); mHelper.PostOverflowEvent(); } diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 70caa106ceeb..4f271b392e82 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -5321,7 +5321,7 @@ nsGridContainerFrame::ReflowInFragmentainer(GridReflowInput& aState, Fragmentainer& aFragmentainer, const nsSize& aContainerSize) { - MOZ_ASSERT(aStatus == NS_FRAME_COMPLETE); + MOZ_ASSERT(aStatus.IsEmpty()); MOZ_ASSERT(aState.mReflowInput); // Collect our grid items and sort them in row order. Collect placeholders @@ -5397,7 +5397,7 @@ nsGridContainerFrame::ReflowInFragmentainer(GridReflowInput& aState, endRow = itemStartRow; isForcedBreak = true; // reset any BREAK_AFTER we found on an earlier item - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); break; // we're done since the items are sorted in row order } } @@ -5674,7 +5674,7 @@ nsGridContainerFrame::ReflowRowsInFragmentainer( continue; } NS_ERROR("got BREAK_BEFORE at top-of-page"); - childStatus = NS_FRAME_COMPLETE; + childStatus.Reset(); } else { NS_ERROR("got BREAK_BEFORE again after growing the row?"); childStatus.SetIncomplete(); @@ -5824,9 +5824,9 @@ nsGridContainerFrame::ReflowChildren(GridReflowInput& aState, { MOZ_ASSERT(aState.mReflowInput); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); nsOverflowAreas ocBounds; - nsReflowStatus ocStatus = NS_FRAME_COMPLETE; + nsReflowStatus ocStatus; if (GetPrevInFlow()) { ReflowOverflowContainerChildren(PresContext(), *aState.mReflowInput, ocBounds, 0, ocStatus, diff --git a/layout/generic/nsHTMLCanvasFrame.cpp b/layout/generic/nsHTMLCanvasFrame.cpp index bad3a710f8de..e41a8195260d 100644 --- a/layout/generic/nsHTMLCanvasFrame.cpp +++ b/layout/generic/nsHTMLCanvasFrame.cpp @@ -257,7 +257,7 @@ nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext, NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow"); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); WritingMode wm = aReflowInput.GetWritingMode(); LogicalSize finalSize(wm, diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index eef7bef7ba3d..7c4914288b55 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -261,6 +261,17 @@ public: return !(*this == aRhs); } + // Return true if all flags are cleared. + bool IsEmpty() const { + return (!mIncomplete && + !mOverflowIncomplete && + !mNextInFlowNeedsReflow && + !mTruncated && + !mInlineBreak && + !mInlineBreakAfter && + !mFirstLetterComplete); + } + // mIncomplete bit flag means the frame does not map all its content, and // that the parent frame should create a continuing frame. If this bit // isn't set, it means the frame does map all its content. This bit is @@ -369,8 +380,6 @@ private: bool mFirstLetterComplete : 1; }; -#define NS_FRAME_COMPLETE 0 // Note: not a bit! - #define NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics) \ aStatus.UpdateTruncated(aReflowInput, aMetrics); diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index c1294c054c42..0d34bb33c420 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -959,7 +959,7 @@ nsImageFrame::Reflow(nsPresContext* aPresContext, NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow"); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); // see if we have a frozen size (i.e. a fixed width and height) if (HaveFixedSize(aReflowInput)) { diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index 155ebac70cc1..5dc9ebf0e2da 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -574,7 +574,7 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext, ReflowOutput& aMetrics, nsReflowStatus& aStatus) { - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); nsLineLayout* lineLayout = aReflowInput.mLineLayout; bool inFirstLine = aReflowInput.mLineLayout->GetInFirstLine(); diff --git a/layout/generic/nsLeafFrame.cpp b/layout/generic/nsLeafFrame.cpp index 634eee04b018..adebc60698ce 100644 --- a/layout/generic/nsLeafFrame.cpp +++ b/layout/generic/nsLeafFrame.cpp @@ -85,7 +85,7 @@ nsLeafFrame::DoReflow(nsPresContext* aPresContext, WritingMode wm = aReflowInput.GetWritingMode(); aMetrics.SetSize(wm, aReflowInput.ComputedSizeWithBorderPadding()); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, ("exit nsLeafFrame::DoReflow: size=%d,%d", diff --git a/layout/generic/nsPageContentFrame.cpp b/layout/generic/nsPageContentFrame.cpp index 1a9b17a42b50..7047e4a724c9 100644 --- a/layout/generic/nsPageContentFrame.cpp +++ b/layout/generic/nsPageContentFrame.cpp @@ -28,7 +28,7 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext, MarkInReflow(); DO_GLOBAL_REFLOW_COUNT("nsPageContentFrame"); DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus); - aStatus = NS_FRAME_COMPLETE; // initialize out parameter + aStatus.Reset(); // initialize out parameter if (GetPrevInFlow() && (GetStateBits() & NS_FRAME_FIRST_REFLOW)) { nsresult rv = aPresContext->PresShell()->FrameConstructor() @@ -93,7 +93,7 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext, } // Reflow our fixed frames - nsReflowStatus fixedStatus = NS_FRAME_COMPLETE; + nsReflowStatus fixedStatus; ReflowAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, fixedStatus); NS_ASSERTION(fixedStatus.IsComplete(), "fixed frames can be truncated, but not incomplete"); diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index a6f54531a2e4..c24b4d15ff5a 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -58,7 +58,7 @@ nsPageFrame::Reflow(nsPresContext* aPresContext, MarkInReflow(); DO_GLOBAL_REFLOW_COUNT("nsPageFrame"); DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus); - aStatus = NS_FRAME_COMPLETE; // initialize out parameter + aStatus.Reset(); // initialize out parameter NS_ASSERTION(mFrames.FirstChild() && nsGkAtoms::pageContentFrame == mFrames.FirstChild()->GetType(), @@ -731,7 +731,7 @@ nsPageBreakFrame::Reflow(nsPresContext* aPresContext, // Note: not using NS_FRAME_FIRST_REFLOW here, since it's not clear whether // DidReflow will always get called before the next Reflow() call. mHaveReflowed = true; - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); } nsIAtom* diff --git a/layout/generic/nsPlaceholderFrame.cpp b/layout/generic/nsPlaceholderFrame.cpp index d30e504e5920..d6c355db002d 100644 --- a/layout/generic/nsPlaceholderFrame.cpp +++ b/layout/generic/nsPlaceholderFrame.cpp @@ -147,7 +147,7 @@ nsPlaceholderFrame::Reflow(nsPresContext* aPresContext, DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus); aDesiredSize.ClearSize(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/generic/nsPluginFrame.cpp b/layout/generic/nsPluginFrame.cpp index 292522b1e071..e65bd06cf5e4 100644 --- a/layout/generic/nsPluginFrame.cpp +++ b/layout/generic/nsPluginFrame.cpp @@ -506,13 +506,13 @@ nsPluginFrame::Reflow(nsPresContext* aPresContext, // arrived. Otherwise there may be PARAMs or other stuff that the // plugin needs to see that haven't arrived yet. if (!GetContent()->IsDoneAddingChildren()) { - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); return; } // if we are printing or print previewing, bail for now if (aPresContext->Medium() == nsGkAtoms::print) { - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); return; } @@ -531,7 +531,7 @@ nsPluginFrame::Reflow(nsPresContext* aPresContext, aPresContext->PresShell()->PostReflowCallback(this); } - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics); } diff --git a/layout/generic/nsRubyBaseContainerFrame.cpp b/layout/generic/nsRubyBaseContainerFrame.cpp index 81f6e361c7a9..5b48e214f8c9 100644 --- a/layout/generic/nsRubyBaseContainerFrame.cpp +++ b/layout/generic/nsRubyBaseContainerFrame.cpp @@ -307,7 +307,7 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext, MarkInReflow(); DO_GLOBAL_REFLOW_COUNT("nsRubyBaseContainerFrame"); DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); if (!aReflowInput.mLineLayout) { NS_ASSERTION( @@ -470,8 +470,8 @@ nsRubyBaseContainerFrame::ReflowColumns(const RubyReflowInput& aReflowInput, const uint32_t rtcCount = aReflowInput.mTextContainers.Length(); nscoord icoord = lineLayout->GetCurrentICoord(); MOZ_ASSERT(icoord == 0, "border/padding of rbc should have been suppressed"); - nsReflowStatus reflowStatus = NS_FRAME_COMPLETE; - aStatus = NS_FRAME_COMPLETE; + nsReflowStatus reflowStatus; + aStatus.Reset(); uint32_t columnIndex = 0; RubyColumn column; @@ -487,14 +487,14 @@ nsRubyBaseContainerFrame::ReflowColumns(const RubyReflowInput& aReflowInput, break; } // We are not handling overflow here. - MOZ_ASSERT(reflowStatus == NS_FRAME_COMPLETE); + MOZ_ASSERT(reflowStatus.IsEmpty()); } bool isComplete = false; PullFrameState pullFrameState(this, aReflowInput.mTextContainers); while (!reflowStatus.IsInlineBreak()) { // We are not handling overflow here. - MOZ_ASSERT(reflowStatus == NS_FRAME_COMPLETE); + MOZ_ASSERT(reflowStatus.IsEmpty()); // Try pull some frames from next continuations. This call replaces // frames in |column| with the frame pulled in each level. diff --git a/layout/generic/nsRubyFrame.cpp b/layout/generic/nsRubyFrame.cpp index 43f5a635b55a..fb5bf26c1084 100644 --- a/layout/generic/nsRubyFrame.cpp +++ b/layout/generic/nsRubyFrame.cpp @@ -116,7 +116,7 @@ nsRubyFrame::Reflow(nsPresContext* aPresContext, if (!aReflowInput.mLineLayout) { NS_ASSERTION(aReflowInput.mLineLayout, "No line layout provided to RubyFrame reflow method."); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); return; } @@ -143,7 +143,7 @@ nsRubyFrame::Reflow(nsPresContext* aPresContext, aReflowInput.mLineLayout->BeginSpan(this, &aReflowInput, startEdge, availableISize, &mBaseline); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); for (RubySegmentEnumerator e(this); !e.AtEnd(); e.Next()) { ReflowSegment(aPresContext, aReflowInput, e.GetBaseContainer(), aStatus); @@ -155,7 +155,7 @@ nsRubyFrame::Reflow(nsPresContext* aPresContext, } ContinuationTraversingState pullState(this); - while (aStatus == NS_FRAME_COMPLETE) { + while (aStatus.IsEmpty()) { nsRubyBaseContainerFrame* baseContainer = PullOneSegment(aReflowInput.mLineLayout, pullState); if (!baseContainer) { @@ -305,10 +305,10 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext, textReflowInput.mLineLayout = aReflowInput.mLineLayout; textContainer->Reflow(aPresContext, textMetrics, textReflowInput, textReflowStatus); - // Ruby text containers always return NS_FRAME_COMPLETE even when + // Ruby text containers always return complete reflow status even when // they have continuations, because the breaking has already been // handled when reflowing the base containers. - NS_ASSERTION(textReflowStatus == NS_FRAME_COMPLETE, + NS_ASSERTION(textReflowStatus.IsEmpty(), "Ruby text container must not break itself inside"); // The metrics is initialized with reflow state of this ruby frame, // hence the writing-mode is tied to rubyWM instead of rtcWM. diff --git a/layout/generic/nsRubyTextContainerFrame.cpp b/layout/generic/nsRubyTextContainerFrame.cpp index e91f1151fa28..c9192ca7eb9d 100644 --- a/layout/generic/nsRubyTextContainerFrame.cpp +++ b/layout/generic/nsRubyTextContainerFrame.cpp @@ -130,10 +130,10 @@ nsRubyTextContainerFrame::Reflow(nsPresContext* aPresContext, DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus); // Although a ruby text container may have continuations, returning - // NS_FRAME_COMPLETE here is still safe, since its parent, ruby frame, + // complete reflow status is still safe, since its parent, ruby frame, // ignores the status, and continuations of the ruby base container // will take care of our continuations. - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); WritingMode lineWM = aReflowInput.mLineLayout->GetWritingMode(); nscoord minBCoord = nscoord_MAX; diff --git a/layout/generic/nsSimplePageSequenceFrame.cpp b/layout/generic/nsSimplePageSequenceFrame.cpp index 386716e5ee98..0c1ec36a0320 100644 --- a/layout/generic/nsSimplePageSequenceFrame.cpp +++ b/layout/generic/nsSimplePageSequenceFrame.cpp @@ -156,7 +156,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext, DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus); NS_FRAME_TRACE_REFLOW_IN("nsSimplePageSequenceFrame::Reflow"); - aStatus = NS_FRAME_COMPLETE; // we're always complete + aStatus.Reset(); // we're always complete // Don't do incremental reflow until we've taught tables how to do // it right in paginated mode. diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index 37da921080c8..d239f1bcb454 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -752,7 +752,7 @@ nsSubDocumentFrame::Reflow(nsPresContext* aPresContext, "Shouldn't have unconstrained stuff here " "thanks to ComputeAutoSize"); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_ASSERTION(mContent->GetPrimaryFrame() == this, "Shouldn't happen"); diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 6ce38190a823..62b2470e5441 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -8984,7 +8984,7 @@ nsTextFrame::Reflow(nsPresContext* aPresContext, // but not inside a cell. For now, just don't reflow. if (!aReflowInput.mLineLayout) { ClearMetrics(aMetrics); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); return; } @@ -9060,7 +9060,7 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth, // We don't need to reflow if there is no content. if (!maxContentLength) { ClearMetrics(aMetrics); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); return; } @@ -9217,7 +9217,7 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth, if (!mTextRun) { ClearMetrics(aMetrics); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); return; } diff --git a/layout/generic/nsVideoFrame.cpp b/layout/generic/nsVideoFrame.cpp index c1c7a578e2a0..6119ee73e0f5 100644 --- a/layout/generic/nsVideoFrame.cpp +++ b/layout/generic/nsVideoFrame.cpp @@ -296,7 +296,7 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext, NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow"); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); const WritingMode myWM = aReflowInput.GetWritingMode(); nscoord contentBoxBSize = aReflowInput.ComputedBSize(); diff --git a/layout/mathml/nsMathMLContainerFrame.cpp b/layout/mathml/nsMathMLContainerFrame.cpp index 7be06f0f37d0..0853f1b48e3f 100644 --- a/layout/mathml/nsMathMLContainerFrame.cpp +++ b/layout/mathml/nsMathMLContainerFrame.cpp @@ -950,7 +950,7 @@ nsMathMLContainerFrame::Reflow(nsPresContext* aPresContext, // Place children now by re-adjusting the origins to align the baselines FinalizeReflow(drawTarget, aDesiredSize); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/mathml/nsMathMLSelectedFrame.cpp b/layout/mathml/nsMathMLSelectedFrame.cpp index 2378d076320d..fba8092db6f9 100644 --- a/layout/mathml/nsMathMLSelectedFrame.cpp +++ b/layout/mathml/nsMathMLSelectedFrame.cpp @@ -140,7 +140,7 @@ nsMathMLSelectedFrame::Reflow(nsPresContext* aPresContext, { MarkInReflow(); mPresentationData.flags &= ~NS_MATHML_ERROR; - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); aDesiredSize.ClearSize(); aDesiredSize.SetBlockStartAscent(0); mBoundingMetrics = nsBoundingMetrics(); diff --git a/layout/mathml/nsMathMLTokenFrame.cpp b/layout/mathml/nsMathMLTokenFrame.cpp index 99857ea963e6..0ac72a936a3b 100644 --- a/layout/mathml/nsMathMLTokenFrame.cpp +++ b/layout/mathml/nsMathMLTokenFrame.cpp @@ -152,7 +152,7 @@ nsMathMLTokenFrame::Reflow(nsPresContext* aPresContext, // place and size children FinalizeReflow(aReflowInput.mRenderingContext->GetDrawTarget(), aDesiredSize); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/mathml/nsMathMLmfencedFrame.cpp b/layout/mathml/nsMathMLmfencedFrame.cpp index e0baa1fb36da..fe093281e129 100644 --- a/layout/mathml/nsMathMLmfencedFrame.cpp +++ b/layout/mathml/nsMathMLmfencedFrame.cpp @@ -446,7 +446,7 @@ nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext, // Set our overflow area GatherAndStoreOverflow(&aDesiredSize); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/mathml/nsMathMLmrootFrame.cpp b/layout/mathml/nsMathMLmrootFrame.cpp index 3d564e8fd8cb..fea24e00209f 100644 --- a/layout/mathml/nsMathMLmrootFrame.cpp +++ b/layout/mathml/nsMathMLmrootFrame.cpp @@ -216,7 +216,7 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext, // report an error, encourage people to get their markups in order ReportChildCountError(); ReflowError(drawTarget, aDesiredSize); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); // Call DidReflow() for the child frames we successfully did reflow. DidReflowChildren(mFrames.FirstChild(), childFrame); @@ -354,7 +354,7 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext, mReference.x = 0; mReference.y = aDesiredSize.BlockStartAscent(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/mathml/nsMathMLmspaceFrame.cpp b/layout/mathml/nsMathMLmspaceFrame.cpp index 54f2f325a7d2..05fcd9d1418a 100644 --- a/layout/mathml/nsMathMLmspaceFrame.cpp +++ b/layout/mathml/nsMathMLmspaceFrame.cpp @@ -115,7 +115,7 @@ nsMathMLmspaceFrame::Reflow(nsPresContext* aPresContext, // Also return our bounding metrics aDesiredSize.mBoundingMetrics = mBoundingMetrics; - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/svg/nsSVGForeignObjectFrame.cpp b/layout/svg/nsSVGForeignObjectFrame.cpp index afa5912d2ced..1fcf54a77711 100644 --- a/layout/svg/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/nsSVGForeignObjectFrame.cpp @@ -158,7 +158,7 @@ nsSVGForeignObjectFrame::Reflow(nsPresContext* aPresContext, aReflowInput.ComputedBSize()); aDesiredSize.SetSize(wm, finalSize); aDesiredSize.SetOverflowAreasToDesiredBounds(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); } void diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp index 46fd127f9c30..cd890bb764d7 100644 --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -369,7 +369,7 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext* aPresContext, NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow"); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); aDesiredSize.Width() = aReflowInput.ComputedWidth() + aReflowInput.ComputedPhysicalBorderPadding().LeftRight(); diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index 6a9cd02c9a4a..3a1a57ec1b26 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -876,7 +876,7 @@ nsTableCellFrame::Reflow(nsPresContext* aPresContext, // see if a special bsize reflow needs to occur due to having a pct height nsTableFrame::CheckRequestSpecialBSizeReflow(aReflowInput); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); WritingMode wm = aReflowInput.GetWritingMode(); LogicalSize availSize(wm, aReflowInput.AvailableISize(), aReflowInput.AvailableBSize()); diff --git a/layout/tables/nsTableColFrame.cpp b/layout/tables/nsTableColFrame.cpp index caef2158b94b..fd7d69708af7 100644 --- a/layout/tables/nsTableColFrame.cpp +++ b/layout/tables/nsTableColFrame.cpp @@ -118,7 +118,7 @@ nsTableColFrame::Reflow(nsPresContext* aPresContext, if (collapseCol) { GetTableFrame()->SetNeedToCollapse(true); } - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/tables/nsTableColGroupFrame.cpp b/layout/tables/nsTableColGroupFrame.cpp index ff8879a0b004..a0a2fbf88d81 100644 --- a/layout/tables/nsTableColGroupFrame.cpp +++ b/layout/tables/nsTableColGroupFrame.cpp @@ -379,7 +379,7 @@ nsTableColGroupFrame::Reflow(nsPresContext* aPresContext, } aDesiredSize.ClearSize(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 75ea3f361f70..0bf87da6c81d 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -1844,7 +1844,7 @@ nsTableFrame::Reflow(nsPresContext* aPresContext, bool isPaginated = aPresContext->IsPaginated(); WritingMode wm = aReflowInput.GetWritingMode(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); if (!GetPrevInFlow() && !mTableLayoutStrategy) { NS_ERROR("strategy should have been created in Init"); return; @@ -2047,7 +2047,7 @@ nsTableFrame::FixupPositionedTableParts(nsPresContext* aPresContext, ReflowInput reflowInput(aPresContext, positionedPart, aReflowInput.mRenderingContext, availSize, ReflowInput::DUMMY_PARENT_REFLOW_STATE); - nsReflowStatus reflowStatus = NS_FRAME_COMPLETE; + nsReflowStatus reflowStatus; // Reflow absolutely-positioned descendants of the positioned part. // FIXME: Unconditionally using NS_UNCONSTRAINEDSIZE for the bsize and @@ -3022,7 +3022,7 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput, nsIFrame*& aLastChildReflowed, nsOverflowAreas& aOverflowAreas) { - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); aLastChildReflowed = nullptr; nsIFrame* prevKidFrame = nullptr; diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index d3e02e6d7d0d..ff5cfaa546f8 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -803,7 +803,7 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext, nsTableFrame& aTableFrame, nsReflowStatus& aStatus) { - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); // XXXldb Should we be checking constrained bsize instead? const bool isPaginated = aPresContext->IsPaginated(); diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 4b502c25d9c5..9328e33d4d67 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -1256,7 +1256,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext, else { // We can't push children, so let our parent reflow us again with more space aDesiredSize.Height() = rowRect.YMost(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); break; } } @@ -1276,7 +1276,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext, else { // We can't push children, so let our parent reflow us again with more space aDesiredSize.Height() = rowRect.YMost(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); UndoContinuedRow(aPresContext, contRow); contRow = nullptr; } @@ -1313,7 +1313,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext, else { // Let our parent reflow us again with more space aDesiredSize.Height() = rowRect.YMost(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); UndoContinuedRow(aPresContext, contRow); contRow = nullptr; } @@ -1368,7 +1368,7 @@ nsTableRowGroupFrame::Reflow(nsPresContext* aPresContext, DO_GLOBAL_REFLOW_COUNT("nsTableRowGroupFrame"); DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); // Row geometry may be going to change so we need to invalidate any row cursor. ClearRowCursor(); diff --git a/layout/tables/nsTableWrapperFrame.cpp b/layout/tables/nsTableWrapperFrame.cpp index e44652a73309..aad66ce61259 100644 --- a/layout/tables/nsTableWrapperFrame.cpp +++ b/layout/tables/nsTableWrapperFrame.cpp @@ -855,7 +855,7 @@ nsTableWrapperFrame::Reflow(nsPresContext* aPresContext, // Initialize out parameters aDesiredSize.ClearSize(); - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); if (!HasAnyStateBits(NS_FRAME_FIRST_REFLOW)) { // Set up our kids. They're already present, on an overflow list, diff --git a/layout/xul/nsBoxFrame.cpp b/layout/xul/nsBoxFrame.cpp index 63ecb835c686..dd9e5dd3e640 100644 --- a/layout/xul/nsBoxFrame.cpp +++ b/layout/xul/nsBoxFrame.cpp @@ -658,7 +658,7 @@ nsBoxFrame::Reflow(nsPresContext* aPresContext, #endif - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); // create the layout state nsBoxLayoutState state(aPresContext, aReflowInput.mRenderingContext, @@ -944,7 +944,7 @@ nsBoxFrame::DoXULLayout(nsBoxLayoutState& aState) AddStateBits(NS_FRAME_IN_REFLOW); // Set up a |reflowStatus| to pass into ReflowAbsoluteFrames // (just a dummy value; hopefully that's OK) - nsReflowStatus reflowStatus = NS_FRAME_COMPLETE; + nsReflowStatus reflowStatus; ReflowAbsoluteFrames(aState.PresContext(), desiredSize, reflowInput, reflowStatus); RemoveStateBits(NS_FRAME_IN_REFLOW); diff --git a/layout/xul/nsLeafBoxFrame.cpp b/layout/xul/nsLeafBoxFrame.cpp index 6d1783c11c64..7e7939462dd3 100644 --- a/layout/xul/nsLeafBoxFrame.cpp +++ b/layout/xul/nsLeafBoxFrame.cpp @@ -235,7 +235,7 @@ nsLeafBoxFrame::Reflow(nsPresContext* aPresContext, #endif - aStatus = NS_FRAME_COMPLETE; + aStatus.Reset(); // create the layout state nsBoxLayoutState state(aPresContext, aReflowInput.mRenderingContext);