summaryrefslogtreecommitdiff
path: root/layout/generic
diff options
context:
space:
mode:
authorJob Bautista <jobbautista9@protonmail.com>2022-06-17 16:05:57 +0800
committerJob Bautista <jobbautista9@protonmail.com>2022-06-17 16:05:57 +0800
commitb3cacb2c3ac849f70a2746b252fe0874ffe41e33 (patch)
treec3c1d0fa9665c5050b958d1c3dc3b4c60abd970e /layout/generic
parent5652238ba898931d9705c9df37259284bb76619e (diff)
downloaduxp-b3cacb2c3ac849f70a2746b252fe0874ffe41e33.tar.gz
Issue #1916 - Part 1: Convert flags passed to ReflowChild, FinishReflowChild, etc into an enum class.
Backported from Mozilla bug 1571250.
Diffstat (limited to 'layout/generic')
-rw-r--r--layout/generic/nsBlockFrame.cpp11
-rw-r--r--layout/generic/nsBlockReflowContext.cpp3
-rw-r--r--layout/generic/nsCanvasFrame.cpp10
-rw-r--r--layout/generic/nsColumnSetFrame.cpp13
-rw-r--r--layout/generic/nsContainerFrame.cpp73
-rw-r--r--layout/generic/nsContainerFrame.h55
-rw-r--r--layout/generic/nsFlexContainerFrame.cpp26
-rw-r--r--layout/generic/nsFrame.cpp9
-rw-r--r--layout/generic/nsFrameSetFrame.cpp5
-rw-r--r--layout/generic/nsGfxScrollFrame.cpp24
-rw-r--r--layout/generic/nsGridContainerFrame.cpp14
-rw-r--r--layout/generic/nsHTMLCanvasFrame.cpp6
-rw-r--r--layout/generic/nsIFrame.h20
-rw-r--r--layout/generic/nsLineLayout.cpp4
-rw-r--r--layout/generic/nsPageContentFrame.cpp13
-rw-r--r--layout/generic/nsPageFrame.cpp10
-rw-r--r--layout/generic/nsRubyFrame.cpp3
-rw-r--r--layout/generic/nsSimplePageSequenceFrame.cpp6
-rw-r--r--layout/generic/nsVideoFrame.cpp26
-rw-r--r--layout/generic/nsViewportFrame.cpp7
20 files changed, 190 insertions, 148 deletions
diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp
index 152b3d06ad..7f19839a14 100644
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -1182,8 +1182,8 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
nsOverflowAreas ocBounds;
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
if (GetPrevInFlow()) {
- ReflowOverflowContainerChildren(aPresContext, *reflowInput, ocBounds, 0,
- ocStatus);
+ ReflowOverflowContainerChildren(aPresContext, *reflowInput, ocBounds,
+ ReflowChildFlags::Default, ocStatus);
}
// Now that we're done cleaning up our overflow container lists, we can
@@ -6297,10 +6297,9 @@ nsBlockFrame::ReflowFloat(BlockReflowInput& aState,
WritingMode metricsWM = metrics.GetWritingMode();
aFloat->SetSize(metricsWM, metrics.Size(metricsWM));
if (aFloat->HasView()) {
- nsContainerFrame::SyncFrameViewAfterReflow(aState.mPresContext, aFloat,
- aFloat->GetView(),
- metrics.VisualOverflow(),
- NS_FRAME_NO_MOVE_VIEW);
+ nsContainerFrame::SyncFrameViewAfterReflow(
+ aState.mPresContext, aFloat, aFloat->GetView(),
+ metrics.VisualOverflow(), ReflowChildFlags::NoMoveView);
}
// Pass floatRS so the frame hierarchy can be used (redoFloatRS has the same hierarchy)
aFloat->DidReflow(aState.mPresContext, &floatRS,
diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp
index 3be74c929a..494b893917 100644
--- a/layout/generic/nsBlockReflowContext.cpp
+++ b/layout/generic/nsBlockReflowContext.cpp
@@ -456,7 +456,8 @@ nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowInput,
// Now place the frame and complete the reflow process
nsContainerFrame::FinishReflowChild(mFrame, mPresContext, mMetrics,
&aReflowInput, frameWM, logPos,
- mContainerSize, 0);
+ mContainerSize,
+ nsIFrame::ReflowChildFlags::Default);
aOverflowAreas = mMetrics.mOverflowAreas + mFrame->GetPosition();
diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp
index 61efb57e25..b4e1f0319a 100644
--- a/layout/generic/nsCanvasFrame.cpp
+++ b/layout/generic/nsCanvasFrame.cpp
@@ -636,12 +636,12 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
kidReflowInput.ApplyRelativePositioning(&kidPt, containerSize);
// Reflow the frame
- ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput,
- kidWM, kidPt, containerSize, 0, aStatus);
+ ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput, kidWM,
+ kidPt, containerSize, ReflowChildFlags::Default, aStatus);
// Complete the reflow and position and size the child frame
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, &kidReflowInput,
- kidWM, kidPt, containerSize, 0);
+ kidWM, kidPt, containerSize, ReflowChildFlags::Default);
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
@@ -696,8 +696,8 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
if (prevCanvasFrame) {
ReflowOverflowContainerChildren(aPresContext, aReflowInput,
- aDesiredSize.mOverflowAreas, 0,
- aStatus);
+ aDesiredSize.mOverflowAreas,
+ ReflowChildFlags::Default, aStatus);
}
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus);
diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp
index 99733c549b..ad4211bd8c 100644
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -641,8 +641,8 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
kidReflowInput.ComputedLogicalMargin().IStart(wm),
childOrigin.B(wm) +
kidReflowInput.ComputedLogicalMargin().BStart(wm));
- ReflowChild(child, PresContext(), kidDesiredSize, kidReflowInput,
- wm, origin, containerSize, 0, aStatus);
+ ReflowChild(child, PresContext(), kidDesiredSize, kidReflowInput, wm,
+ origin, containerSize, ReflowChildFlags::Default, aStatus);
reflowNext = (aStatus & NS_FRAME_REFLOW_NEXTINFLOW) != 0;
@@ -656,8 +656,9 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
*aCarriedOutBEndMargin = kidDesiredSize.mCarriedOutBEndMargin;
- FinishReflowChild(child, PresContext(), kidDesiredSize,
- &kidReflowInput, wm, childOrigin, containerSize, 0);
+ FinishReflowChild(child, PresContext(), kidDesiredSize, &kidReflowInput,
+ wm, childOrigin, containerSize,
+ ReflowChildFlags::Default);
childContentBEnd = nsLayoutUtils::CalculateContentBEnd(wm, child);
if (childContentBEnd > aConfig.mColMaxBSize) {
@@ -1052,8 +1053,8 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
nsOverflowAreas ocBounds;
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
if (GetPrevInFlow()) {
- ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0,
- ocStatus);
+ ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds,
+ ReflowChildFlags::Default, ocStatus);
}
//------------ Handle Incremental Reflow -----------------
diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp
index dd20ccffee..21033152b3 100644
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -755,21 +755,21 @@ void nsContainerFrame::SetSizeConstraints(nsPresContext* aPresContext,
void
nsContainerFrame::SyncFrameViewAfterReflow(nsPresContext* aPresContext,
- nsIFrame* aFrame,
+ nsIFrame* aFrame,
nsView* aView,
- const nsRect& aVisualOverflowArea,
- uint32_t aFlags)
+ const nsRect& aVisualOverflowArea,
+ ReflowChildFlags aFlags)
{
if (!aView) {
return;
}
// Make sure the view is sized and positioned correctly
- if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
+ if (!(aFlags & ReflowChildFlags::NoMoveView)) {
PositionFrameView(aFrame);
}
- if (0 == (aFlags & NS_FRAME_NO_SIZE_VIEW)) {
+ if (!(aFlags & ReflowChildFlags::NoSizeView)) {
nsViewManager* vm = aView->GetViewManager();
vm->ResizeView(aView, aVisualOverflowArea, true);
@@ -781,7 +781,7 @@ nsContainerFrame::SyncFrameViewProperties(nsPresContext* aPresContext,
nsIFrame* aFrame,
nsStyleContext* aStyleContext,
nsView* aView,
- uint32_t aFlags)
+ ReflowChildFlags aFlags)
{
NS_ASSERTION(!aStyleContext || aFrame->StyleContext() == aStyleContext,
"Wrong style context for frame?");
@@ -797,7 +797,7 @@ nsContainerFrame::SyncFrameViewProperties(nsPresContext* aPresContext,
}
// Make sure visibility is correct. This only affects nsSubdocumentFrame.
- if (0 == (aFlags & NS_FRAME_NO_VISIBILITY) &&
+ if (!(aFlags & ReflowChildFlags::NoVisibility) &&
!aFrame->SupportsVisibilityHidden()) {
// See if the view should be hidden or visible
vm->SetViewVisibility(aView,
@@ -1032,7 +1032,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
const WritingMode& aWM,
const LogicalPoint& aPos,
const nsSize& aContainerSize,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker)
{
@@ -1043,11 +1043,12 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
}
// Position the child frame and its view if requested.
- if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
+ if (ReflowChildFlags::NoMoveFrame !=
+ (aFlags & ReflowChildFlags::NoMoveFrame)) {
aKidFrame->SetPosition(aWM, aPos, aContainerSize);
}
- if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
+ if (!(aFlags & ReflowChildFlags::NoMoveView)) {
PositionFrameView(aKidFrame);
PositionChildViews(aKidFrame);
}
@@ -1056,10 +1057,9 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
// If the child frame is complete, delete any next-in-flows,
- // but only if the NO_DELETE_NEXT_IN_FLOW flag isn't set.
- if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) &&
- NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
- !(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) {
+ // but only if the NoDeleteNextInFlowChild flag isn't set.
+ if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) && NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
+ !(aFlags & ReflowChildFlags::NoDeleteNextInFlowChild)) {
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
if (kidNextInFlow) {
// Remove all of the childs next-in-flows. Make sure that we ask
@@ -1080,18 +1080,19 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
const ReflowInput& aReflowInput,
nscoord aX,
nscoord aY,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker)
{
NS_PRECONDITION(aReflowInput.mFrame == aKidFrame, "bad reflow state");
// Position the child frame and its view if requested.
- if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
+ if (ReflowChildFlags::NoMoveFrame !=
+ (aFlags & ReflowChildFlags::NoMoveFrame)) {
aKidFrame->SetPosition(nsPoint(aX, aY));
}
- if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
+ if (!(aFlags & ReflowChildFlags::NoMoveView)) {
PositionFrameView(aKidFrame);
PositionChildViews(aKidFrame);
}
@@ -1100,9 +1101,9 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
// If the child frame is complete, delete any next-in-flows,
- // but only if the NO_DELETE_NEXT_IN_FLOW flag isn't set.
+ // but only if the NoDeleteNextInFlowChild flag isn't set.
if (NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
- !(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) {
+ !(aFlags & ReflowChildFlags::NoDeleteNextInFlowChild)) {
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
if (kidNextInFlow) {
// Remove all of the childs next-in-flows. Make sure that we ask
@@ -1161,11 +1162,11 @@ nsContainerFrame::PositionChildViews(nsIFrame* aFrame)
* - invoked the DidReflow() function
*
* Flags:
- * NS_FRAME_NO_MOVE_FRAME - don't move the frame. aX and aY are ignored in this
- * case. Also implies NS_FRAME_NO_MOVE_VIEW
- * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
- * don't want to automatically sync the frame and view
- * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
+ * ReflowChildFlags::NoMoveFrame - don't move the frame. aX and aY are ignored
+ * in this case. Also implies ReflowChildFlags::NoMoveView
+ * ReflowChildFlags::NoMoveView - don't position the frame's view. Set this if
+ * you don't want to automatically sync the frame and view
+ * ReflowChildFlags::NoSizeView - don't size the frame's view
*/
void
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
@@ -1175,7 +1176,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
const WritingMode& aWM,
const LogicalPoint& aPos,
const nsSize& aContainerSize,
- uint32_t aFlags)
+ nsIFrame::ReflowChildFlags aFlags)
{
if (aWM.IsVerticalRL() || (!aWM.IsVertical() && !aWM.IsBidiLTR())) {
NS_ASSERTION(aContainerSize.width != NS_UNCONSTRAINEDSIZE,
@@ -1184,10 +1185,11 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
nsPoint curOrigin = aKidFrame->GetPosition();
WritingMode outerWM = aDesiredSize.GetWritingMode();
- LogicalSize convertedSize = aDesiredSize.Size(outerWM).ConvertTo(aWM,
- outerWM);
+ LogicalSize convertedSize =
+ aDesiredSize.Size(outerWM).ConvertTo(aWM, outerWM);
- if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
+ if (ReflowChildFlags::NoMoveFrame !=
+ (aFlags & ReflowChildFlags::NoMoveFrame)) {
aKidFrame->SetRect(aWM, LogicalRect(aWM, aPos, convertedSize),
aContainerSize);
} else {
@@ -1203,7 +1205,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
}
nsPoint newOrigin = aKidFrame->GetPosition();
- if (!(aFlags & NS_FRAME_NO_MOVE_VIEW) && curOrigin != newOrigin) {
+ if (!(aFlags & ReflowChildFlags::NoMoveView) && curOrigin != newOrigin) {
if (!aKidFrame->HasView()) {
// If the frame has moved, then we need to make sure any child views are
// correctly positioned
@@ -1223,12 +1225,14 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
const ReflowInput* aReflowInput,
nscoord aX,
nscoord aY,
- uint32_t aFlags)
+ ReflowChildFlags aFlags)
{
nsPoint curOrigin = aKidFrame->GetPosition();
- if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
- aKidFrame->SetRect(nsRect(aX, aY, aDesiredSize.Width(), aDesiredSize.Height()));
+ if (ReflowChildFlags::NoMoveFrame !=
+ (aFlags & ReflowChildFlags::NoMoveFrame)) {
+ aKidFrame->SetRect(
+ nsRect(aX, aY, aDesiredSize.Width(), aDesiredSize.Height()));
} else {
aKidFrame->SetSize(nsSize(aDesiredSize.Width(), aDesiredSize.Height()));
}
@@ -1241,7 +1245,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
aDesiredSize.VisualOverflow(), aFlags);
}
- if (!(aFlags & NS_FRAME_NO_MOVE_VIEW) &&
+ if (!(aFlags & ReflowChildFlags::NoMoveView) &&
(curOrigin.x != aX || curOrigin.y != aY)) {
if (!aKidFrame->HasView()) {
// If the frame has moved, then we need to make sure any child views are
@@ -1253,11 +1257,12 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
aKidFrame->DidReflow(aPresContext, aReflowInput, nsDidReflowStatus::FINISHED);
}
+
void
nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPresContext,
const ReflowInput& aReflowInput,
nsOverflowAreas& aOverflowRects,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
ChildFrameMerger aMergeFunc)
{
diff --git a/layout/generic/nsContainerFrame.h b/layout/generic/nsContainerFrame.h
index e3cc54b0b0..030622e8ea 100644
--- a/layout/generic/nsContainerFrame.h
+++ b/layout/generic/nsContainerFrame.h
@@ -13,16 +13,6 @@
#include "nsFrameList.h"
#include "nsLayoutUtils.h"
-// Option flags for ReflowChild() and FinishReflowChild()
-// member functions
-#define NS_FRAME_NO_MOVE_VIEW 0x0001
-#define NS_FRAME_NO_MOVE_FRAME (0x0002 | NS_FRAME_NO_MOVE_VIEW)
-#define NS_FRAME_NO_SIZE_VIEW 0x0004
-#define NS_FRAME_NO_VISIBILITY 0x0008
-// Only applies to ReflowChild; if true, don't delete the next-in-flow, even
-// if the reflow is fully complete.
-#define NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD 0x0010
-
class nsOverflowContinuationTracker;
// Some macros for container classes to do sanity checking on
@@ -173,14 +163,14 @@ public:
// Set the view's size and position after its frame has been reflowed.
//
// Flags:
- // NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
+ // NoMoveView - don't position the frame's view. Set this if you
// don't want to automatically sync the frame and view
- // NS_FRAME_NO_SIZE_VIEW - don't size the view
- static void SyncFrameViewAfterReflow(nsPresContext* aPresContext,
- nsIFrame* aFrame,
- nsView* aView,
- const nsRect& aVisualOverflowArea,
- uint32_t aFlags = 0);
+ // NoSizeView - don't size the view
+ static void SyncFrameViewAfterReflow(nsPresContext* aPresContext,
+ nsIFrame* aFrame,
+ nsView* aView,
+ const nsRect& aVisualOverflowArea,
+ ReflowChildFlags aFlags = ReflowChildFlags::Default);
// Syncs properties to the top level view and window, like transparency and
// shadow.
@@ -205,7 +195,7 @@ public:
nsIFrame* aFrame,
nsStyleContext* aStyleContext,
nsView* aView,
- uint32_t aFlags = 0);
+ ReflowChildFlags aFlags = ReflowChildFlags::Default);
/**
* Converts the minimum and maximum sizes given in inner window app units to
@@ -222,7 +212,7 @@ public:
const nsSize& aMaxSize);
// Used by both nsInlineFrame and nsFirstLetterFrame.
- void DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext,
+ void DoInlineIntrinsicISize(nsRenderingContext* aRenderingContext,
InlineIntrinsicISizeData *aData,
nsLayoutUtils::IntrinsicISizeType aType);
@@ -248,10 +238,10 @@ public:
* @param aContainerSize size of the border-box of the containing frame
*
* Flags:
- * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
+ * NoMoveView - don't position the frame's view. Set this if you
* don't want to automatically sync the frame and view
- * NS_FRAME_NO_MOVE_FRAME - don't move the frame. aPos is ignored in this
- * case. Also implies NS_FRAME_NO_MOVE_VIEW
+ * NoMoveFrame - don't move the frame. aPos is ignored in this
+ * case. Also implies NoMoveView
*/
void ReflowChild(nsIFrame* aChildFrame,
nsPresContext* aPresContext,
@@ -260,7 +250,7 @@ public:
const mozilla::WritingMode& aWM,
const mozilla::LogicalPoint& aPos,
const nsSize& aContainerSize,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker = nullptr);
@@ -277,11 +267,11 @@ public:
* @param aContainerSize size of the border-box of the containing frame
*
* Flags:
- * NS_FRAME_NO_MOVE_FRAME - don't move the frame. aPos is ignored in this
- * case. Also implies NS_FRAME_NO_MOVE_VIEW
- * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
+ * NoMoveFrame - don't move the frame. aPos is ignored in this
+ * case. Also implies NoMoveView
+ * NoMoveView - don't position the frame's view. Set this if you
* don't want to automatically sync the frame and view
- * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
+ * NoSizeView - don't size the frame's view
*/
static void FinishReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext,
@@ -290,7 +280,8 @@ public:
const mozilla::WritingMode& aWM,
const mozilla::LogicalPoint& aPos,
const nsSize& aContainerSize,
- uint32_t aFlags);
+ ReflowChildFlags aFlags);
+
//XXX temporary: hold on to a copy of the old physical versions of
// ReflowChild and FinishReflowChild so that we can convert callers
@@ -301,7 +292,7 @@ public:
const ReflowInput& aReflowInput,
nscoord aX,
nscoord aY,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker = nullptr);
@@ -311,7 +302,8 @@ public:
const ReflowInput* aReflowInput,
nscoord aX,
nscoord aY,
- uint32_t aFlags);
+ ReflowChildFlags aFlags);
+
static void PositionChildViews(nsIFrame* aFrame);
@@ -391,11 +383,12 @@ public:
void ReflowOverflowContainerChildren(nsPresContext* aPresContext,
const ReflowInput& aReflowInput,
nsOverflowAreas& aOverflowRects,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
ChildFrameMerger aMergeFunc =
DefaultChildFrameMerge);
+
/**
* Move any frames on our overflow list to the end of our principal list.
* @return true if there were any overflow frames
diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp
index 4429111e46..18a0643f14 100644
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -1856,7 +1856,7 @@ nsFlexContainerFrame::MeasureAscentAndHeightForFlexItem(
ReflowOutput childDesiredSize(aChildReflowInput);
nsReflowStatus childReflowStatus;
- const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
+ const ReflowChildFlags flags = ReflowChildFlags::NoMoveFrame;
ReflowChild(aItem.Frame(), aPresContext,
childDesiredSize, aChildReflowInput,
0, 0, flags, childReflowStatus);
@@ -4856,7 +4856,8 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
ReflowChild(aItem.Frame(), aPresContext,
childDesiredSize, childReflowInput,
outerWM, aFramePos, aContainerSize,
- 0, childReflowStatus);
+ ReflowChildFlags::Default,
+ childReflowStatus);
// XXXdholbert Once we do pagination / splitting, we'll need to actually
// handle incomplete childReflowStatuses. But for now, we give our kids
@@ -4872,9 +4873,9 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
offsets, &aFramePos,
aContainerSize);
- FinishReflowChild(aItem.Frame(), aPresContext,
- childDesiredSize, &childReflowInput,
- outerWM, aFramePos, aContainerSize, 0);
+ FinishReflowChild(aItem.Frame(), aPresContext, childDesiredSize,
+ &childReflowInput, outerWM, aFramePos, aContainerSize,
+ ReflowChildFlags::Default);
aItem.SetAscent(childDesiredSize.BlockStartAscent());
}
@@ -4899,14 +4900,13 @@ nsFlexContainerFrame::ReflowPlaceholders(nsPresContext* aPresContext,
placeholder, availSize);
ReflowOutput childDesiredSize(childReflowInput);
nsReflowStatus childReflowStatus;
- ReflowChild(placeholder, aPresContext,
- childDesiredSize, childReflowInput,
- outerWM, aContentBoxOrigin, aContainerSize, 0,
- childReflowStatus);
-
- FinishReflowChild(placeholder, aPresContext,
- childDesiredSize, &childReflowInput,
- outerWM, aContentBoxOrigin, aContainerSize, 0);
+ ReflowChild(placeholder, aPresContext, childDesiredSize, childReflowInput,
+ outerWM, aContentBoxOrigin, aContainerSize,
+ ReflowChildFlags::Default, childReflowStatus);
+
+ FinishReflowChild(placeholder, aPresContext, childDesiredSize,
+ &childReflowInput, outerWM, aContentBoxOrigin,
+ aContainerSize, ReflowChildFlags::Default);
// Mark the placeholder frame to indicate that it's not actually at the
// element's static position, because we need to apply CSS Alignment after
diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp
index 7e819ddf3b..43ad970890 100644
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -6583,9 +6583,9 @@ nsIFrame::UpdateOverflow()
if (FinishAndStoreOverflow(overflowAreas, GetSize())) {
nsView* view = GetView();
if (view) {
- uint32_t flags = GetXULLayoutFlags();
+ ReflowChildFlags flags = GetXULLayoutFlags();
- if ((flags & NS_FRAME_NO_SIZE_VIEW) == 0) {
+ if (!(flags & ReflowChildFlags::NoSizeView)) {
// Make sure the frame's view is properly sized.
nsViewManager* vm = view->GetViewManager();
vm->ResizeView(view, overflowAreas.VisualOverflow(), true);
@@ -9820,9 +9820,10 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
- uint32_t layoutFlags = aState.LayoutFlags();
+ ReflowChildFlags layoutFlags = aState.LayoutFlags();
nsContainerFrame::FinishReflowChild(this, aPresContext, aDesiredSize,
- &reflowInput, aX, aY, layoutFlags | NS_FRAME_NO_MOVE_FRAME);
+ &reflowInput, aX, aY, layoutFlags |
+ ReflowChildFlags::NoMoveFrame);
// Save the ascent. (bug 103925)
if (IsXULCollapsed()) {
diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp
index 4315b9b8af..a3970b5a98 100644
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -699,13 +699,14 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
nsReflowStatus status;
ReflowChild(aChild, aPresContext, reflowOutput, reflowInput, aOffset.x,
- aOffset.y, 0, status);
+ aOffset.y, ReflowChildFlags::Default, status);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
// Place and size the child
reflowOutput.Width() = aSize.width;
reflowOutput.Height() = aSize.height;
- FinishReflowChild(aChild, aPresContext, reflowOutput, nullptr, aOffset.x, aOffset.y, 0);
+ FinishReflowChild(aChild, aPresContext, reflowOutput, nullptr, aOffset.x,
+ aOffset.y, ReflowChildFlags::Default);
}
static
diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp
index bbde1d7dc0..ff8500b92f 100644
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -571,11 +571,11 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
nsReflowStatus status;
// No need to pass a true container-size to ReflowChild or
// FinishReflowChild, because it's only used there when positioning
- // the frame (i.e. if NS_FRAME_NO_MOVE_FRAME isn't set)
+ // the frame (i.e. if ReflowChildFlags::NoMoveFrame isn't set)
const nsSize dummyContainerSize;
- ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics,
- kidReflowInput, wm, LogicalPoint(wm), dummyContainerSize,
- NS_FRAME_NO_MOVE_FRAME, status);
+ ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics, kidReflowInput,
+ wm, LogicalPoint(wm), dummyContainerSize,
+ ReflowChildFlags::NoMoveFrame, status);
mHelper.mHasHorizontalScrollbar = didHaveHorizontalScrollbar;
mHelper.mHasVerticalScrollbar = didHaveVerticalScrollbar;
@@ -588,7 +588,7 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
FinishReflowChild(mHelper.mScrolledFrame, presContext,
*aMetrics, &kidReflowInput, wm, LogicalPoint(wm),
dummyContainerSize,
- NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW);
+ ReflowChildFlags::NoMoveFrame | ReflowChildFlags::NoSizeView);
// XXX Some frames (e.g., nsPluginFrame, nsFrameFrame, nsTextFrame) don't bother
// setting their mOverflowArea. This is wrong because every frame should
@@ -801,7 +801,7 @@ nsHTMLScrollFrame::PlaceScrollArea(ScrollReflowInput& aState,
scrolledFrame,
scrolledFrame->GetView(),
scrolledArea,
- 0);
+ ReflowChildFlags::Default);
}
nscoord
@@ -1664,7 +1664,7 @@ nsXULScrollFrame::GetFrameName(nsAString& aResult) const
NS_IMETHODIMP
nsXULScrollFrame::DoXULLayout(nsBoxLayoutState& aState)
{
- uint32_t flags = aState.LayoutFlags();
+ ReflowChildFlags flags = aState.LayoutFlags();
nsresult rv = XULLayout(aState);
aState.SetLayoutFlags(flags);
@@ -4956,14 +4956,12 @@ nsXULScrollFrame::AddRemoveScrollbar(bool& aHasScrollbar, nscoord& aXY,
return false;
}
-void
-nsXULScrollFrame::LayoutScrollArea(nsBoxLayoutState& aState,
- const nsPoint& aScrollPosition)
-{
- uint32_t oldflags = aState.LayoutFlags();
+void nsXULScrollFrame::LayoutScrollArea(nsBoxLayoutState& aState,
+ const nsPoint& aScrollPosition) {
+ ReflowChildFlags oldflags = aState.LayoutFlags();
nsRect childRect = nsRect(mHelper.mScrollPort.TopLeft() - aScrollPosition,
mHelper.mScrollPort.Size());
- int32_t flags = NS_FRAME_NO_MOVE_VIEW;
+ ReflowChildFlags flags = ReflowChildFlags::NoMoveView;
nsSize minSize = mHelper.mScrolledFrame->GetXULMinSize(aState);
diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp
index 0a953d6fff..34113e4fa7 100644
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -3789,7 +3789,10 @@ MeasuringReflow(nsIFrame* aChild,
ReflowInput childRI(pc, *rs, aChild, aAvailableSize, &aCBSize, riFlags);
ReflowOutput childSize(childRI);
nsReflowStatus childStatus;
- const uint32_t flags = NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW;
+ const nsIFrame::ReflowChildFlags flags =
+ nsIFrame::ReflowChildFlags::NoMoveFrame |
+ nsIFrame::ReflowChildFlags::NoSizeView |
+ nsIFrame::ReflowChildFlags::NoDeleteNextInFlowChild;
parent->ReflowChild(aChild, pc, childSize, childRI, wm,
LogicalPoint(wm), nsSize(), flags, childStatus);
parent->FinishReflowChild(aChild, pc, childSize, &childRI, wm,
@@ -5341,7 +5344,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
ReflowOutput childSize(childRI);
const nsSize dummyContainerSize;
ReflowChild(aChild, pc, childSize, childRI, childWM, LogicalPoint(childWM),
- dummyContainerSize, 0, aStatus);
+ dummyContainerSize, ReflowChildFlags::Default, aStatus);
LogicalPoint childPos =
cb.Origin(wm).ConvertTo(childWM, wm,
aContainerSize - childSize.PhysicalSize());
@@ -5370,7 +5373,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
childRI.ApplyRelativePositioning(&childPos, aContainerSize);
FinishReflowChild(aChild, pc, childSize, &childRI, childWM, childPos,
- aContainerSize, 0);
+ aContainerSize, ReflowChildFlags::Default);
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, aChild);
}
@@ -5884,14 +5887,15 @@ nsGridContainerFrame::ReflowChildren(GridReflowInput& aState,
nsReflowStatus& aStatus)
{
MOZ_ASSERT(aState.mReflowInput);
+ MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
aStatus = NS_FRAME_COMPLETE;
nsOverflowAreas ocBounds;
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
if (GetPrevInFlow()) {
ReflowOverflowContainerChildren(PresContext(), *aState.mReflowInput,
- ocBounds, 0, ocStatus,
- MergeSortedFrameListsFor);
+ ocBounds, ReflowChildFlags::Default,
+ ocStatus, MergeSortedFrameListsFor);
}
WritingMode wm = aState.mReflowInput->GetWritingMode();
diff --git a/layout/generic/nsHTMLCanvasFrame.cpp b/layout/generic/nsHTMLCanvasFrame.cpp
index f40f799bab..8808907006 100644
--- a/layout/generic/nsHTMLCanvasFrame.cpp
+++ b/layout/generic/nsHTMLCanvasFrame.cpp
@@ -281,10 +281,10 @@ nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
ReflowOutput childDesiredSize(aReflowInput.GetWritingMode(), aMetrics.mFlags);
ReflowInput childReflowInput(aPresContext, aReflowInput, childFrame,
availSize);
- ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowInput,
- 0, 0, 0, childStatus, nullptr);
+ ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowInput, 0,
+ 0, ReflowChildFlags::Default, childStatus, nullptr);
FinishReflowChild(childFrame, aPresContext, childDesiredSize,
- &childReflowInput, 0, 0, 0);
+ &childReflowInput, 0, 0, ReflowChildFlags::Default);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("exit nsHTMLCanvasFrame::Reflow: size=%d,%d",
diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h
index bc5a5fe971..89557a1e35 100644
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -2239,6 +2239,19 @@ public:
const ReflowInput& aReflowInput,
nsReflowStatus& aStatus) = 0;
+ // Option flags for ReflowChild() and FinishReflowChild()
+ // member functions
+ enum class ReflowChildFlags : uint32_t {
+ Default = 0,
+ NoMoveView = 1 << 0,
+ NoMoveFrame = (1 << 1) | NoMoveView,
+ NoSizeView = 1 << 2,
+ NoVisibility = 1 << 3,
+ // Only applies to ReflowChild; if true, don't delete the next-in-flow, even
+ // if the reflow is fully complete.
+ NoDeleteNextInFlowChild = 1 << 4
+ };
+
/**
* Post-reflow hook. After a frame is reflowed this method will be called
* informing the frame that this reflow process is complete, and telling the
@@ -3213,8 +3226,9 @@ size_t SizeOfFramePropertiesForTree(mozilla::MallocSizeOf aMallocSizeOf) const;
virtual nsBoxLayout* GetXULLayoutManager() { return nullptr; }
nsresult GetXULClientRect(nsRect& aContentRect);
- virtual uint32_t GetXULLayoutFlags()
- { return 0; }
+ virtual ReflowChildFlags GetXULLayoutFlags() {
+ return ReflowChildFlags::Default;
+ }
// For nsSprocketLayout
virtual Valignment GetXULVAlign() const = 0;
@@ -3776,6 +3790,8 @@ public:
#endif
};
+MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(nsIFrame::ReflowChildFlags)
+
//----------------------------------------------------------------------
/**
diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp
index 60e4e8c964..8cac02d603 100644
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -3331,7 +3331,7 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflo
if (frame->HasView())
nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, frame,
frame->GetView(), pfd->mOverflowAreas.VisualOverflow(),
- NS_FRAME_NO_SIZE_VIEW);
+ nsIFrame::ReflowChildFlags::NoSizeView);
// Note: the combined area of a child is in its coordinate
// system. We adjust the childs combined area into our coordinate
@@ -3379,7 +3379,7 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflo
nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, frame,
frame->GetView(),
r.VisualOverflow(),
- NS_FRAME_NO_MOVE_VIEW);
+ nsIFrame::ReflowChildFlags::NoMoveView);
overflowAreas.UnionWith(r + frame->GetPosition());
}
diff --git a/layout/generic/nsPageContentFrame.cpp b/layout/generic/nsPageContentFrame.cpp
index 2c7348afca..cb558374db 100644
--- a/layout/generic/nsPageContentFrame.cpp
+++ b/layout/generic/nsPageContentFrame.cpp
@@ -58,12 +58,13 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
kidReflowInput.SetComputedBSize(logicalSize.BSize(wm));
// Reflow the page content area
- ReflowChild(frame, aPresContext, aDesiredSize, kidReflowInput, 0, 0, 0, aStatus);
+ ReflowChild(frame, aPresContext, aDesiredSize, kidReflowInput, 0, 0,
+ ReflowChildFlags::Default, aStatus);
// The document element's background should cover the entire canvas, so
// take into account the combined area and any space taken up by
// absolutely positioned elements
- nsMargin padding(0,0,0,0);
+ nsMargin padding(0, 0, 0, 0);
// XXXbz this screws up percentage padding (sets padding to zero
// in the percentage padding case)
@@ -87,10 +88,12 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
}
// Place and size the child
- FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, 0, 0, 0);
+ FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, 0, 0,
+ ReflowChildFlags::Default);
- NS_ASSERTION(aPresContext->IsDynamic() || !NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
- !frame->GetNextInFlow(), "bad child flow list");
+ NS_ASSERTION(aPresContext->IsDynamic() || !aStatus.IsFullyComplete() ||
+ !frame->GetNextInFlow(),
+ "bad child flow list");
}
// Reflow our fixed frames
diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp
index 31a686e83e..6120e35103 100644
--- a/layout/generic/nsPageFrame.cpp
+++ b/layout/generic/nsPageFrame.cpp
@@ -141,13 +141,15 @@ nsPageFrame::Reflow(nsPresContext* aPresContext,
nscoord yc = mPageContentMargin.top;
// Get the child's desired size
- ReflowChild(frame, aPresContext, aDesiredSize, kidReflowInput, xc, yc, 0, aStatus);
+ ReflowChild(frame, aPresContext, aDesiredSize, kidReflowInput, xc, yc,
+ ReflowChildFlags::Default, aStatus);
// Place and size the child
- FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, xc, yc, 0);
+ FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, xc,
+ yc, ReflowChildFlags::Default);
- NS_ASSERTION(!NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
- !frame->GetNextInFlow(), "bad child flow list");
+ NS_ASSERTION(!aStatus.IsFullyComplete() || !frame->GetNextInFlow(),
+ "bad child flow list");
}
PR_PL(("PageFrame::Reflow %p ", this));
PR_PL(("[%d,%d][%d,%d]\n", aDesiredSize.Width(), aDesiredSize.Height(),
diff --git a/layout/generic/nsRubyFrame.cpp b/layout/generic/nsRubyFrame.cpp
index 797b00fcf1..b6a3d0180d 100644
--- a/layout/generic/nsRubyFrame.cpp
+++ b/layout/generic/nsRubyFrame.cpp
@@ -345,7 +345,8 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
// correct. We will fix it in nsLineLayout after the whole line is
// reflowed.
FinishReflowChild(textContainer, aPresContext, textMetrics,
- &textReflowInput, lineWM, position, dummyContainerSize, 0);
+ &textReflowInput, lineWM, position, dummyContainerSize,
+ ReflowChildFlags::Default);
}
MOZ_ASSERT(baseRect.ISize(lineWM) == offsetRect.ISize(lineWM),
"Annotations should only be placed on the block directions");
diff --git a/layout/generic/nsSimplePageSequenceFrame.cpp b/layout/generic/nsSimplePageSequenceFrame.cpp
index d8ec898a6a..444512fba6 100644
--- a/layout/generic/nsSimplePageSequenceFrame.cpp
+++ b/layout/generic/nsSimplePageSequenceFrame.cpp
@@ -255,13 +255,15 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
nscoord x = pageCSSMargin.left;
// Place and size the page.
- ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, x, y, 0, status);
+ ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, x, y,
+ ReflowChildFlags::Default, status);
// If the page is narrower than our width, then center it horizontally:
x += ComputeCenteringMargin(aReflowInput.ComputedWidth(),
kidSize.Width(), pageCSSMargin);
- FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, x, y, 0);
+ FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, x, y,
+ ReflowChildFlags::Default);
y += kidSize.Height();
y += pageCSSMargin.bottom;
diff --git a/layout/generic/nsVideoFrame.cpp b/layout/generic/nsVideoFrame.cpp
index 0472ebe626..7986f672c1 100644
--- a/layout/generic/nsVideoFrame.cpp
+++ b/layout/generic/nsVideoFrame.cpp
@@ -308,6 +308,9 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
// Reflow the child frames. We may have up to two, an image frame
// which is the poster, and a box frame, which is the video controls.
for (nsIFrame* child : mFrames) {
+ nsSize oldChildSize = child->GetSize();
+ nsReflowStatus childStatus;
+
if (child->GetContent() == mPosterImage) {
// Reflow the poster frame.
nsImageFrame* imageFrame = static_cast<nsImageFrame*>(child);
@@ -332,10 +335,15 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
kidReflowInput.SetComputedWidth(posterRenderRect.width);
kidReflowInput.SetComputedHeight(posterRenderRect.height);
ReflowChild(imageFrame, aPresContext, kidDesiredSize, kidReflowInput,
- posterRenderRect.x, posterRenderRect.y, 0, aStatus);
- FinishReflowChild(imageFrame, aPresContext,
- kidDesiredSize, &kidReflowInput,
- posterRenderRect.x, posterRenderRect.y, 0);
+ posterRenderRect.x, posterRenderRect.y,
+ ReflowChildFlags::Default, childStatus);
+ MOZ_ASSERT(childStatus.IsFullyComplete(),
+ "We gave our child unconstrained available block-size, "
+ "so it should be complete!");
+
+ FinishReflowChild(imageFrame, aPresContext, kidDesiredSize,
+ &kidReflowInput, posterRenderRect.x, posterRenderRect.y,
+ ReflowChildFlags::Default);
} else if (child->GetContent() == mVideoControls) {
// Reflow the video controls frame.
nsBoxLayoutState boxState(PresContext(), aReflowInput.mRenderingContext);
@@ -370,10 +378,16 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
kidReflowInput.SetComputedHeight(std::max(size.height, 0));
ReflowChild(child, aPresContext, kidDesiredSize, kidReflowInput,
- mBorderPadding.left, mBorderPadding.top, 0, aStatus);
+ mBorderPadding.left, mBorderPadding.top,
+ ReflowChildFlags::Default, childStatus);
+ MOZ_ASSERT(childStatus.IsFullyComplete(),
+ "We gave our child unconstrained available block-size, "
+ "so it should be complete!");
+
FinishReflowChild(child, aPresContext,
kidDesiredSize, &kidReflowInput,
- mBorderPadding.left, mBorderPadding.top, 0);
+ mBorderPadding.left, mBorderPadding.top,
+ ReflowChildFlags::Default);
}
}
aMetrics.SetOverflowAreasToDesiredBounds();
diff --git a/layout/generic/nsViewportFrame.cpp b/layout/generic/nsViewportFrame.cpp
index a37d2a5a7c..ec933b84e3 100644
--- a/layout/generic/nsViewportFrame.cpp
+++ b/layout/generic/nsViewportFrame.cpp
@@ -315,11 +315,12 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
// Reflow the frame
kidReflowInput.SetComputedBSize(aReflowInput.ComputedBSize());
- ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput,
- 0, 0, 0, aStatus);
+ ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput, 0, 0,
+ ReflowChildFlags::Default, aStatus);
kidBSize = kidDesiredSize.BSize(wm);
- FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, nullptr, 0, 0, 0);
+ FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, nullptr, 0, 0,
+ ReflowChildFlags::Default);
} else {
kidBSize = LogicalSize(wm, mFrames.FirstChild()->GetSize()).BSize(wm);
}