mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1571250 - Convert flags passed to ReflowChild, FinishReflowChild, SyncFrameViewAfterReflow and from GetXULLayoutFlags / GetLayoutFlags into an enum class. r=TYLin
It seems better to convert this before adding a new flag (in bug 1547759) and risking replacing the wrong 0 with a flag. Differential Revision: https://phabricator.services.mozilla.com/D40562 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
85d61d1a95
commit
1488be9417
@ -438,10 +438,10 @@ void nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext,
|
||||
|
||||
// Allow the child to move/size/change-visibility its view if it's currently
|
||||
// dropped down
|
||||
int32_t flags = mDroppedDown
|
||||
? 0
|
||||
: NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_VISIBILITY |
|
||||
NS_FRAME_NO_SIZE_VIEW;
|
||||
ReflowChildFlags flags = mDroppedDown ? ReflowChildFlags::Default
|
||||
: ReflowChildFlags::NoMoveFrame |
|
||||
ReflowChildFlags::NoVisibility |
|
||||
ReflowChildFlags::NoSizeView;
|
||||
|
||||
// XXX Can this be different from the dropdown's writing mode?
|
||||
// That would be odd!
|
||||
|
@ -145,8 +145,8 @@ void nsDateTimeControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
// will be fixed later.
|
||||
const nsSize dummyContainerSize;
|
||||
ReflowChild(inputAreaFrame, aPresContext, childDesiredSize,
|
||||
childReflowOuput, myWM, childOffset, dummyContainerSize, 0,
|
||||
childStatus);
|
||||
childReflowOuput, myWM, childOffset, dummyContainerSize,
|
||||
ReflowChildFlags::Default, childStatus);
|
||||
MOZ_ASSERT(childStatus.IsFullyComplete(),
|
||||
"We gave our child unconstrained available block-size, "
|
||||
"so it should be complete");
|
||||
@ -183,7 +183,8 @@ void nsDateTimeControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
// Place the child
|
||||
FinishReflowChild(inputAreaFrame, aPresContext, childDesiredSize,
|
||||
&childReflowOuput, myWM, childOffset, borderBoxSize, 0);
|
||||
&childReflowOuput, myWM, childOffset, borderBoxSize,
|
||||
ReflowChildFlags::Default);
|
||||
|
||||
if (!aReflowInput.mStyleDisplay->IsContainLayout()) {
|
||||
nsSize contentBoxSize =
|
||||
|
@ -394,8 +394,8 @@ void nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsOverflowAreas ocBounds;
|
||||
nsReflowStatus ocStatus;
|
||||
if (GetPrevInFlow()) {
|
||||
ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0,
|
||||
ocStatus);
|
||||
ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds,
|
||||
ReflowChildFlags::Default, ocStatus);
|
||||
}
|
||||
|
||||
//------------ Handle Incremental Reflow -----------------
|
||||
@ -443,8 +443,8 @@ void nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
// and containerSize passed here are unimportant.
|
||||
const nsSize dummyContainerSize;
|
||||
ReflowChild(legend, aPresContext, legendDesiredSize, *legendReflowInput, wm,
|
||||
LogicalPoint(wm), dummyContainerSize, NS_FRAME_NO_MOVE_FRAME,
|
||||
aStatus);
|
||||
LogicalPoint(wm), dummyContainerSize,
|
||||
ReflowChildFlags::NoMoveFrame, aStatus);
|
||||
#ifdef NOISY_REFLOW
|
||||
printf(" returned (%d, %d)\n", legendDesiredSize.Width(),
|
||||
legendDesiredSize.Height());
|
||||
@ -483,7 +483,7 @@ void nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
FinishReflowChild(legend, aPresContext, legendDesiredSize,
|
||||
legendReflowInput.ptr(), wm, LogicalPoint(wm),
|
||||
dummyContainerSize, NS_FRAME_NO_MOVE_FRAME);
|
||||
dummyContainerSize, ReflowChildFlags::NoMoveFrame);
|
||||
} else if (!legend) {
|
||||
mLegendRect.SetEmpty();
|
||||
mLegendSpace = 0;
|
||||
@ -535,13 +535,13 @@ void nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
// if necessary.
|
||||
const nsSize dummyContainerSize;
|
||||
ReflowChild(inner, aPresContext, kidDesiredSize, kidReflowInput, wm, pt,
|
||||
dummyContainerSize, 0, aStatus);
|
||||
dummyContainerSize, ReflowChildFlags::Default, aStatus);
|
||||
|
||||
// Update containerSize to account for size of the inner frame, so that
|
||||
// FinishReflowChild can position it correctly.
|
||||
containerSize += kidDesiredSize.PhysicalSize();
|
||||
FinishReflowChild(inner, aPresContext, kidDesiredSize, &kidReflowInput, wm,
|
||||
pt, containerSize, 0);
|
||||
pt, containerSize, ReflowChildFlags::Default);
|
||||
NS_FRAME_TRACE_REFLOW_OUT("FieldSet::Reflow", aStatus);
|
||||
} else if (inner) {
|
||||
// |inner| didn't need to be reflowed but we do need to include its size
|
||||
|
@ -236,7 +236,8 @@ void nsHTMLButtonControlFrame::ReflowButtonContents(
|
||||
// repositioned later by FinishReflowChild.
|
||||
nsSize dummyContainerSize;
|
||||
ReflowChild(aFirstKid, aPresContext, contentsDesiredSize, contentsReflowInput,
|
||||
wm, childPos, dummyContainerSize, 0, contentsReflowStatus);
|
||||
wm, childPos, dummyContainerSize, ReflowChildFlags::Default,
|
||||
contentsReflowStatus);
|
||||
MOZ_ASSERT(contentsReflowStatus.IsComplete(),
|
||||
"We gave button-contents frame unconstrained available height, "
|
||||
"so it should be complete");
|
||||
@ -290,7 +291,8 @@ void nsHTMLButtonControlFrame::ReflowButtonContents(
|
||||
|
||||
// Place the child
|
||||
FinishReflowChild(aFirstKid, aPresContext, contentsDesiredSize,
|
||||
&contentsReflowInput, wm, childPos, containerSize, 0);
|
||||
&contentsReflowInput, wm, childPos, containerSize,
|
||||
ReflowChildFlags::Default);
|
||||
|
||||
// Make sure we have a useful 'ascent' value for the child
|
||||
if (contentsDesiredSize.BlockStartAscent() ==
|
||||
|
@ -161,9 +161,9 @@ void nsMeterFrame::ReflowBarFrame(nsIFrame* aBarFrame,
|
||||
|
||||
ReflowOutput barDesiredSize(reflowInput);
|
||||
ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowInput, xoffset,
|
||||
yoffset, 0, aStatus);
|
||||
yoffset, ReflowChildFlags::Default, aStatus);
|
||||
FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowInput,
|
||||
xoffset, yoffset, 0);
|
||||
xoffset, yoffset, ReflowChildFlags::Default);
|
||||
}
|
||||
|
||||
nsresult nsMeterFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
|
@ -172,8 +172,8 @@ void nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
// will be fixed later.
|
||||
const nsSize dummyContainerSize;
|
||||
ReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
||||
wrapperReflowInput, myWM, wrapperOffset, dummyContainerSize, 0,
|
||||
childStatus);
|
||||
wrapperReflowInput, myWM, wrapperOffset, dummyContainerSize,
|
||||
ReflowChildFlags::Default, childStatus);
|
||||
MOZ_ASSERT(childStatus.IsFullyComplete(),
|
||||
"We gave our child unconstrained available block-size, "
|
||||
"so it should be complete");
|
||||
@ -211,7 +211,7 @@ void nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
// Place the child
|
||||
FinishReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
||||
&wrapperReflowInput, myWM, wrapperOffset, borderBoxSize,
|
||||
0);
|
||||
ReflowChildFlags::Default);
|
||||
|
||||
if (!aReflowInput.mStyleDisplay->IsContainLayout()) {
|
||||
nsSize contentBoxSize =
|
||||
|
@ -178,9 +178,9 @@ void nsProgressFrame::ReflowChildFrame(nsIFrame* aChild,
|
||||
|
||||
ReflowOutput barDesiredSize(aReflowInput);
|
||||
ReflowChild(aChild, aPresContext, barDesiredSize, reflowInput, xoffset,
|
||||
yoffset, 0, aStatus);
|
||||
yoffset, ReflowChildFlags::Default, aStatus);
|
||||
FinishReflowChild(aChild, aPresContext, barDesiredSize, &reflowInput, xoffset,
|
||||
yoffset, 0);
|
||||
yoffset, ReflowChildFlags::Default);
|
||||
}
|
||||
|
||||
nsresult nsProgressFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
|
@ -379,12 +379,13 @@ void nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
||||
nsReflowStatus frameStatus;
|
||||
ReflowOutput trackDesiredSize(aReflowInput);
|
||||
ReflowChild(trackFrame, aPresContext, trackDesiredSize, trackReflowInput,
|
||||
trackX, trackY, 0, frameStatus);
|
||||
trackX, trackY, ReflowChildFlags::Default, frameStatus);
|
||||
MOZ_ASSERT(
|
||||
frameStatus.IsFullyComplete(),
|
||||
"We gave our child unconstrained height, so it should be complete");
|
||||
FinishReflowChild(trackFrame, aPresContext, trackDesiredSize,
|
||||
&trackReflowInput, trackX, trackY, 0);
|
||||
&trackReflowInput, trackX, trackY,
|
||||
ReflowChildFlags::Default);
|
||||
}
|
||||
|
||||
nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame();
|
||||
@ -402,12 +403,12 @@ void nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
||||
nsReflowStatus frameStatus;
|
||||
ReflowOutput thumbDesiredSize(aReflowInput);
|
||||
ReflowChild(thumbFrame, aPresContext, thumbDesiredSize, thumbReflowInput, 0,
|
||||
0, 0, frameStatus);
|
||||
0, ReflowChildFlags::Default, frameStatus);
|
||||
MOZ_ASSERT(
|
||||
frameStatus.IsFullyComplete(),
|
||||
"We gave our child unconstrained height, so it should be complete");
|
||||
FinishReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
|
||||
&thumbReflowInput, 0, 0, 0);
|
||||
&thumbReflowInput, 0, 0, ReflowChildFlags::Default);
|
||||
DoUpdateThumbPosition(thumbFrame,
|
||||
nsSize(aDesiredSize.Width(), aDesiredSize.Height()));
|
||||
}
|
||||
@ -428,12 +429,13 @@ void nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
||||
nsReflowStatus frameStatus;
|
||||
ReflowOutput progressDesiredSize(aReflowInput);
|
||||
ReflowChild(rangeProgressFrame, aPresContext, progressDesiredSize,
|
||||
progressReflowInput, 0, 0, 0, frameStatus);
|
||||
progressReflowInput, 0, 0, ReflowChildFlags::Default,
|
||||
frameStatus);
|
||||
MOZ_ASSERT(
|
||||
frameStatus.IsFullyComplete(),
|
||||
"We gave our child unconstrained height, so it should be complete");
|
||||
FinishReflowChild(rangeProgressFrame, aPresContext, progressDesiredSize,
|
||||
&progressReflowInput, 0, 0, 0);
|
||||
&progressReflowInput, 0, 0, ReflowChildFlags::Default);
|
||||
DoUpdateRangeProgressFrame(
|
||||
rangeProgressFrame,
|
||||
nsSize(aDesiredSize.Width(), aDesiredSize.Height()));
|
||||
|
@ -670,11 +670,11 @@ void nsTextControlFrame::ReflowTextControlChild(
|
||||
// reflow the child
|
||||
ReflowOutput desiredSize(aReflowInput);
|
||||
ReflowChild(aKid, aPresContext, desiredSize, kidReflowInput, xOffset, yOffset,
|
||||
0, aStatus);
|
||||
ReflowChildFlags::Default, aStatus);
|
||||
|
||||
// place the child
|
||||
FinishReflowChild(aKid, aPresContext, desiredSize, &kidReflowInput, xOffset,
|
||||
yOffset, 0);
|
||||
yOffset, ReflowChildFlags::Default);
|
||||
|
||||
// consider the overflow
|
||||
aParentDesiredSize.mOverflowAreas.UnionWith(desiredSize.mOverflowAreas);
|
||||
|
@ -307,11 +307,11 @@ void ViewportFrame::Reflow(nsPresContext* aPresContext,
|
||||
// Reflow the frame
|
||||
kidReflowInput.SetComputedBSize(aReflowInput.ComputedBSize());
|
||||
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput, 0, 0,
|
||||
0, aStatus);
|
||||
ReflowChildFlags::Default, aStatus);
|
||||
kidBSize = kidDesiredSize.BSize(wm);
|
||||
|
||||
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, nullptr, 0, 0,
|
||||
0);
|
||||
ReflowChildFlags::Default);
|
||||
} else {
|
||||
kidBSize = LogicalSize(wm, mFrames.FirstChild()->GetSize()).BSize(wm);
|
||||
}
|
||||
|
@ -1247,8 +1247,8 @@ void nsBlockFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
|
||||
nsOverflowAreas ocBounds;
|
||||
nsReflowStatus ocStatus;
|
||||
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
|
||||
@ -6465,7 +6465,7 @@ void nsBlockFrame::ReflowFloat(BlockReflowInput& aState,
|
||||
if (aFloat->HasView()) {
|
||||
nsContainerFrame::SyncFrameViewAfterReflow(
|
||||
aState.mPresContext, aFloat, aFloat->GetView(),
|
||||
metrics.VisualOverflow(), NS_FRAME_NO_MOVE_VIEW);
|
||||
metrics.VisualOverflow(), ReflowChildFlags::NoMoveView);
|
||||
}
|
||||
// Pass floatRS so the frame hierarchy can be used (redoFloatRS has the same
|
||||
// hierarchy)
|
||||
|
@ -442,9 +442,9 @@ bool nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowInput,
|
||||
aReflowInput.ApplyRelativePositioning(&logPos, mContainerSize);
|
||||
|
||||
// Now place the frame and complete the reflow process
|
||||
nsContainerFrame::FinishReflowChild(mFrame, mPresContext, mMetrics,
|
||||
&aReflowInput, frameWM, logPos,
|
||||
mContainerSize, 0);
|
||||
nsContainerFrame::FinishReflowChild(
|
||||
mFrame, mPresContext, mMetrics, &aReflowInput, frameWM, logPos,
|
||||
mContainerSize, nsIFrame::ReflowChildFlags::Default);
|
||||
|
||||
aOverflowAreas = mMetrics.mOverflowAreas + mFrame->GetPosition();
|
||||
|
||||
|
@ -729,11 +729,11 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
// Reflow the frame
|
||||
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput, kidWM,
|
||||
kidPt, containerSize, 0, aStatus);
|
||||
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 (!aStatus.IsFullyComplete()) {
|
||||
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
|
||||
@ -791,7 +791,8 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
if (prevCanvasFrame) {
|
||||
ReflowOverflowContainerChildren(aPresContext, aReflowInput,
|
||||
aDesiredSize.mOverflowAreas, 0, aStatus);
|
||||
aDesiredSize.mOverflowAreas,
|
||||
ReflowChildFlags::Default, aStatus);
|
||||
}
|
||||
|
||||
if (mPopupSetFrame) {
|
||||
@ -805,9 +806,10 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||
ReflowInput popupReflowInput(aPresContext, aReflowInput, mPopupSetFrame,
|
||||
availSize);
|
||||
ReflowChild(mPopupSetFrame, aPresContext, popupDesiredSize,
|
||||
popupReflowInput, 0, 0, NS_FRAME_NO_MOVE_FRAME, popupStatus);
|
||||
popupReflowInput, 0, 0, ReflowChildFlags::NoMoveFrame,
|
||||
popupStatus);
|
||||
FinishReflowChild(mPopupSetFrame, aPresContext, popupDesiredSize,
|
||||
&popupReflowInput, 0, 0, NS_FRAME_NO_MOVE_FRAME);
|
||||
&popupReflowInput, 0, 0, ReflowChildFlags::NoMoveFrame);
|
||||
}
|
||||
|
||||
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput,
|
||||
|
@ -763,7 +763,7 @@ nsColumnSetFrame::ColumnBalanceData nsColumnSetFrame::ReflowChildren(
|
||||
kidReflowInput.ComputedLogicalMargin().BStart(wm));
|
||||
aStatus.Reset();
|
||||
ReflowChild(child, PresContext(), kidDesiredSize, kidReflowInput, wm,
|
||||
origin, containerSize, 0, aStatus);
|
||||
origin, containerSize, ReflowChildFlags::Default, aStatus);
|
||||
|
||||
reflowNext = aStatus.NextInFlowNeedsReflow();
|
||||
|
||||
@ -793,7 +793,8 @@ nsColumnSetFrame::ColumnBalanceData nsColumnSetFrame::ReflowChildren(
|
||||
NS_FRAME_TRACE_REFLOW_OUT("Column::Reflow", aStatus);
|
||||
|
||||
FinishReflowChild(child, PresContext(), kidDesiredSize, &kidReflowInput,
|
||||
wm, childOrigin, containerSize, 0);
|
||||
wm, childOrigin, containerSize,
|
||||
ReflowChildFlags::Default);
|
||||
|
||||
childContentBEnd = nsLayoutUtils::CalculateContentBEnd(wm, child);
|
||||
if (childContentBEnd > aConfig.mColMaxBSize) {
|
||||
@ -1238,8 +1239,8 @@ void nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsOverflowAreas ocBounds;
|
||||
nsReflowStatus ocStatus;
|
||||
if (GetPrevInFlow()) {
|
||||
ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0,
|
||||
ocStatus);
|
||||
ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds,
|
||||
ReflowChildFlags::Default, ocStatus);
|
||||
}
|
||||
|
||||
//------------ Handle Incremental Reflow -----------------
|
||||
|
@ -676,17 +676,17 @@ void nsContainerFrame::SetSizeConstraints(nsPresContext* aPresContext,
|
||||
|
||||
void nsContainerFrame::SyncFrameViewAfterReflow(
|
||||
nsPresContext* aPresContext, 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);
|
||||
@ -884,8 +884,8 @@ void nsContainerFrame::ReflowChild(
|
||||
nsIFrame* aKidFrame, nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput,
|
||||
const WritingMode& aWM, const LogicalPoint& aPos,
|
||||
const nsSize& aContainerSize, uint32_t aFlags, nsReflowStatus& aStatus,
|
||||
nsOverflowContinuationTracker* aTracker) {
|
||||
const nsSize& aContainerSize, ReflowChildFlags aFlags,
|
||||
nsReflowStatus& aStatus, nsOverflowContinuationTracker* aTracker) {
|
||||
MOZ_ASSERT(aReflowInput.mFrame == aKidFrame, "bad reflow input");
|
||||
if (aWM.IsVerticalRL() || (!aWM.IsVertical() && !aWM.IsBidiLTR())) {
|
||||
NS_ASSERTION(aContainerSize.width != NS_UNCONSTRAINEDSIZE,
|
||||
@ -896,11 +896,12 @@ void nsContainerFrame::ReflowChild(
|
||||
"please reset the overflow areas before calling ReflowChild");
|
||||
|
||||
// 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);
|
||||
}
|
||||
@ -909,9 +910,9 @@ void nsContainerFrame::ReflowChild(
|
||||
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 (!aStatus.IsInlineBreakBefore() && aStatus.IsFullyComplete() &&
|
||||
!(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
|
||||
@ -929,17 +930,18 @@ void nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||
nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize,
|
||||
const ReflowInput& aReflowInput, nscoord aX,
|
||||
nscoord aY, uint32_t aFlags,
|
||||
nscoord aY, ReflowChildFlags aFlags,
|
||||
nsReflowStatus& aStatus,
|
||||
nsOverflowContinuationTracker* aTracker) {
|
||||
MOZ_ASSERT(aReflowInput.mFrame == aKidFrame, "bad reflow input");
|
||||
|
||||
// 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);
|
||||
}
|
||||
@ -948,9 +950,9 @@ void 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 (aStatus.IsFullyComplete() &&
|
||||
!(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
|
||||
@ -1006,11 +1008,11 @@ void 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
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -1024,7 +1026,7 @@ void nsContainerFrame::FinishReflowChild(
|
||||
nsIFrame* aKidFrame, nsPresContext* aPresContext,
|
||||
const ReflowOutput& aDesiredSize, const ReflowInput* aReflowInput,
|
||||
const WritingMode& aWM, const LogicalPoint& aPos,
|
||||
const nsSize& aContainerSize, uint32_t aFlags) {
|
||||
const nsSize& aContainerSize, nsIFrame::ReflowChildFlags aFlags) {
|
||||
if (aWM.IsVerticalRL() || (!aWM.IsVertical() && !aWM.IsBidiLTR())) {
|
||||
NS_ASSERTION(aContainerSize.width != NS_UNCONSTRAINEDSIZE,
|
||||
"FinishReflowChild with unconstrained container width!");
|
||||
@ -1035,7 +1037,8 @@ void nsContainerFrame::FinishReflowChild(
|
||||
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 {
|
||||
@ -1051,7 +1054,7 @@ void nsContainerFrame::FinishReflowChild(
|
||||
}
|
||||
|
||||
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
|
||||
@ -1072,10 +1075,11 @@ void nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||
const ReflowOutput& aDesiredSize,
|
||||
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)) {
|
||||
if (ReflowChildFlags::NoMoveFrame !=
|
||||
(aFlags & ReflowChildFlags::NoMoveFrame)) {
|
||||
aKidFrame->SetRect(
|
||||
nsRect(aX, aY, aDesiredSize.Width(), aDesiredSize.Height()));
|
||||
} else {
|
||||
@ -1090,7 +1094,7 @@ void 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
|
||||
@ -1104,8 +1108,8 @@ void nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||
|
||||
void nsContainerFrame::ReflowOverflowContainerChildren(
|
||||
nsPresContext* aPresContext, const ReflowInput& aReflowInput,
|
||||
nsOverflowAreas& aOverflowRects, uint32_t aFlags, nsReflowStatus& aStatus,
|
||||
ChildFrameMerger aMergeFunc) {
|
||||
nsOverflowAreas& aOverflowRects, ReflowChildFlags aFlags,
|
||||
nsReflowStatus& aStatus, ChildFrameMerger aMergeFunc) {
|
||||
MOZ_ASSERT(aPresContext, "null pointer");
|
||||
|
||||
nsFrameList* overflowContainers =
|
||||
|
@ -15,16 +15,6 @@
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsLineBox.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;
|
||||
|
||||
namespace mozilla {
|
||||
@ -171,13 +161,13 @@ class nsContainerFrame : public nsSplittableFrame {
|
||||
// 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.
|
||||
@ -227,16 +217,16 @@ class nsContainerFrame : public nsSplittableFrame {
|
||||
* @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,
|
||||
ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput,
|
||||
const mozilla::WritingMode& aWM,
|
||||
const mozilla::LogicalPoint& aPos,
|
||||
const nsSize& aContainerSize, uint32_t aFlags,
|
||||
const nsSize& aContainerSize, ReflowChildFlags aFlags,
|
||||
nsReflowStatus& aStatus,
|
||||
nsOverflowContinuationTracker* aTracker = nullptr);
|
||||
|
||||
@ -253,26 +243,24 @@ class nsContainerFrame : public nsSplittableFrame {
|
||||
* @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,
|
||||
const ReflowOutput& aDesiredSize,
|
||||
const ReflowInput* aReflowInput,
|
||||
const mozilla::WritingMode& aWM,
|
||||
const mozilla::LogicalPoint& aPos,
|
||||
const nsSize& aContainerSize, uint32_t aFlags);
|
||||
static void FinishReflowChild(
|
||||
nsIFrame* aKidFrame, nsPresContext* aPresContext,
|
||||
const ReflowOutput& aDesiredSize, const ReflowInput* aReflowInput,
|
||||
const mozilla::WritingMode& aWM, const mozilla::LogicalPoint& aPos,
|
||||
const nsSize& aContainerSize, ReflowChildFlags aFlags);
|
||||
|
||||
// XXX temporary: hold on to a copy of the old physical versions of
|
||||
// ReflowChild and FinishReflowChild so that we can convert callers
|
||||
// incrementally.
|
||||
void ReflowChild(nsIFrame* aKidFrame, nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput,
|
||||
nscoord aX, nscoord aY, uint32_t aFlags,
|
||||
nscoord aX, nscoord aY, ReflowChildFlags aFlags,
|
||||
nsReflowStatus& aStatus,
|
||||
nsOverflowContinuationTracker* aTracker = nullptr);
|
||||
|
||||
@ -280,7 +268,7 @@ class nsContainerFrame : public nsSplittableFrame {
|
||||
nsPresContext* aPresContext,
|
||||
const ReflowOutput& aDesiredSize,
|
||||
const ReflowInput* aReflowInput, nscoord aX,
|
||||
nscoord aY, uint32_t aFlags);
|
||||
nscoord aY, ReflowChildFlags aFlags);
|
||||
|
||||
static void PositionChildViews(nsIFrame* aFrame);
|
||||
|
||||
@ -358,7 +346,8 @@ class nsContainerFrame : public nsSplittableFrame {
|
||||
*/
|
||||
void ReflowOverflowContainerChildren(
|
||||
nsPresContext* aPresContext, const ReflowInput& aReflowInput,
|
||||
nsOverflowAreas& aOverflowRects, uint32_t aFlags, nsReflowStatus& aStatus,
|
||||
nsOverflowAreas& aOverflowRects, ReflowChildFlags aFlags,
|
||||
nsReflowStatus& aStatus,
|
||||
ChildFrameMerger aMergeFunc = DefaultChildFrameMerge);
|
||||
|
||||
/**
|
||||
|
@ -1802,7 +1802,7 @@ nsFlexContainerFrame::MeasureAscentAndBSizeForFlexItem(
|
||||
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);
|
||||
aItem.SetHadMeasuringReflow();
|
||||
@ -5199,7 +5199,8 @@ void nsFlexContainerFrame::ReflowFlexItem(
|
||||
ReflowOutput childDesiredSize(childReflowInput);
|
||||
nsReflowStatus childReflowStatus;
|
||||
ReflowChild(aItem.Frame(), aPresContext, childDesiredSize, childReflowInput,
|
||||
outerWM, aFramePos, aContainerSize, 0, childReflowStatus);
|
||||
outerWM, aFramePos, aContainerSize, ReflowChildFlags::Default,
|
||||
childReflowStatus);
|
||||
|
||||
// XXXdholbert Once we do pagination / splitting, we'll need to actually
|
||||
// handle incomplete childReflowStatuses. But for now, we give our kids
|
||||
@ -5215,7 +5216,8 @@ void nsFlexContainerFrame::ReflowFlexItem(
|
||||
&aFramePos, aContainerSize);
|
||||
|
||||
FinishReflowChild(aItem.Frame(), aPresContext, childDesiredSize,
|
||||
&childReflowInput, outerWM, aFramePos, aContainerSize, 0);
|
||||
&childReflowInput, outerWM, aFramePos, aContainerSize,
|
||||
ReflowChildFlags::Default);
|
||||
|
||||
aItem.SetAscent(childDesiredSize.BlockStartAscent());
|
||||
}
|
||||
@ -5240,12 +5242,12 @@ void nsFlexContainerFrame::ReflowPlaceholders(
|
||||
ReflowOutput childDesiredSize(childReflowInput);
|
||||
nsReflowStatus childReflowStatus;
|
||||
ReflowChild(placeholder, aPresContext, childDesiredSize, childReflowInput,
|
||||
outerWM, aContentBoxOrigin, aContainerSize, 0,
|
||||
childReflowStatus);
|
||||
outerWM, aContentBoxOrigin, aContainerSize,
|
||||
ReflowChildFlags::Default, childReflowStatus);
|
||||
|
||||
FinishReflowChild(placeholder, aPresContext, childDesiredSize,
|
||||
&childReflowInput, outerWM, aContentBoxOrigin,
|
||||
aContainerSize, 0);
|
||||
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
|
||||
|
@ -7506,9 +7506,9 @@ bool 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);
|
||||
@ -10456,10 +10456,10 @@ void nsFrame::BoxReflow(nsBoxLayoutState& aState, nsPresContext* aPresContext,
|
||||
|
||||
NS_ASSERTION(status.IsComplete(), "bad status");
|
||||
|
||||
uint32_t layoutFlags = aState.LayoutFlags();
|
||||
nsContainerFrame::FinishReflowChild(this, aPresContext, aDesiredSize,
|
||||
&reflowInput, aX, aY,
|
||||
layoutFlags | NS_FRAME_NO_MOVE_FRAME);
|
||||
ReflowChildFlags layoutFlags = aState.LayoutFlags();
|
||||
nsContainerFrame::FinishReflowChild(
|
||||
this, aPresContext, aDesiredSize, &reflowInput, aX, aY,
|
||||
layoutFlags | ReflowChildFlags::NoMoveFrame);
|
||||
|
||||
// Save the ascent. (bug 103925)
|
||||
if (IsXULCollapsed()) {
|
||||
|
@ -670,14 +670,14 @@ void nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
||||
nsReflowStatus status;
|
||||
|
||||
ReflowChild(aChild, aPresContext, reflowOutput, reflowInput, aOffset.x,
|
||||
aOffset.y, 0, status);
|
||||
aOffset.y, ReflowChildFlags::Default, status);
|
||||
NS_ASSERTION(status.IsComplete(), "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);
|
||||
aOffset.y, ReflowChildFlags::Default);
|
||||
}
|
||||
|
||||
static nsFrameborder GetFrameBorderHelper(nsGenericHTMLElement* aContent) {
|
||||
|
@ -623,11 +623,11 @@ void 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);
|
||||
wm, LogicalPoint(wm), dummyContainerSize,
|
||||
ReflowChildFlags::NoMoveFrame, status);
|
||||
|
||||
mHelper.mHasHorizontalScrollbar = didHaveHorizontalScrollbar;
|
||||
mHelper.mHasVerticalScrollbar = didHaveVerticalScrollbar;
|
||||
@ -637,9 +637,10 @@ void nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
|
||||
// resize here would size it to the natural height of the frame,
|
||||
// which will usually be different from the scrollport height;
|
||||
// invalidating the difference will cause unnecessary repainting.
|
||||
FinishReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics,
|
||||
&kidReflowInput, wm, LogicalPoint(wm), dummyContainerSize,
|
||||
NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW);
|
||||
FinishReflowChild(
|
||||
mHelper.mScrolledFrame, presContext, *aMetrics, &kidReflowInput, wm,
|
||||
LogicalPoint(wm), dummyContainerSize,
|
||||
ReflowChildFlags::NoMoveFrame | ReflowChildFlags::NoSizeView);
|
||||
|
||||
// XXX Some frames (e.g., nsPluginFrame, nsFrameFrame, nsTextFrame) don't
|
||||
// bother setting their mOverflowArea. This is wrong because every frame
|
||||
@ -855,7 +856,7 @@ void nsHTMLScrollFrame::PlaceScrollArea(ScrollReflowInput& aState,
|
||||
// might create its own.
|
||||
nsContainerFrame::SyncFrameViewAfterReflow(
|
||||
scrolledFrame->PresContext(), scrolledFrame, scrolledFrame->GetView(),
|
||||
scrolledArea, 0);
|
||||
scrolledArea, ReflowChildFlags::Default);
|
||||
}
|
||||
|
||||
nscoord nsHTMLScrollFrame::GetIntrinsicVScrollbarWidth(
|
||||
@ -1676,7 +1677,7 @@ nsresult 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);
|
||||
|
||||
@ -5357,10 +5358,10 @@ bool nsXULScrollFrame::AddRemoveScrollbar(bool& aHasScrollbar, nscoord& aXY,
|
||||
|
||||
void nsXULScrollFrame::LayoutScrollArea(nsBoxLayoutState& aState,
|
||||
const nsPoint& aScrollPosition) {
|
||||
uint32_t oldflags = aState.LayoutFlags();
|
||||
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);
|
||||
|
||||
|
@ -4555,8 +4555,10 @@ static nscoord MeasuringReflow(nsIFrame* aChild,
|
||||
|
||||
ReflowOutput childSize(childRI);
|
||||
nsReflowStatus childStatus;
|
||||
const uint32_t flags = NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW |
|
||||
NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD;
|
||||
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);
|
||||
nsContainerFrame::FinishReflowChild(aChild, pc, childSize, &childRI, wm,
|
||||
@ -6335,7 +6337,7 @@ void nsGridContainerFrame::ReflowInFlowChild(
|
||||
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());
|
||||
// Apply align/justify-self and reflow again if that affects the size.
|
||||
@ -6364,7 +6366,7 @@ void nsGridContainerFrame::ReflowInFlowChild(
|
||||
|
||||
childRI.ApplyRelativePositioning(&childPos, aContainerSize);
|
||||
FinishReflowChild(aChild, pc, childSize, &childRI, childWM, childPos,
|
||||
aContainerSize, 0);
|
||||
aContainerSize, ReflowChildFlags::Default);
|
||||
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, aChild);
|
||||
}
|
||||
|
||||
@ -6895,8 +6897,8 @@ nscoord nsGridContainerFrame::ReflowChildren(GridReflowInput& aState,
|
||||
nsReflowStatus ocStatus;
|
||||
if (GetPrevInFlow()) {
|
||||
ReflowOverflowContainerChildren(PresContext(), *aState.mReflowInput,
|
||||
ocBounds, 0, ocStatus,
|
||||
MergeSortedFrameListsFor);
|
||||
ocBounds, ReflowChildFlags::Default,
|
||||
ocStatus, MergeSortedFrameListsFor);
|
||||
}
|
||||
|
||||
WritingMode wm = aState.mReflowInput->GetWritingMode();
|
||||
|
@ -373,9 +373,9 @@ void nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||
ReflowInput childReflowInput(aPresContext, aReflowInput, childFrame,
|
||||
availSize);
|
||||
ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowInput, 0,
|
||||
0, 0, childStatus, nullptr);
|
||||
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",
|
||||
|
@ -2543,6 +2543,19 @@ class nsIFrame : public nsQueryFrame {
|
||||
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
|
||||
@ -3733,7 +3746,9 @@ class nsIFrame : public nsQueryFrame {
|
||||
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;
|
||||
@ -4650,6 +4665,8 @@ class nsIFrame : public nsQueryFrame {
|
||||
#endif
|
||||
};
|
||||
|
||||
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(nsIFrame::ReflowChildFlags)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
@ -3279,7 +3279,8 @@ void nsLineLayout::RelativePositionFrames(PerSpanData* psd,
|
||||
if (frame->HasView())
|
||||
nsContainerFrame::SyncFrameViewAfterReflow(
|
||||
mPresContext, frame, frame->GetView(),
|
||||
pfd->mOverflowAreas.VisualOverflow(), NS_FRAME_NO_SIZE_VIEW);
|
||||
pfd->mOverflowAreas.VisualOverflow(),
|
||||
nsIFrame::ReflowChildFlags::NoSizeView);
|
||||
|
||||
// Note: the combined area of a child is in its coordinate
|
||||
// system. We adjust the childs combined area into our coordinate
|
||||
@ -3326,7 +3327,7 @@ void nsLineLayout::RelativePositionFrames(PerSpanData* psd,
|
||||
if (frame->HasView())
|
||||
nsContainerFrame::SyncFrameViewAfterReflow(
|
||||
mPresContext, frame, frame->GetView(), r.VisualOverflow(),
|
||||
NS_FRAME_NO_MOVE_VIEW);
|
||||
nsIFrame::ReflowChildFlags::NoMoveView);
|
||||
|
||||
overflowAreas.UnionWith(r + frame->GetPosition());
|
||||
}
|
||||
|
@ -57,8 +57,8 @@ void 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
|
||||
@ -90,7 +90,7 @@ void nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
// Place and size the child
|
||||
FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, 0, 0,
|
||||
0);
|
||||
ReflowChildFlags::Default);
|
||||
|
||||
NS_ASSERTION(aPresContext->IsDynamic() || !aStatus.IsFullyComplete() ||
|
||||
!frame->GetNextInFlow(),
|
||||
|
@ -133,12 +133,12 @@ void 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);
|
||||
yc, ReflowChildFlags::Default);
|
||||
|
||||
NS_ASSERTION(!aStatus.IsFullyComplete() || !frame->GetNextInFlow(),
|
||||
"bad child flow list");
|
||||
|
@ -250,14 +250,15 @@ void nsPageSequenceFrame::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;
|
||||
|
||||
|
@ -342,7 +342,7 @@ void nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
||||
// reflowed.
|
||||
FinishReflowChild(textContainer, aPresContext, textMetrics,
|
||||
&textReflowInput, lineWM, position, dummyContainerSize,
|
||||
0);
|
||||
ReflowChildFlags::Default);
|
||||
}
|
||||
MOZ_ASSERT(baseRect.ISize(lineWM) == offsetRect.ISize(lineWM),
|
||||
"Annotations should only be placed on the block directions");
|
||||
|
@ -315,14 +315,15 @@ void nsVideoFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
|
||||
kidReflowInput.SetComputedWidth(posterRenderRect.width);
|
||||
kidReflowInput.SetComputedHeight(posterRenderRect.height);
|
||||
ReflowChild(imageFrame, aPresContext, kidDesiredSize, kidReflowInput,
|
||||
posterRenderRect.x, posterRenderRect.y, 0, childStatus);
|
||||
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,
|
||||
0);
|
||||
ReflowChildFlags::Default);
|
||||
|
||||
} else if (child->GetContent() == mCaptionDiv ||
|
||||
child->GetContent() == videoControlsDiv) {
|
||||
@ -335,7 +336,8 @@ void nsVideoFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
|
||||
availableSize);
|
||||
ReflowOutput kidDesiredSize(kidReflowInput);
|
||||
ReflowChild(child, aPresContext, kidDesiredSize, kidReflowInput,
|
||||
borderPadding.left, borderPadding.top, 0, childStatus);
|
||||
borderPadding.left, borderPadding.top,
|
||||
ReflowChildFlags::Default, childStatus);
|
||||
MOZ_ASSERT(childStatus.IsFullyComplete(),
|
||||
"We gave our child unconstrained available block-size, "
|
||||
"so it should be complete!");
|
||||
@ -353,7 +355,8 @@ void nsVideoFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
|
||||
}
|
||||
|
||||
FinishReflowChild(child, aPresContext, kidDesiredSize, &kidReflowInput,
|
||||
borderPadding.left, borderPadding.top, 0);
|
||||
borderPadding.left, borderPadding.top,
|
||||
ReflowChildFlags::Default);
|
||||
|
||||
if (child->GetSize() != oldChildSize) {
|
||||
const nsString name = child->GetContent() == videoControlsDiv
|
||||
|
@ -788,8 +788,8 @@ void nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame,
|
||||
#endif
|
||||
|
||||
nsContainerFrame::ReflowChild(aChildFrame, aPresContext, aDesiredSize,
|
||||
aReflowInput, 0, 0, NS_FRAME_NO_MOVE_FRAME,
|
||||
aStatus);
|
||||
aReflowInput, 0, 0,
|
||||
ReflowChildFlags::NoMoveFrame, aStatus);
|
||||
|
||||
if (aDesiredSize.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
|
||||
// This will be suitable for inline frames, which are wrapped in a block.
|
||||
@ -1246,7 +1246,7 @@ void nsMathMLContainerFrame::PositionRowChildFrames(nscoord aOffsetX,
|
||||
nscoord dx = aOffsetX + child.X();
|
||||
nscoord dy = aBaseline - child.Ascent();
|
||||
FinishReflowChild(child.Frame(), PresContext(), child.GetReflowOutput(),
|
||||
nullptr, dx, dy, 0);
|
||||
nullptr, dx, dy, ReflowChildFlags::Default);
|
||||
++child;
|
||||
}
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ nsresult nsMathMLSelectedFrame::Place(DrawTarget* aDrawTarget,
|
||||
GetReflowAndBoundingMetricsFor(childFrame, aDesiredSize, mBoundingMetrics);
|
||||
if (aPlaceOrigin) {
|
||||
FinishReflowChild(childFrame, PresContext(), aDesiredSize, nullptr, 0, 0,
|
||||
0);
|
||||
ReflowChildFlags::Default);
|
||||
}
|
||||
mReference.x = 0;
|
||||
mReference.y = aDesiredSize.BlockStartAscent();
|
||||
|
@ -181,7 +181,7 @@ nsresult nsMathMLTokenFrame::Place(DrawTarget* aDrawTarget, bool aPlaceOrigin,
|
||||
? 0
|
||||
: aDesiredSize.BlockStartAscent() - childSize.BlockStartAscent();
|
||||
FinishReflowChild(childFrame, PresContext(), childSize, nullptr, dx, dy,
|
||||
0);
|
||||
ReflowChildFlags::Default);
|
||||
dx += childSize.Width();
|
||||
}
|
||||
}
|
||||
|
@ -387,7 +387,8 @@ void nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext,
|
||||
aDesiredSize.mBoundingMetrics += bm;
|
||||
|
||||
FinishReflowChild(childFrame, aPresContext, childSize, nullptr, dx,
|
||||
ascent - childSize.BlockStartAscent(), 0);
|
||||
ascent - childSize.BlockStartAscent(),
|
||||
ReflowChildFlags::Default);
|
||||
dx += childSize.Width();
|
||||
|
||||
if (i < mSeparatorsCount) {
|
||||
|
@ -422,10 +422,12 @@ nsresult nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget,
|
||||
nscoord dy;
|
||||
// place numerator
|
||||
dy = 0;
|
||||
FinishReflowChild(frameNum, presContext, sizeNum, nullptr, dxNum, dy, 0);
|
||||
FinishReflowChild(frameNum, presContext, sizeNum, nullptr, dxNum, dy,
|
||||
ReflowChildFlags::Default);
|
||||
// place denominator
|
||||
dy = aDesiredSize.Height() - sizeDen.Height();
|
||||
FinishReflowChild(frameDen, presContext, sizeDen, nullptr, dxDen, dy, 0);
|
||||
FinishReflowChild(frameDen, presContext, sizeDen, nullptr, dxDen, dy,
|
||||
ReflowChildFlags::Default);
|
||||
// place the fraction bar - dy is top of bar
|
||||
dy = aDesiredSize.BlockStartAscent() -
|
||||
(axisHeight + actualRuleThickness / 2);
|
||||
@ -548,7 +550,8 @@ nsresult nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget,
|
||||
dx = MirrorIfRTL(aDesiredSize.Width(), sizeNum.Width(), leadingSpace);
|
||||
dy = aDesiredSize.BlockStartAscent() - numShift -
|
||||
sizeNum.BlockStartAscent();
|
||||
FinishReflowChild(frameNum, presContext, sizeNum, nullptr, dx, dy, 0);
|
||||
FinishReflowChild(frameNum, presContext, sizeNum, nullptr, dx, dy,
|
||||
ReflowChildFlags::Default);
|
||||
|
||||
// place the fraction bar
|
||||
dx = MirrorIfRTL(aDesiredSize.Width(), mLineRect.width,
|
||||
@ -562,7 +565,8 @@ nsresult nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget,
|
||||
leadingSpace + bmNum.width + mLineRect.width);
|
||||
dy = aDesiredSize.BlockStartAscent() + denShift -
|
||||
sizeDen.BlockStartAscent();
|
||||
FinishReflowChild(frameDen, presContext, sizeDen, nullptr, dx, dy, 0);
|
||||
FinishReflowChild(frameDen, presContext, sizeDen, nullptr, dx, dy,
|
||||
ReflowChildFlags::Default);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -619,7 +619,7 @@ nsresult nsMathMLmmultiscriptsFrame::PlaceMultiScript(
|
||||
FinishReflowChild(
|
||||
baseFrame, aPresContext, baseSize, nullptr,
|
||||
aFrame->MirrorIfRTL(aDesiredSize.Width(), baseSize.Width(), dx), dy,
|
||||
0);
|
||||
ReflowChildFlags::Default);
|
||||
dx += bmBase.width;
|
||||
} else if (prescriptsFrame == childFrame) {
|
||||
// Clear reflow flags of prescripts frame.
|
||||
@ -655,7 +655,7 @@ nsresult nsMathMLmmultiscriptsFrame::PlaceMultiScript(
|
||||
nullptr,
|
||||
aFrame->MirrorIfRTL(aDesiredSize.Width(),
|
||||
subScriptSize.Width(), x),
|
||||
dy, 0);
|
||||
dy, ReflowChildFlags::Default);
|
||||
}
|
||||
|
||||
if (supScriptFrame) {
|
||||
@ -672,7 +672,7 @@ nsresult nsMathMLmmultiscriptsFrame::PlaceMultiScript(
|
||||
nullptr,
|
||||
aFrame->MirrorIfRTL(aDesiredSize.Width(),
|
||||
supScriptSize.Width(), x),
|
||||
dy, 0);
|
||||
dy, ReflowChildFlags::Default);
|
||||
}
|
||||
dx += width + scriptSpace;
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ void nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
|
||||
(indexRaisedAscent + indexSize.BlockStartAscent() - bmIndex.ascent);
|
||||
FinishReflowChild(indexFrame, aPresContext, indexSize, nullptr,
|
||||
MirrorIfRTL(aDesiredSize.Width(), indexSize.Width(), dx),
|
||||
dy, 0);
|
||||
dy, ReflowChildFlags::Default);
|
||||
|
||||
// place the radical symbol and the radical bar
|
||||
dx = dxSqr;
|
||||
@ -332,7 +332,7 @@ void nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
|
||||
dy = aDesiredSize.BlockStartAscent() - baseSize.BlockStartAscent();
|
||||
FinishReflowChild(baseFrame, aPresContext, baseSize, nullptr,
|
||||
MirrorIfRTL(aDesiredSize.Width(), baseSize.Width(), dx), dy,
|
||||
0);
|
||||
ReflowChildFlags::Default);
|
||||
|
||||
mReference.x = 0;
|
||||
mReference.y = aDesiredSize.BlockStartAscent();
|
||||
|
@ -704,18 +704,18 @@ nsresult nsMathMLmunderoverFrame::Place(DrawTarget* aDrawTarget,
|
||||
dy = aDesiredSize.BlockStartAscent() - mBoundingMetrics.ascent +
|
||||
bmOver.ascent - overSize.BlockStartAscent();
|
||||
FinishReflowChild(overFrame, PresContext(), overSize, nullptr, dxOver, dy,
|
||||
0);
|
||||
ReflowChildFlags::Default);
|
||||
}
|
||||
// place base
|
||||
dy = aDesiredSize.BlockStartAscent() - baseSize.BlockStartAscent();
|
||||
FinishReflowChild(baseFrame, PresContext(), baseSize, nullptr, dxBase, dy,
|
||||
0);
|
||||
ReflowChildFlags::Default);
|
||||
// place underscript
|
||||
if (underFrame) {
|
||||
dy = aDesiredSize.BlockStartAscent() + mBoundingMetrics.descent -
|
||||
bmUnder.descent - underSize.BlockStartAscent();
|
||||
FinishReflowChild(underFrame, PresContext(), underSize, nullptr, dxUnder,
|
||||
dy, 0);
|
||||
dy, ReflowChildFlags::Default);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -524,12 +524,12 @@ void nsSVGForeignObjectFrame::DoReflow() {
|
||||
reflowInput.SetComputedBSize(BSize(wm));
|
||||
|
||||
ReflowChild(kid, presContext, desiredSize, reflowInput, 0, 0,
|
||||
NS_FRAME_NO_MOVE_FRAME, status);
|
||||
ReflowChildFlags::NoMoveFrame, status);
|
||||
NS_ASSERTION(mRect.width == desiredSize.Width() &&
|
||||
mRect.height == desiredSize.Height(),
|
||||
"unexpected size");
|
||||
FinishReflowChild(kid, presContext, desiredSize, &reflowInput, 0, 0,
|
||||
NS_FRAME_NO_MOVE_FRAME);
|
||||
ReflowChildFlags::NoMoveFrame);
|
||||
|
||||
mInReflow = false;
|
||||
}
|
||||
|
@ -623,7 +623,8 @@ void nsTableCellFrame::BlockDirAlignChild(WritingMode aWM, nscoord aMaxAscent) {
|
||||
}
|
||||
if (HasView()) {
|
||||
nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this, GetView(),
|
||||
desiredSize.VisualOverflow(), 0);
|
||||
desiredSize.VisualOverflow(),
|
||||
ReflowChildFlags::Default);
|
||||
}
|
||||
}
|
||||
|
||||
@ -892,7 +893,7 @@ void nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
bool firstReflow = firstKid->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
|
||||
|
||||
ReflowChild(firstKid, aPresContext, kidSize, kidReflowInput, wm, kidOrigin,
|
||||
containerSize, 0, aStatus);
|
||||
containerSize, ReflowChildFlags::Default, aStatus);
|
||||
if (aStatus.IsOverflowIncomplete()) {
|
||||
// Don't pass OVERFLOW_INCOMPLETE through tables until they can actually
|
||||
// handle it
|
||||
@ -924,7 +925,7 @@ void nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
// Place the child
|
||||
FinishReflowChild(firstKid, aPresContext, kidSize, &kidReflowInput, wm,
|
||||
kidOrigin, containerSize, 0);
|
||||
kidOrigin, containerSize, ReflowChildFlags::Default);
|
||||
|
||||
if (tableFrame->IsBorderCollapse()) {
|
||||
nsTableFrame::InvalidateTableFrame(firstKid, origRect, origVisualOverflow,
|
||||
|
@ -341,9 +341,10 @@ void nsTableColGroupFrame::Reflow(nsPresContext* aPresContext,
|
||||
LogicalSize(kidFrame->GetWritingMode()));
|
||||
|
||||
nsReflowStatus status;
|
||||
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, 0, 0, 0,
|
||||
status);
|
||||
FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, 0, 0, 0);
|
||||
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, 0, 0,
|
||||
ReflowChildFlags::Default, status);
|
||||
FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, 0, 0,
|
||||
ReflowChildFlags::Default);
|
||||
}
|
||||
|
||||
aDesiredSize.ClearSize();
|
||||
|
@ -2683,7 +2683,7 @@ void nsTableFrame::PlaceChild(TableReflowInput& aReflowInput,
|
||||
|
||||
// Place and size the child
|
||||
FinishReflowChild(aKidFrame, PresContext(), aKidDesiredSize, nullptr,
|
||||
aKidPosition.x, aKidPosition.y, 0);
|
||||
aKidPosition.x, aKidPosition.y, ReflowChildFlags::Default);
|
||||
|
||||
InvalidateTableFrame(aKidFrame, aOriginalKidRect, aOriginalKidVisualOverflow,
|
||||
isFirstReflow);
|
||||
@ -2822,7 +2822,7 @@ nsresult nsTableFrame::SetupHeaderFooterChild(
|
||||
nsReflowStatus status;
|
||||
ReflowChild(aFrame, presContext, desiredSize, kidReflowInput, wm,
|
||||
LogicalPoint(wm, aReflowInput.iCoord, aReflowInput.bCoord),
|
||||
containerSize, 0, status);
|
||||
containerSize, ReflowChildFlags::Default, status);
|
||||
// The child will be reflowed again "for real" so no need to place it now
|
||||
|
||||
aFrame->SetRepeatable(IsRepeatable(desiredSize.Height(), pageHeight));
|
||||
@ -2855,7 +2855,8 @@ void nsTableFrame::PlaceRepeatedFooter(TableReflowInput& aReflowInput,
|
||||
desiredSize.ClearSize();
|
||||
LogicalPoint kidPosition(wm, aReflowInput.iCoord, aReflowInput.bCoord);
|
||||
ReflowChild(aTfoot, presContext, desiredSize, footerReflowInput, wm,
|
||||
kidPosition, containerSize, 0, footerStatus);
|
||||
kidPosition, containerSize, ReflowChildFlags::Default,
|
||||
footerStatus);
|
||||
footerReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
|
||||
|
||||
PlaceChild(aReflowInput, aTfoot,
|
||||
@ -3015,7 +3016,8 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
||||
LogicalPoint kidPosition(wm, aReflowInput.iCoord, aReflowInput.bCoord);
|
||||
aStatus.Reset();
|
||||
ReflowChild(kidFrame, presContext, desiredSize, kidReflowInput, wm,
|
||||
kidPosition, containerSize, 0, aStatus);
|
||||
kidPosition, containerSize, ReflowChildFlags::Default,
|
||||
aStatus);
|
||||
kidReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
|
||||
|
||||
if (reorder) {
|
||||
@ -3192,9 +3194,10 @@ void nsTableFrame::ReflowColGroups(gfxContext* aRenderingContext) {
|
||||
ReflowInput kidReflowInput(presContext, kidFrame, aRenderingContext,
|
||||
LogicalSize(kidFrame->GetWritingMode()));
|
||||
nsReflowStatus cgStatus;
|
||||
ReflowChild(kidFrame, presContext, kidMet, kidReflowInput, 0, 0, 0,
|
||||
cgStatus);
|
||||
FinishReflowChild(kidFrame, presContext, kidMet, nullptr, 0, 0, 0);
|
||||
ReflowChild(kidFrame, presContext, kidMet, kidReflowInput, 0, 0,
|
||||
ReflowChildFlags::Default, cgStatus);
|
||||
FinishReflowChild(kidFrame, presContext, kidMet, nullptr, 0, 0,
|
||||
ReflowChildFlags::Default);
|
||||
}
|
||||
}
|
||||
SetHaveReflowedColGroups(true);
|
||||
|
@ -376,7 +376,8 @@ void nsTableRowFrame::DidResize() {
|
||||
FinishAndStoreOverflow(&desiredSize);
|
||||
if (HasView()) {
|
||||
nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this, GetView(),
|
||||
desiredSize.VisualOverflow(), 0);
|
||||
desiredSize.VisualOverflow(),
|
||||
ReflowChildFlags::Default);
|
||||
}
|
||||
// Let our base class do the usual work
|
||||
}
|
||||
@ -736,8 +737,8 @@ void nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
|
||||
kidReflowInput);
|
||||
ReflowOutput desiredSize(aReflowInput);
|
||||
nsReflowStatus status;
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowInput, 0, 0, 0,
|
||||
status);
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowInput, 0, 0,
|
||||
ReflowChildFlags::Default, status);
|
||||
kidFrame->DidReflow(aPresContext, nullptr);
|
||||
|
||||
continue;
|
||||
@ -830,7 +831,8 @@ void nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
|
||||
|
||||
nsReflowStatus status;
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, *kidReflowInput, wm,
|
||||
kidPosition, containerSize, 0, status);
|
||||
kidPosition, containerSize, ReflowChildFlags::Default,
|
||||
status);
|
||||
|
||||
// allow the table to determine if/how the table needs to be rebalanced
|
||||
// If any of the cells are not complete, then we're not complete
|
||||
@ -911,7 +913,7 @@ void nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
|
||||
// because ComputedWidth() was NS_UNCONSTRAINEDSIZE.
|
||||
// For cases where that's wrong, we will fix up the position later.
|
||||
FinishReflowChild(kidFrame, aPresContext, desiredSize, nullptr, wm,
|
||||
kidPosition, containerSize, 0);
|
||||
kidPosition, containerSize, ReflowChildFlags::Default);
|
||||
|
||||
nsTableFrame* tableFrame = GetTableFrame();
|
||||
if (tableFrame->IsBorderCollapse()) {
|
||||
@ -1087,7 +1089,7 @@ nscoord nsTableRowFrame::ReflowCellFrame(nsPresContext* aPresContext,
|
||||
ReflowOutput desiredSize(aReflowInput);
|
||||
|
||||
ReflowChild(aCellFrame, aPresContext, desiredSize, cellReflowInput, 0, 0,
|
||||
NS_FRAME_NO_MOVE_FRAME, aStatus);
|
||||
ReflowChildFlags::NoMoveFrame, aStatus);
|
||||
bool fullyComplete = aStatus.IsComplete() && !aStatus.IsTruncated();
|
||||
if (fullyComplete) {
|
||||
desiredSize.BSize(wm) = aAvailableBSize;
|
||||
|
@ -282,7 +282,7 @@ void nsTableRowGroupFrame::PlaceChild(
|
||||
|
||||
// Place and size the child
|
||||
FinishReflowChild(aKidFrame, aPresContext, aDesiredSize, nullptr, aWM,
|
||||
aKidPosition, aContainerSize, 0);
|
||||
aKidPosition, aContainerSize, ReflowChildFlags::Default);
|
||||
|
||||
nsTableFrame* tableFrame = GetTableFrame();
|
||||
if (tableFrame->IsBorderCollapse()) {
|
||||
@ -406,7 +406,8 @@ void nsTableRowGroupFrame::ReflowChildren(
|
||||
|
||||
LogicalPoint kidPosition(wm, 0, aReflowInput.bCoord);
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowInput, wm,
|
||||
kidPosition, containerSize, 0, aStatus);
|
||||
kidPosition, containerSize, ReflowChildFlags::Default,
|
||||
aStatus);
|
||||
kidReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
|
||||
|
||||
// Place the child
|
||||
@ -1159,7 +1160,7 @@ nsresult nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
||||
// Reflow the cell with the constrained height. A cell with rowspan >1
|
||||
// will get this reflow later during SplitSpanningCells.
|
||||
ReflowChild(rowFrame, aPresContext, rowMetrics, rowReflowInput, 0, 0,
|
||||
NS_FRAME_NO_MOVE_FRAME, aStatus);
|
||||
ReflowChildFlags::NoMoveFrame, aStatus);
|
||||
rowFrame->SetSize(nsSize(rowMetrics.Width(), rowMetrics.Height()));
|
||||
rowFrame->DidReflow(aPresContext, nullptr);
|
||||
rowFrame->DidResize();
|
||||
|
@ -766,7 +766,7 @@ void nsTableWrapperFrame::OuterDoReflowChild(nsPresContext* aPresContext,
|
||||
|
||||
// Use the current position as a best guess for placement.
|
||||
LogicalPoint childPt = aChildFrame->GetLogicalPosition(wm, zeroCSize);
|
||||
uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
|
||||
ReflowChildFlags flags = ReflowChildFlags::NoMoveFrame;
|
||||
|
||||
// We don't want to delete our next-in-flow's child if it's an inner table
|
||||
// frame, because table wrapper frames always assume that their inner table
|
||||
@ -774,7 +774,7 @@ void nsTableWrapperFrame::OuterDoReflowChild(nsPresContext* aPresContext,
|
||||
// a next-in-flow of an already complete table wrapper frame, then it will
|
||||
// take care of removing it's inner table frame.
|
||||
if (aChildFrame == InnerTableFrame()) {
|
||||
flags |= NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD;
|
||||
flags |= ReflowChildFlags::NoDeleteNextInFlowChild;
|
||||
}
|
||||
|
||||
ReflowChild(aChildFrame, aPresContext, aMetrics, aChildRI, wm, childPt,
|
||||
@ -960,7 +960,8 @@ void nsTableWrapperFrame::Reflow(nsPresContext* aPresContext,
|
||||
GetCaptionOrigin(captionSide, containSize, innerSize, innerMargin,
|
||||
captionSize, captionMargin, captionOrigin, wm);
|
||||
FinishReflowChild(mCaptionFrames.FirstChild(), aPresContext, *captionMet,
|
||||
captionRI.ptr(), wm, captionOrigin, containerSize, 0);
|
||||
captionRI.ptr(), wm, captionOrigin, containerSize,
|
||||
ReflowChildFlags::Default);
|
||||
captionRI.reset();
|
||||
}
|
||||
// XXX If the bsize is constrained then we need to check whether
|
||||
@ -970,7 +971,7 @@ void nsTableWrapperFrame::Reflow(nsPresContext* aPresContext,
|
||||
GetInnerOrigin(captionSide, containSize, captionSize, captionMargin,
|
||||
innerSize, innerMargin, innerOrigin, wm);
|
||||
FinishReflowChild(InnerTableFrame(), aPresContext, innerMet, innerRI.ptr(),
|
||||
wm, innerOrigin, containerSize, 0);
|
||||
wm, innerOrigin, containerSize, ReflowChildFlags::Default);
|
||||
innerRI.reset();
|
||||
|
||||
if (mCaptionFrames.NotEmpty()) {
|
||||
@ -983,7 +984,8 @@ void nsTableWrapperFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
if (GetPrevInFlow()) {
|
||||
ReflowOverflowContainerChildren(aPresContext, aOuterRI,
|
||||
aDesiredSize.mOverflowAreas, 0, aStatus);
|
||||
aDesiredSize.mOverflowAreas,
|
||||
ReflowChildFlags::Default, aStatus);
|
||||
}
|
||||
|
||||
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aOuterRI, aStatus);
|
||||
|
@ -102,16 +102,14 @@ void nsBox::SetXULBounds(nsBoxLayoutState& aState, const nsRect& aRect,
|
||||
bool aRemoveOverflowAreas) {
|
||||
nsRect rect(mRect);
|
||||
|
||||
uint32_t flags = GetXULLayoutFlags();
|
||||
ReflowChildFlags flags = GetXULLayoutFlags() | aState.LayoutFlags();
|
||||
|
||||
uint32_t stateFlags = aState.LayoutFlags();
|
||||
|
||||
flags |= stateFlags;
|
||||
|
||||
if ((flags & NS_FRAME_NO_MOVE_FRAME) == NS_FRAME_NO_MOVE_FRAME)
|
||||
if ((flags & ReflowChildFlags::NoMoveFrame) ==
|
||||
ReflowChildFlags::NoMoveFrame) {
|
||||
SetSize(aRect.Size());
|
||||
else
|
||||
} else {
|
||||
SetRect(aRect);
|
||||
}
|
||||
|
||||
// Nuke the overflow area. The caller is responsible for restoring
|
||||
// it if necessary.
|
||||
@ -120,7 +118,7 @@ void nsBox::SetXULBounds(nsBoxLayoutState& aState, const nsRect& aRect,
|
||||
ClearOverflowRects();
|
||||
}
|
||||
|
||||
if (!(flags & NS_FRAME_NO_MOVE_VIEW)) {
|
||||
if (!(flags & ReflowChildFlags::NoMoveView)) {
|
||||
nsContainerFrame::PositionFrameView(this);
|
||||
if ((rect.x != aRect.x) || (rect.y != aRect.y))
|
||||
nsContainerFrame::PositionChildViews(this);
|
||||
@ -329,11 +327,7 @@ nsresult nsBox::SyncLayout(nsBoxLayoutState& aState) {
|
||||
|
||||
nsPresContext* presContext = aState.PresContext();
|
||||
|
||||
uint32_t flags = GetXULLayoutFlags();
|
||||
|
||||
uint32_t stateFlags = aState.LayoutFlags();
|
||||
|
||||
flags |= stateFlags;
|
||||
ReflowChildFlags flags = GetXULLayoutFlags() | aState.LayoutFlags();
|
||||
|
||||
nsRect visualOverflow;
|
||||
|
||||
|
@ -790,8 +790,8 @@ nscoord nsBoxFrame::GetXULFlex() {
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsBoxFrame::DoXULLayout(nsBoxLayoutState& aState) {
|
||||
uint32_t oldFlags = aState.LayoutFlags();
|
||||
aState.SetLayoutFlags(0);
|
||||
ReflowChildFlags oldFlags = aState.LayoutFlags();
|
||||
aState.SetLayoutFlags(ReflowChildFlags::Default);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
if (mLayoutManager) {
|
||||
|
@ -20,7 +20,7 @@ nsBoxLayoutState::nsBoxLayoutState(nsPresContext* aPresContext,
|
||||
: mPresContext(aPresContext),
|
||||
mRenderingContext(aRenderingContext),
|
||||
mOuterReflowInput(aOuterReflowInput),
|
||||
mLayoutFlags(0),
|
||||
mLayoutFlags(nsIFrame::ReflowChildFlags::Default),
|
||||
mReflowDepth(aReflowDepth),
|
||||
mPaintingDisabled(false) {
|
||||
NS_ASSERTION(mPresContext, "PresContext must be non-null");
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIFrame.h"
|
||||
|
||||
class gfxContext;
|
||||
namespace mozilla {
|
||||
@ -37,8 +38,10 @@ class MOZ_STACK_CLASS nsBoxLayoutState {
|
||||
nsPresContext* PresContext() const { return mPresContext; }
|
||||
mozilla::PresShell* PresShell() const { return mPresContext->PresShell(); }
|
||||
|
||||
uint32_t LayoutFlags() const { return mLayoutFlags; }
|
||||
void SetLayoutFlags(uint32_t aFlags) { mLayoutFlags = aFlags; }
|
||||
nsIFrame::ReflowChildFlags LayoutFlags() const { return mLayoutFlags; }
|
||||
void SetLayoutFlags(nsIFrame::ReflowChildFlags aFlags) {
|
||||
mLayoutFlags = aFlags;
|
||||
}
|
||||
|
||||
// if true no one under us will paint during reflow.
|
||||
void SetPaintingDisabled(bool aDisable) { mPaintingDisabled = aDisable; }
|
||||
@ -68,7 +71,7 @@ class MOZ_STACK_CLASS nsBoxLayoutState {
|
||||
RefPtr<nsPresContext> mPresContext;
|
||||
gfxContext* mRenderingContext;
|
||||
const ReflowInput* mOuterReflowInput;
|
||||
uint32_t mLayoutFlags;
|
||||
nsIFrame::ReflowChildFlags mLayoutFlags;
|
||||
uint16_t mReflowDepth;
|
||||
bool mPaintingDisabled;
|
||||
};
|
||||
|
@ -211,8 +211,9 @@ NS_IMETHODIMP
|
||||
nsDeckFrame::DoXULLayout(nsBoxLayoutState& aState) {
|
||||
// Make sure we tweak the state so it does not resize our children.
|
||||
// We will do that.
|
||||
uint32_t oldFlags = aState.LayoutFlags();
|
||||
aState.SetLayoutFlags(NS_FRAME_NO_SIZE_VIEW | NS_FRAME_NO_VISIBILITY);
|
||||
ReflowChildFlags oldFlags = aState.LayoutFlags();
|
||||
aState.SetLayoutFlags(ReflowChildFlags::NoSizeView |
|
||||
ReflowChildFlags::NoVisibility);
|
||||
|
||||
// do a normal layout
|
||||
nsresult rv = nsBoxFrame::DoXULLayout(aState);
|
||||
|
@ -960,8 +960,9 @@ void nsMenuPopupFrame::HidePopup(bool aDeselectMenu, nsPopupState aNewState) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t nsMenuPopupFrame::GetXULLayoutFlags() {
|
||||
return NS_FRAME_NO_SIZE_VIEW | NS_FRAME_NO_MOVE_VIEW | NS_FRAME_NO_VISIBILITY;
|
||||
nsIFrame::ReflowChildFlags nsMenuPopupFrame::GetXULLayoutFlags() {
|
||||
return ReflowChildFlags::NoSizeView | ReflowChildFlags::NoMoveView |
|
||||
ReflowChildFlags::NoVisibility;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -451,7 +451,7 @@ class nsMenuPopupFrame final : public nsBoxFrame,
|
||||
nsPopupLevel PopupLevel(bool aIsNoAutoHide) const;
|
||||
|
||||
// redefine to tell the box system not to move the views.
|
||||
virtual uint32_t GetXULLayoutFlags() override;
|
||||
ReflowChildFlags GetXULLayoutFlags() override;
|
||||
|
||||
void InitPositionFromAnchorAlign(const nsAString& aAnchor,
|
||||
const nsAString& aAlign);
|
||||
|
Loading…
Reference in New Issue
Block a user