mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
Issue #1916 - Part 1: Convert flags passed to ReflowChild, FinishReflowChild, etc into an enum class.
Backported from Mozilla bug 1571250.
This commit is contained in:
parent
9cc1870b9f
commit
0423d83560
51 changed files with 365 additions and 303 deletions
|
|
@ -460,10 +460,10 @@ nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext,
|
||||||
|
|
||||||
// Allow the child to move/size/change-visibility its view if it's currently
|
// Allow the child to move/size/change-visibility its view if it's currently
|
||||||
// dropped down
|
// dropped down
|
||||||
int32_t flags = mDroppedDown ? 0
|
ReflowChildFlags flags = mDroppedDown ? ReflowChildFlags::Default
|
||||||
: NS_FRAME_NO_MOVE_FRAME |
|
: ReflowChildFlags::NoMoveFrame |
|
||||||
NS_FRAME_NO_VISIBILITY |
|
ReflowChildFlags::NoVisibility |
|
||||||
NS_FRAME_NO_SIZE_VIEW;
|
ReflowChildFlags::NoSizeView;
|
||||||
|
|
||||||
//XXX Can this be different from the dropdown's writing mode?
|
//XXX Can this be different from the dropdown's writing mode?
|
||||||
// That would be odd!
|
// That would be odd!
|
||||||
|
|
|
||||||
|
|
@ -233,8 +233,8 @@ nsDateTimeControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
// will be fixed later.
|
// will be fixed later.
|
||||||
const nsSize dummyContainerSize;
|
const nsSize dummyContainerSize;
|
||||||
ReflowChild(inputAreaFrame, aPresContext, childDesiredSize,
|
ReflowChild(inputAreaFrame, aPresContext, childDesiredSize,
|
||||||
childReflowOuput, myWM, childOffset, dummyContainerSize, 0,
|
childReflowOuput, myWM, childOffset, dummyContainerSize,
|
||||||
childStatus);
|
ReflowChildFlags::Default, childStatus);
|
||||||
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus),
|
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus),
|
||||||
"We gave our child unconstrained available block-size, "
|
"We gave our child unconstrained available block-size, "
|
||||||
"so it should be complete");
|
"so it should be complete");
|
||||||
|
|
@ -271,7 +271,8 @@ nsDateTimeControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
|
|
||||||
// Place the child
|
// Place the child
|
||||||
FinishReflowChild(inputAreaFrame, aPresContext, childDesiredSize,
|
FinishReflowChild(inputAreaFrame, aPresContext, childDesiredSize,
|
||||||
&childReflowOuput, myWM, childOffset, borderBoxSize, 0);
|
&childReflowOuput, myWM, childOffset, borderBoxSize,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
|
|
||||||
nsSize contentBoxSize =
|
nsSize contentBoxSize =
|
||||||
LogicalSize(myWM, contentBoxISize, contentBoxBSize).
|
LogicalSize(myWM, contentBoxISize, contentBoxBSize).
|
||||||
|
|
|
||||||
|
|
@ -397,8 +397,8 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||||
nsOverflowAreas ocBounds;
|
nsOverflowAreas ocBounds;
|
||||||
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
||||||
if (GetPrevInFlow()) {
|
if (GetPrevInFlow()) {
|
||||||
ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0,
|
ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds,
|
||||||
ocStatus);
|
ReflowChildFlags::Default, ocStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------ Handle Incremental Reflow -----------------
|
//------------ Handle Incremental Reflow -----------------
|
||||||
|
|
@ -459,7 +459,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||||
const nsSize dummyContainerSize;
|
const nsSize dummyContainerSize;
|
||||||
ReflowChild(legend, aPresContext, legendDesiredSize, *legendReflowInput,
|
ReflowChild(legend, aPresContext, legendDesiredSize, *legendReflowInput,
|
||||||
wm, LogicalPoint(wm), dummyContainerSize,
|
wm, LogicalPoint(wm), dummyContainerSize,
|
||||||
NS_FRAME_NO_MOVE_FRAME, aStatus);
|
ReflowChildFlags::NoMoveFrame, aStatus);
|
||||||
#ifdef NOISY_REFLOW
|
#ifdef NOISY_REFLOW
|
||||||
printf(" returned (%d, %d)\n",
|
printf(" returned (%d, %d)\n",
|
||||||
legendDesiredSize.Width(), legendDesiredSize.Height());
|
legendDesiredSize.Width(), legendDesiredSize.Height());
|
||||||
|
|
@ -488,7 +488,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||||
|
|
||||||
FinishReflowChild(legend, aPresContext, legendDesiredSize,
|
FinishReflowChild(legend, aPresContext, legendDesiredSize,
|
||||||
legendReflowInput.ptr(), wm, LogicalPoint(wm),
|
legendReflowInput.ptr(), wm, LogicalPoint(wm),
|
||||||
dummyContainerSize, NS_FRAME_NO_MOVE_FRAME);
|
dummyContainerSize, ReflowChildFlags::NoMoveFrame);
|
||||||
} else if (!legend) {
|
} else if (!legend) {
|
||||||
mLegendRect.SetEmpty();
|
mLegendRect.SetEmpty();
|
||||||
mLegendSpace = 0;
|
mLegendSpace = 0;
|
||||||
|
|
@ -540,13 +540,13 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||||
// if necessary.
|
// if necessary.
|
||||||
const nsSize dummyContainerSize;
|
const nsSize dummyContainerSize;
|
||||||
ReflowChild(inner, aPresContext, kidDesiredSize, kidReflowInput,
|
ReflowChild(inner, aPresContext, kidDesiredSize, kidReflowInput,
|
||||||
wm, pt, dummyContainerSize, 0, aStatus);
|
wm, pt, dummyContainerSize, ReflowChildFlags::Default, aStatus);
|
||||||
|
|
||||||
// Update containerSize to account for size of the inner frame, so that
|
// Update containerSize to account for size of the inner frame, so that
|
||||||
// FinishReflowChild can position it correctly.
|
// FinishReflowChild can position it correctly.
|
||||||
containerSize += kidDesiredSize.PhysicalSize();
|
containerSize += kidDesiredSize.PhysicalSize();
|
||||||
FinishReflowChild(inner, aPresContext, kidDesiredSize,
|
FinishReflowChild(inner, aPresContext, kidDesiredSize, &kidReflowInput, wm,
|
||||||
&kidReflowInput, wm, pt, containerSize, 0);
|
pt, containerSize, ReflowChildFlags::Default);
|
||||||
NS_FRAME_TRACE_REFLOW_OUT("FieldSet::Reflow", aStatus);
|
NS_FRAME_TRACE_REFLOW_OUT("FieldSet::Reflow", aStatus);
|
||||||
} else if (inner) {
|
} else if (inner) {
|
||||||
// |inner| didn't need to be reflowed but we do need to include its size
|
// |inner| didn't need to be reflowed but we do need to include its size
|
||||||
|
|
|
||||||
|
|
@ -333,7 +333,8 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||||
nsSize dummyContainerSize;
|
nsSize dummyContainerSize;
|
||||||
ReflowChild(aFirstKid, aPresContext,
|
ReflowChild(aFirstKid, aPresContext,
|
||||||
contentsDesiredSize, contentsReflowInput,
|
contentsDesiredSize, contentsReflowInput,
|
||||||
wm, childPos, dummyContainerSize, 0, contentsReflowStatus);
|
wm, childPos, dummyContainerSize, ReflowChildFlags::Default,
|
||||||
|
contentsReflowStatus);
|
||||||
MOZ_ASSERT(NS_FRAME_IS_COMPLETE(contentsReflowStatus),
|
MOZ_ASSERT(NS_FRAME_IS_COMPLETE(contentsReflowStatus),
|
||||||
"We gave button-contents frame unconstrained available height, "
|
"We gave button-contents frame unconstrained available height, "
|
||||||
"so it should be complete");
|
"so it should be complete");
|
||||||
|
|
@ -386,9 +387,9 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||||
(buttonContentBox + clbp.Size(wm)).GetPhysicalSize(wm);
|
(buttonContentBox + clbp.Size(wm)).GetPhysicalSize(wm);
|
||||||
|
|
||||||
// Place the child
|
// Place the child
|
||||||
FinishReflowChild(aFirstKid, aPresContext,
|
FinishReflowChild(aFirstKid, aPresContext, contentsDesiredSize,
|
||||||
contentsDesiredSize, &contentsReflowInput,
|
&contentsReflowInput, wm, childPos, containerSize,
|
||||||
wm, childPos, containerSize, 0);
|
ReflowChildFlags::Default);
|
||||||
|
|
||||||
// Make sure we have a useful 'ascent' value for the child
|
// Make sure we have a useful 'ascent' value for the child
|
||||||
if (contentsDesiredSize.BlockStartAscent() ==
|
if (contentsDesiredSize.BlockStartAscent() ==
|
||||||
|
|
|
||||||
|
|
@ -187,9 +187,9 @@ nsMeterFrame::ReflowBarFrame(nsIFrame* aBarFrame,
|
||||||
|
|
||||||
ReflowOutput barDesiredSize(reflowInput);
|
ReflowOutput barDesiredSize(reflowInput);
|
||||||
ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowInput, xoffset,
|
ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowInput, xoffset,
|
||||||
yoffset, 0, aStatus);
|
yoffset, ReflowChildFlags::Default, aStatus);
|
||||||
FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowInput,
|
FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowInput,
|
||||||
xoffset, yoffset, 0);
|
xoffset, yoffset, ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -181,8 +181,8 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
// will be fixed later.
|
// will be fixed later.
|
||||||
const nsSize dummyContainerSize;
|
const nsSize dummyContainerSize;
|
||||||
ReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
ReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
||||||
wrapperReflowInput, myWM, wrapperOffset, dummyContainerSize, 0,
|
wrapperReflowInput, myWM, wrapperOffset, dummyContainerSize,
|
||||||
childStatus);
|
ReflowChildFlags::Default, childStatus);
|
||||||
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus),
|
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus),
|
||||||
"We gave our child unconstrained available block-size, "
|
"We gave our child unconstrained available block-size, "
|
||||||
"so it should be complete");
|
"so it should be complete");
|
||||||
|
|
@ -219,8 +219,8 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
|
|
||||||
// Place the child
|
// Place the child
|
||||||
FinishReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
FinishReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
||||||
&wrapperReflowInput, myWM, wrapperOffset,
|
&wrapperReflowInput, myWM, wrapperOffset, borderBoxSize,
|
||||||
borderBoxSize, 0);
|
ReflowChildFlags::Default);
|
||||||
|
|
||||||
nsSize contentBoxSize =
|
nsSize contentBoxSize =
|
||||||
LogicalSize(myWM, contentBoxISize, contentBoxBSize).
|
LogicalSize(myWM, contentBoxISize, contentBoxBSize).
|
||||||
|
|
|
||||||
|
|
@ -203,9 +203,9 @@ nsProgressFrame::ReflowChildFrame(nsIFrame* aChild,
|
||||||
|
|
||||||
ReflowOutput barDesiredSize(aReflowInput);
|
ReflowOutput barDesiredSize(aReflowInput);
|
||||||
ReflowChild(aChild, aPresContext, barDesiredSize, reflowInput, xoffset,
|
ReflowChild(aChild, aPresContext, barDesiredSize, reflowInput, xoffset,
|
||||||
yoffset, 0, aStatus);
|
yoffset, ReflowChildFlags::Default, aStatus);
|
||||||
FinishReflowChild(aChild, aPresContext, barDesiredSize, &reflowInput,
|
FinishReflowChild(aChild, aPresContext, barDesiredSize, &reflowInput,
|
||||||
xoffset, yoffset, 0);
|
xoffset, yoffset, ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -415,12 +415,13 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
nsReflowStatus frameStatus;
|
nsReflowStatus frameStatus;
|
||||||
ReflowOutput trackDesiredSize(aReflowInput);
|
ReflowOutput trackDesiredSize(aReflowInput);
|
||||||
ReflowChild(trackFrame, aPresContext, trackDesiredSize,
|
ReflowChild(trackFrame, aPresContext, trackDesiredSize, trackReflowInput,
|
||||||
trackReflowInput, trackX, trackY, 0, frameStatus);
|
trackX, trackY, ReflowChildFlags::Default, frameStatus);
|
||||||
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
|
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
|
||||||
"We gave our child unconstrained height, so it should be complete");
|
"We gave our child unconstrained height, so it should be complete");
|
||||||
FinishReflowChild(trackFrame, aPresContext, trackDesiredSize,
|
FinishReflowChild(trackFrame, aPresContext, trackDesiredSize,
|
||||||
&trackReflowInput, trackX, trackY, 0);
|
&trackReflowInput, trackX, trackY,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame();
|
nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame();
|
||||||
|
|
@ -437,12 +438,12 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
nsReflowStatus frameStatus;
|
nsReflowStatus frameStatus;
|
||||||
ReflowOutput thumbDesiredSize(aReflowInput);
|
ReflowOutput thumbDesiredSize(aReflowInput);
|
||||||
ReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
|
ReflowChild(thumbFrame, aPresContext, thumbDesiredSize, thumbReflowInput, 0,
|
||||||
thumbReflowInput, 0, 0, 0, frameStatus);
|
0, ReflowChildFlags::Default, frameStatus);
|
||||||
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
|
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
|
||||||
"We gave our child unconstrained height, so it should be complete");
|
"We gave our child unconstrained height, so it should be complete");
|
||||||
FinishReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
|
FinishReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
|
||||||
&thumbReflowInput, 0, 0, 0);
|
&thumbReflowInput, 0, 0, ReflowChildFlags::Default);
|
||||||
DoUpdateThumbPosition(thumbFrame, nsSize(aDesiredSize.Width(),
|
DoUpdateThumbPosition(thumbFrame, nsSize(aDesiredSize.Width(),
|
||||||
aDesiredSize.Height()));
|
aDesiredSize.Height()));
|
||||||
}
|
}
|
||||||
|
|
@ -462,13 +463,13 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
||||||
|
|
||||||
nsReflowStatus frameStatus;
|
nsReflowStatus frameStatus;
|
||||||
ReflowOutput progressDesiredSize(aReflowInput);
|
ReflowOutput progressDesiredSize(aReflowInput);
|
||||||
ReflowChild(rangeProgressFrame, aPresContext,
|
ReflowChild(rangeProgressFrame, aPresContext, progressDesiredSize,
|
||||||
progressDesiredSize, progressReflowInput, 0, 0,
|
progressReflowInput, 0, 0, ReflowChildFlags::Default,
|
||||||
0, frameStatus);
|
frameStatus);
|
||||||
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
|
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
|
||||||
"We gave our child unconstrained height, so it should be complete");
|
"We gave our child unconstrained height, so it should be complete");
|
||||||
FinishReflowChild(rangeProgressFrame, aPresContext,
|
FinishReflowChild(rangeProgressFrame, aPresContext, progressDesiredSize,
|
||||||
progressDesiredSize, &progressReflowInput, 0, 0, 0);
|
&progressReflowInput, 0, 0, ReflowChildFlags::Default);
|
||||||
DoUpdateRangeProgressFrame(rangeProgressFrame, nsSize(aDesiredSize.Width(),
|
DoUpdateRangeProgressFrame(rangeProgressFrame, nsSize(aDesiredSize.Width(),
|
||||||
aDesiredSize.Height()));
|
aDesiredSize.Height()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -581,12 +581,12 @@ nsTextControlFrame::ReflowTextControlChild(nsIFrame* aKid,
|
||||||
|
|
||||||
// reflow the child
|
// reflow the child
|
||||||
ReflowOutput desiredSize(aReflowInput);
|
ReflowOutput desiredSize(aReflowInput);
|
||||||
ReflowChild(aKid, aPresContext, desiredSize, kidReflowInput,
|
ReflowChild(aKid, aPresContext, desiredSize, kidReflowInput, xOffset, yOffset,
|
||||||
xOffset, yOffset, 0, aStatus);
|
ReflowChildFlags::Default, aStatus);
|
||||||
|
|
||||||
// place the child
|
// place the child
|
||||||
FinishReflowChild(aKid, aPresContext, desiredSize,
|
FinishReflowChild(aKid, aPresContext, desiredSize, &kidReflowInput, xOffset,
|
||||||
&kidReflowInput, xOffset, yOffset, 0);
|
yOffset, ReflowChildFlags::Default);
|
||||||
|
|
||||||
// consider the overflow
|
// consider the overflow
|
||||||
aParentDesiredSize.mOverflowAreas.UnionWith(desiredSize.mOverflowAreas);
|
aParentDesiredSize.mOverflowAreas.UnionWith(desiredSize.mOverflowAreas);
|
||||||
|
|
|
||||||
|
|
@ -1182,8 +1182,8 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||||
nsOverflowAreas ocBounds;
|
nsOverflowAreas ocBounds;
|
||||||
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
||||||
if (GetPrevInFlow()) {
|
if (GetPrevInFlow()) {
|
||||||
ReflowOverflowContainerChildren(aPresContext, *reflowInput, ocBounds, 0,
|
ReflowOverflowContainerChildren(aPresContext, *reflowInput, ocBounds,
|
||||||
ocStatus);
|
ReflowChildFlags::Default, ocStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that we're done cleaning up our overflow container lists, we can
|
// 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();
|
WritingMode metricsWM = metrics.GetWritingMode();
|
||||||
aFloat->SetSize(metricsWM, metrics.Size(metricsWM));
|
aFloat->SetSize(metricsWM, metrics.Size(metricsWM));
|
||||||
if (aFloat->HasView()) {
|
if (aFloat->HasView()) {
|
||||||
nsContainerFrame::SyncFrameViewAfterReflow(aState.mPresContext, aFloat,
|
nsContainerFrame::SyncFrameViewAfterReflow(
|
||||||
aFloat->GetView(),
|
aState.mPresContext, aFloat, aFloat->GetView(),
|
||||||
metrics.VisualOverflow(),
|
metrics.VisualOverflow(), ReflowChildFlags::NoMoveView);
|
||||||
NS_FRAME_NO_MOVE_VIEW);
|
|
||||||
}
|
}
|
||||||
// Pass floatRS so the frame hierarchy can be used (redoFloatRS has the same hierarchy)
|
// Pass floatRS so the frame hierarchy can be used (redoFloatRS has the same hierarchy)
|
||||||
aFloat->DidReflow(aState.mPresContext, &floatRS,
|
aFloat->DidReflow(aState.mPresContext, &floatRS,
|
||||||
|
|
|
||||||
|
|
@ -456,7 +456,8 @@ nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowInput,
|
||||||
// Now place the frame and complete the reflow process
|
// Now place the frame and complete the reflow process
|
||||||
nsContainerFrame::FinishReflowChild(mFrame, mPresContext, mMetrics,
|
nsContainerFrame::FinishReflowChild(mFrame, mPresContext, mMetrics,
|
||||||
&aReflowInput, frameWM, logPos,
|
&aReflowInput, frameWM, logPos,
|
||||||
mContainerSize, 0);
|
mContainerSize,
|
||||||
|
nsIFrame::ReflowChildFlags::Default);
|
||||||
|
|
||||||
aOverflowAreas = mMetrics.mOverflowAreas + mFrame->GetPosition();
|
aOverflowAreas = mMetrics.mOverflowAreas + mFrame->GetPosition();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -636,12 +636,12 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||||
kidReflowInput.ApplyRelativePositioning(&kidPt, containerSize);
|
kidReflowInput.ApplyRelativePositioning(&kidPt, containerSize);
|
||||||
|
|
||||||
// Reflow the frame
|
// Reflow the frame
|
||||||
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput,
|
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput, kidWM,
|
||||||
kidWM, kidPt, containerSize, 0, aStatus);
|
kidPt, containerSize, ReflowChildFlags::Default, aStatus);
|
||||||
|
|
||||||
// Complete the reflow and position and size the child frame
|
// Complete the reflow and position and size the child frame
|
||||||
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, &kidReflowInput,
|
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, &kidReflowInput,
|
||||||
kidWM, kidPt, containerSize, 0);
|
kidWM, kidPt, containerSize, ReflowChildFlags::Default);
|
||||||
|
|
||||||
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
|
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
|
||||||
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
|
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
|
||||||
|
|
@ -696,8 +696,8 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||||
|
|
||||||
if (prevCanvasFrame) {
|
if (prevCanvasFrame) {
|
||||||
ReflowOverflowContainerChildren(aPresContext, aReflowInput,
|
ReflowOverflowContainerChildren(aPresContext, aReflowInput,
|
||||||
aDesiredSize.mOverflowAreas, 0,
|
aDesiredSize.mOverflowAreas,
|
||||||
aStatus);
|
ReflowChildFlags::Default, aStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
|
|
|
||||||
|
|
@ -641,8 +641,8 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
||||||
kidReflowInput.ComputedLogicalMargin().IStart(wm),
|
kidReflowInput.ComputedLogicalMargin().IStart(wm),
|
||||||
childOrigin.B(wm) +
|
childOrigin.B(wm) +
|
||||||
kidReflowInput.ComputedLogicalMargin().BStart(wm));
|
kidReflowInput.ComputedLogicalMargin().BStart(wm));
|
||||||
ReflowChild(child, PresContext(), kidDesiredSize, kidReflowInput,
|
ReflowChild(child, PresContext(), kidDesiredSize, kidReflowInput, wm,
|
||||||
wm, origin, containerSize, 0, aStatus);
|
origin, containerSize, ReflowChildFlags::Default, aStatus);
|
||||||
|
|
||||||
reflowNext = (aStatus & NS_FRAME_REFLOW_NEXTINFLOW) != 0;
|
reflowNext = (aStatus & NS_FRAME_REFLOW_NEXTINFLOW) != 0;
|
||||||
|
|
||||||
|
|
@ -656,8 +656,9 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
||||||
|
|
||||||
*aCarriedOutBEndMargin = kidDesiredSize.mCarriedOutBEndMargin;
|
*aCarriedOutBEndMargin = kidDesiredSize.mCarriedOutBEndMargin;
|
||||||
|
|
||||||
FinishReflowChild(child, PresContext(), kidDesiredSize,
|
FinishReflowChild(child, PresContext(), kidDesiredSize, &kidReflowInput,
|
||||||
&kidReflowInput, wm, childOrigin, containerSize, 0);
|
wm, childOrigin, containerSize,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
|
|
||||||
childContentBEnd = nsLayoutUtils::CalculateContentBEnd(wm, child);
|
childContentBEnd = nsLayoutUtils::CalculateContentBEnd(wm, child);
|
||||||
if (childContentBEnd > aConfig.mColMaxBSize) {
|
if (childContentBEnd > aConfig.mColMaxBSize) {
|
||||||
|
|
@ -1052,8 +1053,8 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
||||||
nsOverflowAreas ocBounds;
|
nsOverflowAreas ocBounds;
|
||||||
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
||||||
if (GetPrevInFlow()) {
|
if (GetPrevInFlow()) {
|
||||||
ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0,
|
ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds,
|
||||||
ocStatus);
|
ReflowChildFlags::Default, ocStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------ Handle Incremental Reflow -----------------
|
//------------ Handle Incremental Reflow -----------------
|
||||||
|
|
|
||||||
|
|
@ -758,21 +758,21 @@ void nsContainerFrame::SetSizeConstraints(nsPresContext* aPresContext,
|
||||||
|
|
||||||
void
|
void
|
||||||
nsContainerFrame::SyncFrameViewAfterReflow(nsPresContext* aPresContext,
|
nsContainerFrame::SyncFrameViewAfterReflow(nsPresContext* aPresContext,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
nsView* aView,
|
nsView* aView,
|
||||||
const nsRect& aVisualOverflowArea,
|
const nsRect& aVisualOverflowArea,
|
||||||
uint32_t aFlags)
|
ReflowChildFlags aFlags)
|
||||||
{
|
{
|
||||||
if (!aView) {
|
if (!aView) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the view is sized and positioned correctly
|
// Make sure the view is sized and positioned correctly
|
||||||
if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
|
if (!(aFlags & ReflowChildFlags::NoMoveView)) {
|
||||||
PositionFrameView(aFrame);
|
PositionFrameView(aFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == (aFlags & NS_FRAME_NO_SIZE_VIEW)) {
|
if (!(aFlags & ReflowChildFlags::NoSizeView)) {
|
||||||
nsViewManager* vm = aView->GetViewManager();
|
nsViewManager* vm = aView->GetViewManager();
|
||||||
|
|
||||||
vm->ResizeView(aView, aVisualOverflowArea, true);
|
vm->ResizeView(aView, aVisualOverflowArea, true);
|
||||||
|
|
@ -784,7 +784,7 @@ nsContainerFrame::SyncFrameViewProperties(nsPresContext* aPresContext,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
nsStyleContext* aStyleContext,
|
nsStyleContext* aStyleContext,
|
||||||
nsView* aView,
|
nsView* aView,
|
||||||
uint32_t aFlags)
|
ReflowChildFlags aFlags)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(!aStyleContext || aFrame->StyleContext() == aStyleContext,
|
NS_ASSERTION(!aStyleContext || aFrame->StyleContext() == aStyleContext,
|
||||||
"Wrong style context for frame?");
|
"Wrong style context for frame?");
|
||||||
|
|
@ -800,7 +800,7 @@ nsContainerFrame::SyncFrameViewProperties(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure visibility is correct. This only affects nsSubdocumentFrame.
|
// Make sure visibility is correct. This only affects nsSubdocumentFrame.
|
||||||
if (0 == (aFlags & NS_FRAME_NO_VISIBILITY) &&
|
if (!(aFlags & ReflowChildFlags::NoVisibility) &&
|
||||||
!aFrame->SupportsVisibilityHidden()) {
|
!aFrame->SupportsVisibilityHidden()) {
|
||||||
// See if the view should be hidden or visible
|
// See if the view should be hidden or visible
|
||||||
vm->SetViewVisibility(aView,
|
vm->SetViewVisibility(aView,
|
||||||
|
|
@ -1035,7 +1035,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||||
const WritingMode& aWM,
|
const WritingMode& aWM,
|
||||||
const LogicalPoint& aPos,
|
const LogicalPoint& aPos,
|
||||||
const nsSize& aContainerSize,
|
const nsSize& aContainerSize,
|
||||||
uint32_t aFlags,
|
ReflowChildFlags aFlags,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
nsOverflowContinuationTracker* aTracker)
|
nsOverflowContinuationTracker* aTracker)
|
||||||
{
|
{
|
||||||
|
|
@ -1046,11 +1046,12 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Position the child frame and its view if requested.
|
// 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);
|
aKidFrame->SetPosition(aWM, aPos, aContainerSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
|
if (!(aFlags & ReflowChildFlags::NoMoveView)) {
|
||||||
PositionFrameView(aKidFrame);
|
PositionFrameView(aKidFrame);
|
||||||
PositionChildViews(aKidFrame);
|
PositionChildViews(aKidFrame);
|
||||||
}
|
}
|
||||||
|
|
@ -1059,10 +1060,9 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||||
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
|
|
||||||
// If the child frame is complete, delete any next-in-flows,
|
// 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_INLINE_IS_BREAK_BEFORE(aStatus) &&
|
if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) && NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
|
||||||
NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
|
!(aFlags & ReflowChildFlags::NoDeleteNextInFlowChild)) {
|
||||||
!(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) {
|
|
||||||
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
|
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
|
||||||
if (kidNextInFlow) {
|
if (kidNextInFlow) {
|
||||||
// Remove all of the childs next-in-flows. Make sure that we ask
|
// Remove all of the childs next-in-flows. Make sure that we ask
|
||||||
|
|
@ -1083,18 +1083,19 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
nscoord aX,
|
nscoord aX,
|
||||||
nscoord aY,
|
nscoord aY,
|
||||||
uint32_t aFlags,
|
ReflowChildFlags aFlags,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
nsOverflowContinuationTracker* aTracker)
|
nsOverflowContinuationTracker* aTracker)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(aReflowInput.mFrame == aKidFrame, "bad reflow state");
|
NS_PRECONDITION(aReflowInput.mFrame == aKidFrame, "bad reflow state");
|
||||||
|
|
||||||
// Position the child frame and its view if requested.
|
// 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));
|
aKidFrame->SetPosition(nsPoint(aX, aY));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
|
if (!(aFlags & ReflowChildFlags::NoMoveView)) {
|
||||||
PositionFrameView(aKidFrame);
|
PositionFrameView(aKidFrame);
|
||||||
PositionChildViews(aKidFrame);
|
PositionChildViews(aKidFrame);
|
||||||
}
|
}
|
||||||
|
|
@ -1103,9 +1104,9 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||||
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
|
|
||||||
// If the child frame is complete, delete any next-in-flows,
|
// 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) &&
|
if (NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
|
||||||
!(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) {
|
!(aFlags & ReflowChildFlags::NoDeleteNextInFlowChild)) {
|
||||||
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
|
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
|
||||||
if (kidNextInFlow) {
|
if (kidNextInFlow) {
|
||||||
// Remove all of the childs next-in-flows. Make sure that we ask
|
// Remove all of the childs next-in-flows. Make sure that we ask
|
||||||
|
|
@ -1164,11 +1165,11 @@ nsContainerFrame::PositionChildViews(nsIFrame* aFrame)
|
||||||
* - invoked the DidReflow() function
|
* - invoked the DidReflow() function
|
||||||
*
|
*
|
||||||
* Flags:
|
* Flags:
|
||||||
* NS_FRAME_NO_MOVE_FRAME - don't move the frame. aX and aY are ignored in this
|
* ReflowChildFlags::NoMoveFrame - don't move the frame. aX and aY are ignored
|
||||||
* case. Also implies NS_FRAME_NO_MOVE_VIEW
|
* in this case. Also implies ReflowChildFlags::NoMoveView
|
||||||
* NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
|
* ReflowChildFlags::NoMoveView - don't position the frame's view. Set this if
|
||||||
* don't want to automatically sync the frame and view
|
* you don't want to automatically sync the frame and view
|
||||||
* NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
|
* ReflowChildFlags::NoSizeView - don't size the frame's view
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
|
|
@ -1178,7 +1179,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
const WritingMode& aWM,
|
const WritingMode& aWM,
|
||||||
const LogicalPoint& aPos,
|
const LogicalPoint& aPos,
|
||||||
const nsSize& aContainerSize,
|
const nsSize& aContainerSize,
|
||||||
uint32_t aFlags)
|
nsIFrame::ReflowChildFlags aFlags)
|
||||||
{
|
{
|
||||||
if (aWM.IsVerticalRL() || (!aWM.IsVertical() && !aWM.IsBidiLTR())) {
|
if (aWM.IsVerticalRL() || (!aWM.IsVertical() && !aWM.IsBidiLTR())) {
|
||||||
NS_ASSERTION(aContainerSize.width != NS_UNCONSTRAINEDSIZE,
|
NS_ASSERTION(aContainerSize.width != NS_UNCONSTRAINEDSIZE,
|
||||||
|
|
@ -1187,10 +1188,11 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
|
|
||||||
nsPoint curOrigin = aKidFrame->GetPosition();
|
nsPoint curOrigin = aKidFrame->GetPosition();
|
||||||
WritingMode outerWM = aDesiredSize.GetWritingMode();
|
WritingMode outerWM = aDesiredSize.GetWritingMode();
|
||||||
LogicalSize convertedSize = aDesiredSize.Size(outerWM).ConvertTo(aWM,
|
LogicalSize convertedSize =
|
||||||
outerWM);
|
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),
|
aKidFrame->SetRect(aWM, LogicalRect(aWM, aPos, convertedSize),
|
||||||
aContainerSize);
|
aContainerSize);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1206,7 +1208,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
nsPoint newOrigin = aKidFrame->GetPosition();
|
nsPoint newOrigin = aKidFrame->GetPosition();
|
||||||
if (!(aFlags & NS_FRAME_NO_MOVE_VIEW) && curOrigin != newOrigin) {
|
if (!(aFlags & ReflowChildFlags::NoMoveView) && curOrigin != newOrigin) {
|
||||||
if (!aKidFrame->HasView()) {
|
if (!aKidFrame->HasView()) {
|
||||||
// If the frame has moved, then we need to make sure any child views are
|
// If the frame has moved, then we need to make sure any child views are
|
||||||
// correctly positioned
|
// correctly positioned
|
||||||
|
|
@ -1226,12 +1228,14 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
const ReflowInput* aReflowInput,
|
const ReflowInput* aReflowInput,
|
||||||
nscoord aX,
|
nscoord aX,
|
||||||
nscoord aY,
|
nscoord aY,
|
||||||
uint32_t aFlags)
|
ReflowChildFlags aFlags)
|
||||||
{
|
{
|
||||||
nsPoint curOrigin = aKidFrame->GetPosition();
|
nsPoint curOrigin = aKidFrame->GetPosition();
|
||||||
|
|
||||||
if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
|
if (ReflowChildFlags::NoMoveFrame !=
|
||||||
aKidFrame->SetRect(nsRect(aX, aY, aDesiredSize.Width(), aDesiredSize.Height()));
|
(aFlags & ReflowChildFlags::NoMoveFrame)) {
|
||||||
|
aKidFrame->SetRect(
|
||||||
|
nsRect(aX, aY, aDesiredSize.Width(), aDesiredSize.Height()));
|
||||||
} else {
|
} else {
|
||||||
aKidFrame->SetSize(nsSize(aDesiredSize.Width(), aDesiredSize.Height()));
|
aKidFrame->SetSize(nsSize(aDesiredSize.Width(), aDesiredSize.Height()));
|
||||||
}
|
}
|
||||||
|
|
@ -1244,7 +1248,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
aDesiredSize.VisualOverflow(), aFlags);
|
aDesiredSize.VisualOverflow(), aFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(aFlags & NS_FRAME_NO_MOVE_VIEW) &&
|
if (!(aFlags & ReflowChildFlags::NoMoveView) &&
|
||||||
(curOrigin.x != aX || curOrigin.y != aY)) {
|
(curOrigin.x != aX || curOrigin.y != aY)) {
|
||||||
if (!aKidFrame->HasView()) {
|
if (!aKidFrame->HasView()) {
|
||||||
// If the frame has moved, then we need to make sure any child views are
|
// If the frame has moved, then we need to make sure any child views are
|
||||||
|
|
@ -1256,11 +1260,12 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
aKidFrame->DidReflow(aPresContext, aReflowInput, nsDidReflowStatus::FINISHED);
|
aKidFrame->DidReflow(aPresContext, aReflowInput, nsDidReflowStatus::FINISHED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPresContext,
|
nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
nsOverflowAreas& aOverflowRects,
|
nsOverflowAreas& aOverflowRects,
|
||||||
uint32_t aFlags,
|
ReflowChildFlags aFlags,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
ChildFrameMerger aMergeFunc)
|
ChildFrameMerger aMergeFunc)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,16 +13,6 @@
|
||||||
#include "nsFrameList.h"
|
#include "nsFrameList.h"
|
||||||
#include "nsLayoutUtils.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;
|
class nsOverflowContinuationTracker;
|
||||||
|
|
||||||
// Some macros for container classes to do sanity checking on
|
// 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.
|
// Set the view's size and position after its frame has been reflowed.
|
||||||
//
|
//
|
||||||
// Flags:
|
// 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
|
// don't want to automatically sync the frame and view
|
||||||
// NS_FRAME_NO_SIZE_VIEW - don't size the view
|
// NoSizeView - don't size the view
|
||||||
static void SyncFrameViewAfterReflow(nsPresContext* aPresContext,
|
static void SyncFrameViewAfterReflow(nsPresContext* aPresContext,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
nsView* aView,
|
nsView* aView,
|
||||||
const nsRect& aVisualOverflowArea,
|
const nsRect& aVisualOverflowArea,
|
||||||
uint32_t aFlags = 0);
|
ReflowChildFlags aFlags = ReflowChildFlags::Default);
|
||||||
|
|
||||||
// Syncs properties to the top level view and window, like transparency and
|
// Syncs properties to the top level view and window, like transparency and
|
||||||
// shadow.
|
// shadow.
|
||||||
|
|
@ -205,7 +195,7 @@ public:
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
nsStyleContext* aStyleContext,
|
nsStyleContext* aStyleContext,
|
||||||
nsView* aView,
|
nsView* aView,
|
||||||
uint32_t aFlags = 0);
|
ReflowChildFlags aFlags = ReflowChildFlags::Default);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the minimum and maximum sizes given in inner window app units to
|
* Converts the minimum and maximum sizes given in inner window app units to
|
||||||
|
|
@ -222,7 +212,7 @@ public:
|
||||||
const nsSize& aMaxSize);
|
const nsSize& aMaxSize);
|
||||||
|
|
||||||
// Used by both nsInlineFrame and nsFirstLetterFrame.
|
// Used by both nsInlineFrame and nsFirstLetterFrame.
|
||||||
void DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext,
|
void DoInlineIntrinsicISize(nsRenderingContext* aRenderingContext,
|
||||||
InlineIntrinsicISizeData *aData,
|
InlineIntrinsicISizeData *aData,
|
||||||
nsLayoutUtils::IntrinsicISizeType aType);
|
nsLayoutUtils::IntrinsicISizeType aType);
|
||||||
|
|
||||||
|
|
@ -248,10 +238,10 @@ public:
|
||||||
* @param aContainerSize size of the border-box of the containing frame
|
* @param aContainerSize size of the border-box of the containing frame
|
||||||
*
|
*
|
||||||
* Flags:
|
* 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
|
* 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
|
* NoMoveFrame - don't move the frame. aPos is ignored in this
|
||||||
* case. Also implies NS_FRAME_NO_MOVE_VIEW
|
* case. Also implies NoMoveView
|
||||||
*/
|
*/
|
||||||
void ReflowChild(nsIFrame* aChildFrame,
|
void ReflowChild(nsIFrame* aChildFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
|
|
@ -260,7 +250,7 @@ public:
|
||||||
const mozilla::WritingMode& aWM,
|
const mozilla::WritingMode& aWM,
|
||||||
const mozilla::LogicalPoint& aPos,
|
const mozilla::LogicalPoint& aPos,
|
||||||
const nsSize& aContainerSize,
|
const nsSize& aContainerSize,
|
||||||
uint32_t aFlags,
|
ReflowChildFlags aFlags,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
nsOverflowContinuationTracker* aTracker = nullptr);
|
nsOverflowContinuationTracker* aTracker = nullptr);
|
||||||
|
|
||||||
|
|
@ -277,11 +267,11 @@ public:
|
||||||
* @param aContainerSize size of the border-box of the containing frame
|
* @param aContainerSize size of the border-box of the containing frame
|
||||||
*
|
*
|
||||||
* Flags:
|
* Flags:
|
||||||
* NS_FRAME_NO_MOVE_FRAME - don't move the frame. aPos is ignored in this
|
* NoMoveFrame - don't move the frame. aPos is ignored in this
|
||||||
* case. Also implies NS_FRAME_NO_MOVE_VIEW
|
* case. Also implies NoMoveView
|
||||||
* 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
|
* 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,
|
static void FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
|
|
@ -290,7 +280,8 @@ public:
|
||||||
const mozilla::WritingMode& aWM,
|
const mozilla::WritingMode& aWM,
|
||||||
const mozilla::LogicalPoint& aPos,
|
const mozilla::LogicalPoint& aPos,
|
||||||
const nsSize& aContainerSize,
|
const nsSize& aContainerSize,
|
||||||
uint32_t aFlags);
|
ReflowChildFlags aFlags);
|
||||||
|
|
||||||
|
|
||||||
//XXX temporary: hold on to a copy of the old physical versions of
|
//XXX temporary: hold on to a copy of the old physical versions of
|
||||||
// ReflowChild and FinishReflowChild so that we can convert callers
|
// ReflowChild and FinishReflowChild so that we can convert callers
|
||||||
|
|
@ -301,7 +292,7 @@ public:
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
nscoord aX,
|
nscoord aX,
|
||||||
nscoord aY,
|
nscoord aY,
|
||||||
uint32_t aFlags,
|
ReflowChildFlags aFlags,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
nsOverflowContinuationTracker* aTracker = nullptr);
|
nsOverflowContinuationTracker* aTracker = nullptr);
|
||||||
|
|
||||||
|
|
@ -311,7 +302,8 @@ public:
|
||||||
const ReflowInput* aReflowInput,
|
const ReflowInput* aReflowInput,
|
||||||
nscoord aX,
|
nscoord aX,
|
||||||
nscoord aY,
|
nscoord aY,
|
||||||
uint32_t aFlags);
|
ReflowChildFlags aFlags);
|
||||||
|
|
||||||
|
|
||||||
static void PositionChildViews(nsIFrame* aFrame);
|
static void PositionChildViews(nsIFrame* aFrame);
|
||||||
|
|
||||||
|
|
@ -391,11 +383,12 @@ public:
|
||||||
void ReflowOverflowContainerChildren(nsPresContext* aPresContext,
|
void ReflowOverflowContainerChildren(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
nsOverflowAreas& aOverflowRects,
|
nsOverflowAreas& aOverflowRects,
|
||||||
uint32_t aFlags,
|
ReflowChildFlags aFlags,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
ChildFrameMerger aMergeFunc =
|
ChildFrameMerger aMergeFunc =
|
||||||
DefaultChildFrameMerge);
|
DefaultChildFrameMerge);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move any frames on our overflow list to the end of our principal list.
|
* Move any frames on our overflow list to the end of our principal list.
|
||||||
* @return true if there were any overflow frames
|
* @return true if there were any overflow frames
|
||||||
|
|
|
||||||
|
|
@ -1856,7 +1856,7 @@ nsFlexContainerFrame::MeasureAscentAndHeightForFlexItem(
|
||||||
ReflowOutput childDesiredSize(aChildReflowInput);
|
ReflowOutput childDesiredSize(aChildReflowInput);
|
||||||
nsReflowStatus childReflowStatus;
|
nsReflowStatus childReflowStatus;
|
||||||
|
|
||||||
const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
|
const ReflowChildFlags flags = ReflowChildFlags::NoMoveFrame;
|
||||||
ReflowChild(aItem.Frame(), aPresContext,
|
ReflowChild(aItem.Frame(), aPresContext,
|
||||||
childDesiredSize, aChildReflowInput,
|
childDesiredSize, aChildReflowInput,
|
||||||
0, 0, flags, childReflowStatus);
|
0, 0, flags, childReflowStatus);
|
||||||
|
|
@ -4856,7 +4856,8 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
||||||
ReflowChild(aItem.Frame(), aPresContext,
|
ReflowChild(aItem.Frame(), aPresContext,
|
||||||
childDesiredSize, childReflowInput,
|
childDesiredSize, childReflowInput,
|
||||||
outerWM, aFramePos, aContainerSize,
|
outerWM, aFramePos, aContainerSize,
|
||||||
0, childReflowStatus);
|
ReflowChildFlags::Default,
|
||||||
|
childReflowStatus);
|
||||||
|
|
||||||
// XXXdholbert Once we do pagination / splitting, we'll need to actually
|
// XXXdholbert Once we do pagination / splitting, we'll need to actually
|
||||||
// handle incomplete childReflowStatuses. But for now, we give our kids
|
// handle incomplete childReflowStatuses. But for now, we give our kids
|
||||||
|
|
@ -4872,9 +4873,9 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
||||||
offsets, &aFramePos,
|
offsets, &aFramePos,
|
||||||
aContainerSize);
|
aContainerSize);
|
||||||
|
|
||||||
FinishReflowChild(aItem.Frame(), aPresContext,
|
FinishReflowChild(aItem.Frame(), aPresContext, childDesiredSize,
|
||||||
childDesiredSize, &childReflowInput,
|
&childReflowInput, outerWM, aFramePos, aContainerSize,
|
||||||
outerWM, aFramePos, aContainerSize, 0);
|
ReflowChildFlags::Default);
|
||||||
|
|
||||||
aItem.SetAscent(childDesiredSize.BlockStartAscent());
|
aItem.SetAscent(childDesiredSize.BlockStartAscent());
|
||||||
}
|
}
|
||||||
|
|
@ -4899,14 +4900,13 @@ nsFlexContainerFrame::ReflowPlaceholders(nsPresContext* aPresContext,
|
||||||
placeholder, availSize);
|
placeholder, availSize);
|
||||||
ReflowOutput childDesiredSize(childReflowInput);
|
ReflowOutput childDesiredSize(childReflowInput);
|
||||||
nsReflowStatus childReflowStatus;
|
nsReflowStatus childReflowStatus;
|
||||||
ReflowChild(placeholder, aPresContext,
|
ReflowChild(placeholder, aPresContext, childDesiredSize, childReflowInput,
|
||||||
childDesiredSize, childReflowInput,
|
outerWM, aContentBoxOrigin, aContainerSize,
|
||||||
outerWM, aContentBoxOrigin, aContainerSize, 0,
|
ReflowChildFlags::Default, childReflowStatus);
|
||||||
childReflowStatus);
|
|
||||||
|
|
||||||
FinishReflowChild(placeholder, aPresContext,
|
FinishReflowChild(placeholder, aPresContext, childDesiredSize,
|
||||||
childDesiredSize, &childReflowInput,
|
&childReflowInput, outerWM, aContentBoxOrigin,
|
||||||
outerWM, aContentBoxOrigin, aContainerSize, 0);
|
aContainerSize, ReflowChildFlags::Default);
|
||||||
|
|
||||||
// Mark the placeholder frame to indicate that it's not actually at the
|
// 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
|
// element's static position, because we need to apply CSS Alignment after
|
||||||
|
|
|
||||||
|
|
@ -6583,9 +6583,9 @@ nsIFrame::UpdateOverflow()
|
||||||
if (FinishAndStoreOverflow(overflowAreas, GetSize())) {
|
if (FinishAndStoreOverflow(overflowAreas, GetSize())) {
|
||||||
nsView* view = GetView();
|
nsView* view = GetView();
|
||||||
if (view) {
|
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.
|
// Make sure the frame's view is properly sized.
|
||||||
nsViewManager* vm = view->GetViewManager();
|
nsViewManager* vm = view->GetViewManager();
|
||||||
vm->ResizeView(view, overflowAreas.VisualOverflow(), true);
|
vm->ResizeView(view, overflowAreas.VisualOverflow(), true);
|
||||||
|
|
@ -9820,9 +9820,10 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
||||||
|
|
||||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
|
||||||
|
|
||||||
uint32_t layoutFlags = aState.LayoutFlags();
|
ReflowChildFlags layoutFlags = aState.LayoutFlags();
|
||||||
nsContainerFrame::FinishReflowChild(this, aPresContext, aDesiredSize,
|
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)
|
// Save the ascent. (bug 103925)
|
||||||
if (IsXULCollapsed()) {
|
if (IsXULCollapsed()) {
|
||||||
|
|
|
||||||
|
|
@ -699,13 +699,14 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
||||||
nsReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
ReflowChild(aChild, aPresContext, reflowOutput, reflowInput, aOffset.x,
|
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");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
|
||||||
|
|
||||||
// Place and size the child
|
// Place and size the child
|
||||||
reflowOutput.Width() = aSize.width;
|
reflowOutput.Width() = aSize.width;
|
||||||
reflowOutput.Height() = aSize.height;
|
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
|
static
|
||||||
|
|
|
||||||
|
|
@ -571,11 +571,11 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
|
||||||
nsReflowStatus status;
|
nsReflowStatus status;
|
||||||
// No need to pass a true container-size to ReflowChild or
|
// No need to pass a true container-size to ReflowChild or
|
||||||
// FinishReflowChild, because it's only used there when positioning
|
// 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;
|
const nsSize dummyContainerSize;
|
||||||
ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics,
|
ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics, kidReflowInput,
|
||||||
kidReflowInput, wm, LogicalPoint(wm), dummyContainerSize,
|
wm, LogicalPoint(wm), dummyContainerSize,
|
||||||
NS_FRAME_NO_MOVE_FRAME, status);
|
ReflowChildFlags::NoMoveFrame, status);
|
||||||
|
|
||||||
mHelper.mHasHorizontalScrollbar = didHaveHorizontalScrollbar;
|
mHelper.mHasHorizontalScrollbar = didHaveHorizontalScrollbar;
|
||||||
mHelper.mHasVerticalScrollbar = didHaveVerticalScrollbar;
|
mHelper.mHasVerticalScrollbar = didHaveVerticalScrollbar;
|
||||||
|
|
@ -588,7 +588,7 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
|
||||||
FinishReflowChild(mHelper.mScrolledFrame, presContext,
|
FinishReflowChild(mHelper.mScrolledFrame, presContext,
|
||||||
*aMetrics, &kidReflowInput, wm, LogicalPoint(wm),
|
*aMetrics, &kidReflowInput, wm, LogicalPoint(wm),
|
||||||
dummyContainerSize,
|
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
|
// XXX Some frames (e.g., nsPluginFrame, nsFrameFrame, nsTextFrame) don't bother
|
||||||
// setting their mOverflowArea. This is wrong because every frame should
|
// setting their mOverflowArea. This is wrong because every frame should
|
||||||
|
|
@ -801,7 +801,7 @@ nsHTMLScrollFrame::PlaceScrollArea(ScrollReflowInput& aState,
|
||||||
scrolledFrame,
|
scrolledFrame,
|
||||||
scrolledFrame->GetView(),
|
scrolledFrame->GetView(),
|
||||||
scrolledArea,
|
scrolledArea,
|
||||||
0);
|
ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
|
|
@ -1664,7 +1664,7 @@ nsXULScrollFrame::GetFrameName(nsAString& aResult) const
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXULScrollFrame::DoXULLayout(nsBoxLayoutState& aState)
|
nsXULScrollFrame::DoXULLayout(nsBoxLayoutState& aState)
|
||||||
{
|
{
|
||||||
uint32_t flags = aState.LayoutFlags();
|
ReflowChildFlags flags = aState.LayoutFlags();
|
||||||
nsresult rv = XULLayout(aState);
|
nsresult rv = XULLayout(aState);
|
||||||
aState.SetLayoutFlags(flags);
|
aState.SetLayoutFlags(flags);
|
||||||
|
|
||||||
|
|
@ -4956,14 +4956,12 @@ nsXULScrollFrame::AddRemoveScrollbar(bool& aHasScrollbar, nscoord& aXY,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void nsXULScrollFrame::LayoutScrollArea(nsBoxLayoutState& aState,
|
||||||
nsXULScrollFrame::LayoutScrollArea(nsBoxLayoutState& aState,
|
const nsPoint& aScrollPosition) {
|
||||||
const nsPoint& aScrollPosition)
|
ReflowChildFlags oldflags = aState.LayoutFlags();
|
||||||
{
|
|
||||||
uint32_t oldflags = aState.LayoutFlags();
|
|
||||||
nsRect childRect = nsRect(mHelper.mScrollPort.TopLeft() - aScrollPosition,
|
nsRect childRect = nsRect(mHelper.mScrollPort.TopLeft() - aScrollPosition,
|
||||||
mHelper.mScrollPort.Size());
|
mHelper.mScrollPort.Size());
|
||||||
int32_t flags = NS_FRAME_NO_MOVE_VIEW;
|
ReflowChildFlags flags = ReflowChildFlags::NoMoveView;
|
||||||
|
|
||||||
nsSize minSize = mHelper.mScrolledFrame->GetXULMinSize(aState);
|
nsSize minSize = mHelper.mScrolledFrame->GetXULMinSize(aState);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3789,7 +3789,10 @@ MeasuringReflow(nsIFrame* aChild,
|
||||||
ReflowInput childRI(pc, *rs, aChild, aAvailableSize, &aCBSize, riFlags);
|
ReflowInput childRI(pc, *rs, aChild, aAvailableSize, &aCBSize, riFlags);
|
||||||
ReflowOutput childSize(childRI);
|
ReflowOutput childSize(childRI);
|
||||||
nsReflowStatus childStatus;
|
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,
|
parent->ReflowChild(aChild, pc, childSize, childRI, wm,
|
||||||
LogicalPoint(wm), nsSize(), flags, childStatus);
|
LogicalPoint(wm), nsSize(), flags, childStatus);
|
||||||
parent->FinishReflowChild(aChild, pc, childSize, &childRI, wm,
|
parent->FinishReflowChild(aChild, pc, childSize, &childRI, wm,
|
||||||
|
|
@ -5341,7 +5344,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
|
||||||
ReflowOutput childSize(childRI);
|
ReflowOutput childSize(childRI);
|
||||||
const nsSize dummyContainerSize;
|
const nsSize dummyContainerSize;
|
||||||
ReflowChild(aChild, pc, childSize, childRI, childWM, LogicalPoint(childWM),
|
ReflowChild(aChild, pc, childSize, childRI, childWM, LogicalPoint(childWM),
|
||||||
dummyContainerSize, 0, aStatus);
|
dummyContainerSize, ReflowChildFlags::Default, aStatus);
|
||||||
LogicalPoint childPos =
|
LogicalPoint childPos =
|
||||||
cb.Origin(wm).ConvertTo(childWM, wm,
|
cb.Origin(wm).ConvertTo(childWM, wm,
|
||||||
aContainerSize - childSize.PhysicalSize());
|
aContainerSize - childSize.PhysicalSize());
|
||||||
|
|
@ -5370,7 +5373,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
|
||||||
|
|
||||||
childRI.ApplyRelativePositioning(&childPos, aContainerSize);
|
childRI.ApplyRelativePositioning(&childPos, aContainerSize);
|
||||||
FinishReflowChild(aChild, pc, childSize, &childRI, childWM, childPos,
|
FinishReflowChild(aChild, pc, childSize, &childRI, childWM, childPos,
|
||||||
aContainerSize, 0);
|
aContainerSize, ReflowChildFlags::Default);
|
||||||
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, aChild);
|
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, aChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5884,14 +5887,15 @@ nsGridContainerFrame::ReflowChildren(GridReflowInput& aState,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aState.mReflowInput);
|
MOZ_ASSERT(aState.mReflowInput);
|
||||||
|
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsOverflowAreas ocBounds;
|
nsOverflowAreas ocBounds;
|
||||||
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
||||||
if (GetPrevInFlow()) {
|
if (GetPrevInFlow()) {
|
||||||
ReflowOverflowContainerChildren(PresContext(), *aState.mReflowInput,
|
ReflowOverflowContainerChildren(PresContext(), *aState.mReflowInput,
|
||||||
ocBounds, 0, ocStatus,
|
ocBounds, ReflowChildFlags::Default,
|
||||||
MergeSortedFrameListsFor);
|
ocStatus, MergeSortedFrameListsFor);
|
||||||
}
|
}
|
||||||
|
|
||||||
WritingMode wm = aState.mReflowInput->GetWritingMode();
|
WritingMode wm = aState.mReflowInput->GetWritingMode();
|
||||||
|
|
|
||||||
|
|
@ -281,10 +281,10 @@ nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput childDesiredSize(aReflowInput.GetWritingMode(), aMetrics.mFlags);
|
ReflowOutput childDesiredSize(aReflowInput.GetWritingMode(), aMetrics.mFlags);
|
||||||
ReflowInput childReflowInput(aPresContext, aReflowInput, childFrame,
|
ReflowInput childReflowInput(aPresContext, aReflowInput, childFrame,
|
||||||
availSize);
|
availSize);
|
||||||
ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowInput,
|
ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowInput, 0,
|
||||||
0, 0, 0, childStatus, nullptr);
|
0, ReflowChildFlags::Default, childStatus, nullptr);
|
||||||
FinishReflowChild(childFrame, aPresContext, childDesiredSize,
|
FinishReflowChild(childFrame, aPresContext, childDesiredSize,
|
||||||
&childReflowInput, 0, 0, 0);
|
&childReflowInput, 0, 0, ReflowChildFlags::Default);
|
||||||
|
|
||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("exit nsHTMLCanvasFrame::Reflow: size=%d,%d",
|
("exit nsHTMLCanvasFrame::Reflow: size=%d,%d",
|
||||||
|
|
|
||||||
|
|
@ -2239,6 +2239,19 @@ public:
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) = 0;
|
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
|
* 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
|
* 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; }
|
virtual nsBoxLayout* GetXULLayoutManager() { return nullptr; }
|
||||||
nsresult GetXULClientRect(nsRect& aContentRect);
|
nsresult GetXULClientRect(nsRect& aContentRect);
|
||||||
|
|
||||||
virtual uint32_t GetXULLayoutFlags()
|
virtual ReflowChildFlags GetXULLayoutFlags() {
|
||||||
{ return 0; }
|
return ReflowChildFlags::Default;
|
||||||
|
}
|
||||||
|
|
||||||
// For nsSprocketLayout
|
// For nsSprocketLayout
|
||||||
virtual Valignment GetXULVAlign() const = 0;
|
virtual Valignment GetXULVAlign() const = 0;
|
||||||
|
|
@ -3776,6 +3790,8 @@ public:
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(nsIFrame::ReflowChildFlags)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3331,7 +3331,7 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflo
|
||||||
if (frame->HasView())
|
if (frame->HasView())
|
||||||
nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, frame,
|
nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, frame,
|
||||||
frame->GetView(), pfd->mOverflowAreas.VisualOverflow(),
|
frame->GetView(), pfd->mOverflowAreas.VisualOverflow(),
|
||||||
NS_FRAME_NO_SIZE_VIEW);
|
nsIFrame::ReflowChildFlags::NoSizeView);
|
||||||
|
|
||||||
// Note: the combined area of a child is in its coordinate
|
// Note: the combined area of a child is in its coordinate
|
||||||
// system. We adjust the childs combined area into our 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,
|
nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, frame,
|
||||||
frame->GetView(),
|
frame->GetView(),
|
||||||
r.VisualOverflow(),
|
r.VisualOverflow(),
|
||||||
NS_FRAME_NO_MOVE_VIEW);
|
nsIFrame::ReflowChildFlags::NoMoveView);
|
||||||
|
|
||||||
overflowAreas.UnionWith(r + frame->GetPosition());
|
overflowAreas.UnionWith(r + frame->GetPosition());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,12 +58,13 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
||||||
kidReflowInput.SetComputedBSize(logicalSize.BSize(wm));
|
kidReflowInput.SetComputedBSize(logicalSize.BSize(wm));
|
||||||
|
|
||||||
// Reflow the page content area
|
// 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
|
// The document element's background should cover the entire canvas, so
|
||||||
// take into account the combined area and any space taken up by
|
// take into account the combined area and any space taken up by
|
||||||
// absolutely positioned elements
|
// 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
|
// XXXbz this screws up percentage padding (sets padding to zero
|
||||||
// in the percentage padding case)
|
// in the percentage padding case)
|
||||||
|
|
@ -87,10 +88,12 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Place and size the child
|
// 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) ||
|
NS_ASSERTION(aPresContext->IsDynamic() || !aStatus.IsFullyComplete() ||
|
||||||
!frame->GetNextInFlow(), "bad child flow list");
|
!frame->GetNextInFlow(),
|
||||||
|
"bad child flow list");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reflow our fixed frames
|
// Reflow our fixed frames
|
||||||
|
|
|
||||||
|
|
@ -141,13 +141,15 @@ nsPageFrame::Reflow(nsPresContext* aPresContext,
|
||||||
nscoord yc = mPageContentMargin.top;
|
nscoord yc = mPageContentMargin.top;
|
||||||
|
|
||||||
// Get the child's desired size
|
// 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
|
// 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) ||
|
NS_ASSERTION(!aStatus.IsFullyComplete() || !frame->GetNextInFlow(),
|
||||||
!frame->GetNextInFlow(), "bad child flow list");
|
"bad child flow list");
|
||||||
}
|
}
|
||||||
PR_PL(("PageFrame::Reflow %p ", this));
|
PR_PL(("PageFrame::Reflow %p ", this));
|
||||||
PR_PL(("[%d,%d][%d,%d]\n", aDesiredSize.Width(), aDesiredSize.Height(),
|
PR_PL(("[%d,%d][%d,%d]\n", aDesiredSize.Width(), aDesiredSize.Height(),
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,8 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
||||||
// correct. We will fix it in nsLineLayout after the whole line is
|
// correct. We will fix it in nsLineLayout after the whole line is
|
||||||
// reflowed.
|
// reflowed.
|
||||||
FinishReflowChild(textContainer, aPresContext, textMetrics,
|
FinishReflowChild(textContainer, aPresContext, textMetrics,
|
||||||
&textReflowInput, lineWM, position, dummyContainerSize, 0);
|
&textReflowInput, lineWM, position, dummyContainerSize,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(baseRect.ISize(lineWM) == offsetRect.ISize(lineWM),
|
MOZ_ASSERT(baseRect.ISize(lineWM) == offsetRect.ISize(lineWM),
|
||||||
"Annotations should only be placed on the block directions");
|
"Annotations should only be placed on the block directions");
|
||||||
|
|
|
||||||
|
|
@ -255,13 +255,15 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
||||||
nscoord x = pageCSSMargin.left;
|
nscoord x = pageCSSMargin.left;
|
||||||
|
|
||||||
// Place and size the page.
|
// 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:
|
// If the page is narrower than our width, then center it horizontally:
|
||||||
x += ComputeCenteringMargin(aReflowInput.ComputedWidth(),
|
x += ComputeCenteringMargin(aReflowInput.ComputedWidth(),
|
||||||
kidSize.Width(), pageCSSMargin);
|
kidSize.Width(), pageCSSMargin);
|
||||||
|
|
||||||
FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, x, y, 0);
|
FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, x, y,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
y += kidSize.Height();
|
y += kidSize.Height();
|
||||||
y += pageCSSMargin.bottom;
|
y += pageCSSMargin.bottom;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -308,6 +308,9 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
|
||||||
// Reflow the child frames. We may have up to two, an image frame
|
// 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.
|
// which is the poster, and a box frame, which is the video controls.
|
||||||
for (nsIFrame* child : mFrames) {
|
for (nsIFrame* child : mFrames) {
|
||||||
|
nsSize oldChildSize = child->GetSize();
|
||||||
|
nsReflowStatus childStatus;
|
||||||
|
|
||||||
if (child->GetContent() == mPosterImage) {
|
if (child->GetContent() == mPosterImage) {
|
||||||
// Reflow the poster frame.
|
// Reflow the poster frame.
|
||||||
nsImageFrame* imageFrame = static_cast<nsImageFrame*>(child);
|
nsImageFrame* imageFrame = static_cast<nsImageFrame*>(child);
|
||||||
|
|
@ -332,10 +335,15 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
|
||||||
kidReflowInput.SetComputedWidth(posterRenderRect.width);
|
kidReflowInput.SetComputedWidth(posterRenderRect.width);
|
||||||
kidReflowInput.SetComputedHeight(posterRenderRect.height);
|
kidReflowInput.SetComputedHeight(posterRenderRect.height);
|
||||||
ReflowChild(imageFrame, aPresContext, kidDesiredSize, kidReflowInput,
|
ReflowChild(imageFrame, aPresContext, kidDesiredSize, kidReflowInput,
|
||||||
posterRenderRect.x, posterRenderRect.y, 0, aStatus);
|
posterRenderRect.x, posterRenderRect.y,
|
||||||
FinishReflowChild(imageFrame, aPresContext,
|
ReflowChildFlags::Default, childStatus);
|
||||||
kidDesiredSize, &kidReflowInput,
|
MOZ_ASSERT(childStatus.IsFullyComplete(),
|
||||||
posterRenderRect.x, posterRenderRect.y, 0);
|
"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) {
|
} else if (child->GetContent() == mVideoControls) {
|
||||||
// Reflow the video controls frame.
|
// Reflow the video controls frame.
|
||||||
nsBoxLayoutState boxState(PresContext(), aReflowInput.mRenderingContext);
|
nsBoxLayoutState boxState(PresContext(), aReflowInput.mRenderingContext);
|
||||||
|
|
@ -370,10 +378,16 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
|
||||||
kidReflowInput.SetComputedHeight(std::max(size.height, 0));
|
kidReflowInput.SetComputedHeight(std::max(size.height, 0));
|
||||||
|
|
||||||
ReflowChild(child, aPresContext, kidDesiredSize, kidReflowInput,
|
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,
|
FinishReflowChild(child, aPresContext,
|
||||||
kidDesiredSize, &kidReflowInput,
|
kidDesiredSize, &kidReflowInput,
|
||||||
mBorderPadding.left, mBorderPadding.top, 0);
|
mBorderPadding.left, mBorderPadding.top,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aMetrics.SetOverflowAreasToDesiredBounds();
|
aMetrics.SetOverflowAreasToDesiredBounds();
|
||||||
|
|
|
||||||
|
|
@ -315,11 +315,12 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
|
||||||
|
|
||||||
// Reflow the frame
|
// Reflow the frame
|
||||||
kidReflowInput.SetComputedBSize(aReflowInput.ComputedBSize());
|
kidReflowInput.SetComputedBSize(aReflowInput.ComputedBSize());
|
||||||
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput,
|
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput, 0, 0,
|
||||||
0, 0, 0, aStatus);
|
ReflowChildFlags::Default, aStatus);
|
||||||
kidBSize = kidDesiredSize.BSize(wm);
|
kidBSize = kidDesiredSize.BSize(wm);
|
||||||
|
|
||||||
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, nullptr, 0, 0, 0);
|
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, nullptr, 0, 0,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
} else {
|
} else {
|
||||||
kidBSize = LogicalSize(wm, mFrames.FirstChild()->GetSize()).BSize(wm);
|
kidBSize = LogicalSize(wm, mFrames.FirstChild()->GetSize()).BSize(wm);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -835,9 +835,9 @@ nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame,
|
||||||
NS_ASSERTION(!inlineFrame, "Inline frames should be wrapped in blocks");
|
NS_ASSERTION(!inlineFrame, "Inline frames should be wrapped in blocks");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsContainerFrame::
|
nsContainerFrame::ReflowChild(aChildFrame, aPresContext, aDesiredSize,
|
||||||
ReflowChild(aChildFrame, aPresContext, aDesiredSize, aReflowInput,
|
aReflowInput, 0, 0,
|
||||||
0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
|
ReflowChildFlags::NoMoveFrame, aStatus);
|
||||||
|
|
||||||
if (aDesiredSize.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
|
if (aDesiredSize.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
|
||||||
// This will be suitable for inline frames, which are wrapped in a block.
|
// This will be suitable for inline frames, which are wrapped in a block.
|
||||||
|
|
@ -1311,7 +1311,7 @@ nsMathMLContainerFrame::PositionRowChildFrames(nscoord aOffsetX,
|
||||||
nscoord dx = aOffsetX + child.X();
|
nscoord dx = aOffsetX + child.X();
|
||||||
nscoord dy = aBaseline - child.Ascent();
|
nscoord dy = aBaseline - child.Ascent();
|
||||||
FinishReflowChild(child.Frame(), PresContext(), child.GetReflowOutput(),
|
FinishReflowChild(child.Frame(), PresContext(), child.GetReflowOutput(),
|
||||||
nullptr, dx, dy, 0);
|
nullptr, dx, dy, ReflowChildFlags::Default);
|
||||||
++child;
|
++child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,8 @@ nsMathMLSelectedFrame::Place(DrawTarget* aDrawTarget,
|
||||||
if (childFrame) {
|
if (childFrame) {
|
||||||
GetReflowAndBoundingMetricsFor(childFrame, aDesiredSize, mBoundingMetrics);
|
GetReflowAndBoundingMetricsFor(childFrame, aDesiredSize, mBoundingMetrics);
|
||||||
if (aPlaceOrigin) {
|
if (aPlaceOrigin) {
|
||||||
FinishReflowChild(childFrame, PresContext(), aDesiredSize, nullptr, 0, 0, 0);
|
FinishReflowChild(childFrame, PresContext(), aDesiredSize, nullptr, 0, 0,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
mReference.x = 0;
|
mReference.x = 0;
|
||||||
mReference.y = aDesiredSize.BlockStartAscent();
|
mReference.y = aDesiredSize.BlockStartAscent();
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,8 @@ nsMathMLTokenFrame::Place(DrawTarget* aDrawTarget,
|
||||||
|
|
||||||
// place and size the child; (dx,0) makes the caret happy - bug 188146
|
// place and size the child; (dx,0) makes the caret happy - bug 188146
|
||||||
dy = childSize.Height() == 0 ? 0 : aDesiredSize.BlockStartAscent() - childSize.BlockStartAscent();
|
dy = childSize.Height() == 0 ? 0 : aDesiredSize.BlockStartAscent() - childSize.BlockStartAscent();
|
||||||
FinishReflowChild(childFrame, PresContext(), childSize, nullptr, dx, dy, 0);
|
FinishReflowChild(childFrame, PresContext(), childSize, nullptr, dx, dy,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
dx += childSize.Width();
|
dx += childSize.Width();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -403,8 +403,9 @@ nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext,
|
||||||
else
|
else
|
||||||
aDesiredSize.mBoundingMetrics += bm;
|
aDesiredSize.mBoundingMetrics += bm;
|
||||||
|
|
||||||
FinishReflowChild(childFrame, aPresContext, childSize, nullptr,
|
FinishReflowChild(childFrame, aPresContext, childSize, nullptr, dx,
|
||||||
dx, ascent - childSize.BlockStartAscent(), 0);
|
ascent - childSize.BlockStartAscent(),
|
||||||
|
ReflowChildFlags::Default);
|
||||||
dx += childSize.Width();
|
dx += childSize.Width();
|
||||||
|
|
||||||
if (i < mSeparatorsCount) {
|
if (i < mSeparatorsCount) {
|
||||||
|
|
|
||||||
|
|
@ -451,10 +451,12 @@ nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget,
|
||||||
nscoord dy;
|
nscoord dy;
|
||||||
// place numerator
|
// place numerator
|
||||||
dy = 0;
|
dy = 0;
|
||||||
FinishReflowChild(frameNum, presContext, sizeNum, nullptr, dxNum, dy, 0);
|
FinishReflowChild(frameNum, presContext, sizeNum, nullptr, dxNum, dy,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
// place denominator
|
// place denominator
|
||||||
dy = aDesiredSize.Height() - sizeDen.Height();
|
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
|
// place the fraction bar - dy is top of bar
|
||||||
dy = aDesiredSize.BlockStartAscent() - (axisHeight + actualRuleThickness/2);
|
dy = aDesiredSize.BlockStartAscent() - (axisHeight + actualRuleThickness/2);
|
||||||
mLineRect.SetRect(leftSpace, dy, width - (leftSpace + rightSpace),
|
mLineRect.SetRect(leftSpace, dy, width - (leftSpace + rightSpace),
|
||||||
|
|
@ -571,7 +573,8 @@ nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget,
|
||||||
dx = MirrorIfRTL(aDesiredSize.Width(), sizeNum.Width(),
|
dx = MirrorIfRTL(aDesiredSize.Width(), sizeNum.Width(),
|
||||||
leadingSpace);
|
leadingSpace);
|
||||||
dy = aDesiredSize.BlockStartAscent() - numShift - sizeNum.BlockStartAscent();
|
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
|
// place the fraction bar
|
||||||
dx = MirrorIfRTL(aDesiredSize.Width(), mLineRect.width,
|
dx = MirrorIfRTL(aDesiredSize.Width(), mLineRect.width,
|
||||||
|
|
@ -584,7 +587,8 @@ nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget,
|
||||||
dx = MirrorIfRTL(aDesiredSize.Width(), sizeDen.Width(),
|
dx = MirrorIfRTL(aDesiredSize.Width(), sizeDen.Width(),
|
||||||
leadingSpace + bmNum.width + mLineRect.width);
|
leadingSpace + bmNum.width + mLineRect.width);
|
||||||
dy = aDesiredSize.BlockStartAscent() + denShift - sizeDen.BlockStartAscent();
|
dy = aDesiredSize.BlockStartAscent() + denShift - sizeDen.BlockStartAscent();
|
||||||
FinishReflowChild(frameDen, presContext, sizeDen, nullptr, dx, dy, 0);
|
FinishReflowChild(frameDen, presContext, sizeDen, nullptr, dx, dy,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -632,11 +632,11 @@ nsMathMLmmultiscriptsFrame::PlaceMultiScript(nsPresContext* aPresContext,
|
||||||
// place the base ...
|
// place the base ...
|
||||||
childFrame = baseFrame;
|
childFrame = baseFrame;
|
||||||
dy = aDesiredSize.BlockStartAscent() - baseSize.BlockStartAscent();
|
dy = aDesiredSize.BlockStartAscent() - baseSize.BlockStartAscent();
|
||||||
FinishReflowChild (baseFrame, aPresContext, baseSize, nullptr,
|
FinishReflowChild(baseFrame, aPresContext, baseSize, nullptr,
|
||||||
aFrame->MirrorIfRTL(aDesiredSize.Width(),
|
aFrame->MirrorIfRTL(aDesiredSize.Width(),
|
||||||
baseSize.Width(),
|
baseSize.Width(),
|
||||||
dx),
|
dx),
|
||||||
dy, 0);
|
dy, ReflowChildFlags::Default);
|
||||||
dx += bmBase.width;
|
dx += bmBase.width;
|
||||||
} else if (prescriptsFrame == childFrame) {
|
} else if (prescriptsFrame == childFrame) {
|
||||||
// Clear reflow flags of prescripts frame.
|
// Clear reflow flags of prescripts frame.
|
||||||
|
|
@ -668,12 +668,12 @@ nsMathMLmmultiscriptsFrame::PlaceMultiScript(nsPresContext* aPresContext,
|
||||||
x += width - subScriptSize.Width();
|
x += width - subScriptSize.Width();
|
||||||
dy = aDesiredSize.BlockStartAscent() - subScriptSize.BlockStartAscent() +
|
dy = aDesiredSize.BlockStartAscent() - subScriptSize.BlockStartAscent() +
|
||||||
maxSubScriptShift;
|
maxSubScriptShift;
|
||||||
FinishReflowChild (subScriptFrame, aPresContext, subScriptSize,
|
FinishReflowChild(subScriptFrame, aPresContext, subScriptSize,
|
||||||
nullptr,
|
nullptr,
|
||||||
aFrame->MirrorIfRTL(aDesiredSize.Width(),
|
aFrame->MirrorIfRTL(aDesiredSize.Width(),
|
||||||
subScriptSize.Width(),
|
subScriptSize.Width(),
|
||||||
x),
|
x),
|
||||||
dy, 0);
|
dy, ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (supScriptFrame) {
|
if (supScriptFrame) {
|
||||||
|
|
@ -686,12 +686,12 @@ nsMathMLmmultiscriptsFrame::PlaceMultiScript(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
dy = aDesiredSize.BlockStartAscent() - supScriptSize.BlockStartAscent() -
|
dy = aDesiredSize.BlockStartAscent() - supScriptSize.BlockStartAscent() -
|
||||||
maxSupScriptShift;
|
maxSupScriptShift;
|
||||||
FinishReflowChild (supScriptFrame, aPresContext, supScriptSize,
|
FinishReflowChild(supScriptFrame, aPresContext, supScriptSize,
|
||||||
nullptr,
|
nullptr,
|
||||||
aFrame->MirrorIfRTL(aDesiredSize.Width(),
|
aFrame->MirrorIfRTL(aDesiredSize.Width(),
|
||||||
supScriptSize.Width(),
|
supScriptSize.Width(),
|
||||||
x),
|
x),
|
||||||
dy, 0);
|
dy, ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
dx += width + scriptSpace;
|
dx += width + scriptSpace;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -333,7 +333,7 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
|
||||||
(indexRaisedAscent + indexSize.BlockStartAscent() - bmIndex.ascent);
|
(indexRaisedAscent + indexSize.BlockStartAscent() - bmIndex.ascent);
|
||||||
FinishReflowChild(indexFrame, aPresContext, indexSize, nullptr,
|
FinishReflowChild(indexFrame, aPresContext, indexSize, nullptr,
|
||||||
MirrorIfRTL(aDesiredSize.Width(), indexSize.Width(), dx),
|
MirrorIfRTL(aDesiredSize.Width(), indexSize.Width(), dx),
|
||||||
dy, 0);
|
dy, ReflowChildFlags::Default);
|
||||||
|
|
||||||
// place the radical symbol and the radical bar
|
// place the radical symbol and the radical bar
|
||||||
dx = dxSqr;
|
dx = dxSqr;
|
||||||
|
|
@ -347,8 +347,8 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
|
||||||
// place the base
|
// place the base
|
||||||
dy = aDesiredSize.BlockStartAscent() - baseSize.BlockStartAscent();
|
dy = aDesiredSize.BlockStartAscent() - baseSize.BlockStartAscent();
|
||||||
FinishReflowChild(baseFrame, aPresContext, baseSize, nullptr,
|
FinishReflowChild(baseFrame, aPresContext, baseSize, nullptr,
|
||||||
MirrorIfRTL(aDesiredSize.Width(), baseSize.Width(), dx),
|
MirrorIfRTL(aDesiredSize.Width(), baseSize.Width(), dx), dy,
|
||||||
dy, 0);
|
ReflowChildFlags::Default);
|
||||||
|
|
||||||
mReference.x = 0;
|
mReference.x = 0;
|
||||||
mReference.y = aDesiredSize.BlockStartAscent();
|
mReference.y = aDesiredSize.BlockStartAscent();
|
||||||
|
|
|
||||||
|
|
@ -668,18 +668,20 @@ nsMathMLmunderoverFrame::Place(DrawTarget* aDrawTarget,
|
||||||
dy = aDesiredSize.BlockStartAscent() -
|
dy = aDesiredSize.BlockStartAscent() -
|
||||||
mBoundingMetrics.ascent + bmOver.ascent -
|
mBoundingMetrics.ascent + bmOver.ascent -
|
||||||
overSize.BlockStartAscent();
|
overSize.BlockStartAscent();
|
||||||
FinishReflowChild (overFrame, PresContext(), overSize, nullptr, dxOver, dy, 0);
|
FinishReflowChild(overFrame, PresContext(), overSize, nullptr, dxOver, dy,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
// place base
|
// place base
|
||||||
dy = aDesiredSize.BlockStartAscent() - baseSize.BlockStartAscent();
|
dy = aDesiredSize.BlockStartAscent() - baseSize.BlockStartAscent();
|
||||||
FinishReflowChild (baseFrame, PresContext(), baseSize, nullptr, dxBase, dy, 0);
|
FinishReflowChild(baseFrame, PresContext(), baseSize, nullptr, dxBase, dy,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
// place underscript
|
// place underscript
|
||||||
if (underFrame) {
|
if (underFrame) {
|
||||||
dy = aDesiredSize.BlockStartAscent() +
|
dy = aDesiredSize.BlockStartAscent() +
|
||||||
mBoundingMetrics.descent - bmUnder.descent -
|
mBoundingMetrics.descent - bmUnder.descent -
|
||||||
underSize.BlockStartAscent();
|
underSize.BlockStartAscent();
|
||||||
FinishReflowChild (underFrame, PresContext(), underSize, nullptr,
|
FinishReflowChild(underFrame, PresContext(), underSize, nullptr,
|
||||||
dxUnder, dy, 0);
|
dxUnder, dy, ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
||||||
|
|
@ -562,11 +562,12 @@ nsSVGForeignObjectFrame::DoReflow()
|
||||||
reflowInput.SetComputedBSize(BSize(wm));
|
reflowInput.SetComputedBSize(BSize(wm));
|
||||||
|
|
||||||
ReflowChild(kid, presContext, desiredSize, reflowInput, 0, 0,
|
ReflowChild(kid, presContext, desiredSize, reflowInput, 0, 0,
|
||||||
NS_FRAME_NO_MOVE_FRAME, status);
|
ReflowChildFlags::NoMoveFrame, status);
|
||||||
NS_ASSERTION(mRect.width == desiredSize.Width() &&
|
NS_ASSERTION(mRect.width == desiredSize.Width() &&
|
||||||
mRect.height == desiredSize.Height(), "unexpected size");
|
mRect.height == desiredSize.Height(),
|
||||||
|
"unexpected size");
|
||||||
FinishReflowChild(kid, presContext, desiredSize, &reflowInput, 0, 0,
|
FinishReflowChild(kid, presContext, desiredSize, &reflowInput, 0, 0,
|
||||||
NS_FRAME_NO_MOVE_FRAME);
|
ReflowChildFlags::NoMoveFrame);
|
||||||
|
|
||||||
mInReflow = false;
|
mInReflow = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -640,7 +640,8 @@ void nsTableCellFrame::BlockDirAlignChild(WritingMode aWM, nscoord aMaxAscent)
|
||||||
if (HasView()) {
|
if (HasView()) {
|
||||||
nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this,
|
nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this,
|
||||||
GetView(),
|
GetView(),
|
||||||
desiredSize.VisualOverflow(), 0);
|
desiredSize.VisualOverflow(),
|
||||||
|
ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -937,8 +938,8 @@ nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||||
nsRect origVisualOverflow = firstKid->GetVisualOverflowRect();
|
nsRect origVisualOverflow = firstKid->GetVisualOverflowRect();
|
||||||
bool firstReflow = firstKid->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
|
bool firstReflow = firstKid->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
|
||||||
|
|
||||||
ReflowChild(firstKid, aPresContext, kidSize, kidReflowInput,
|
ReflowChild(firstKid, aPresContext, kidSize, kidReflowInput, wm, kidOrigin,
|
||||||
wm, kidOrigin, containerSize, 0, aStatus);
|
containerSize, ReflowChildFlags::Default, aStatus);
|
||||||
if (NS_FRAME_OVERFLOW_IS_INCOMPLETE(aStatus)) {
|
if (NS_FRAME_OVERFLOW_IS_INCOMPLETE(aStatus)) {
|
||||||
// Don't pass OVERFLOW_INCOMPLETE through tables until they can actually handle it
|
// Don't pass OVERFLOW_INCOMPLETE through tables until they can actually handle it
|
||||||
//XXX should paginate overflow as overflow, but not in this patch (bug 379349)
|
//XXX should paginate overflow as overflow, but not in this patch (bug 379349)
|
||||||
|
|
@ -967,8 +968,8 @@ nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||||
SetContentEmpty(isEmpty);
|
SetContentEmpty(isEmpty);
|
||||||
|
|
||||||
// Place the child
|
// Place the child
|
||||||
FinishReflowChild(firstKid, aPresContext, kidSize, &kidReflowInput,
|
FinishReflowChild(firstKid, aPresContext, kidSize, &kidReflowInput, wm,
|
||||||
wm, kidOrigin, containerSize, 0);
|
kidOrigin, containerSize, ReflowChildFlags::Default);
|
||||||
|
|
||||||
nsTableFrame::InvalidateTableFrame(firstKid, origRect, origVisualOverflow,
|
nsTableFrame::InvalidateTableFrame(firstKid, origRect, origVisualOverflow,
|
||||||
firstReflow);
|
firstReflow);
|
||||||
|
|
|
||||||
|
|
@ -374,8 +374,10 @@ nsTableColGroupFrame::Reflow(nsPresContext* aPresContext,
|
||||||
LogicalSize(kidFrame->GetWritingMode()));
|
LogicalSize(kidFrame->GetWritingMode()));
|
||||||
|
|
||||||
nsReflowStatus status;
|
nsReflowStatus status;
|
||||||
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, 0, 0, 0, status);
|
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, 0, 0,
|
||||||
FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, 0, 0, 0);
|
ReflowChildFlags::Default, status);
|
||||||
|
FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, 0, 0,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
aDesiredSize.ClearSize();
|
aDesiredSize.ClearSize();
|
||||||
|
|
|
||||||
|
|
@ -103,13 +103,13 @@ struct TableReflowInput {
|
||||||
availSize.BSize(wm) = std::max(0, availSize.BSize(wm));
|
availSize.BSize(wm) = std::max(0, availSize.BSize(wm));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReduceAvailableBSizeBy(WritingMode aWM, nscoord aAmount) {
|
void ReduceAvailableBSizeBy(WritingMode aWM, nscoord aAmount) {
|
||||||
if (availSize.BSize(aWM) == NS_UNCONSTRAINEDSIZE) {
|
if (availSize.BSize(aWM) == NS_UNCONSTRAINEDSIZE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
availSize.BSize(aWM) -= aAmount;
|
availSize.BSize(aWM) -= aAmount;
|
||||||
availSize.BSize(aWM) = std::max(0, availSize.BSize(aWM));
|
availSize.BSize(aWM) = std::max(0, availSize.BSize(aWM));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2680,7 +2680,7 @@ nsTableFrame::PlaceChild(TableReflowInput& aReflowInput,
|
||||||
|
|
||||||
// Place and size the child
|
// Place and size the child
|
||||||
FinishReflowChild(aKidFrame, PresContext(), aKidDesiredSize, nullptr,
|
FinishReflowChild(aKidFrame, PresContext(), aKidDesiredSize, nullptr,
|
||||||
aKidPosition.x, aKidPosition.y, 0);
|
aKidPosition.x, aKidPosition.y, ReflowChildFlags::Default);
|
||||||
|
|
||||||
InvalidateTableFrame(aKidFrame, aOriginalKidRect, aOriginalKidVisualOverflow,
|
InvalidateTableFrame(aKidFrame, aOriginalKidRect, aOriginalKidVisualOverflow,
|
||||||
isFirstReflow);
|
isFirstReflow);
|
||||||
|
|
@ -2832,9 +2832,9 @@ nsTableFrame::SetupHeaderFooterChild(const TableReflowInput& aReflowInput,
|
||||||
ReflowOutput desiredSize(aReflowInput.reflowInput);
|
ReflowOutput desiredSize(aReflowInput.reflowInput);
|
||||||
desiredSize.ClearSize();
|
desiredSize.ClearSize();
|
||||||
nsReflowStatus status;
|
nsReflowStatus status;
|
||||||
ReflowChild(aFrame, presContext, desiredSize, kidReflowInput,
|
ReflowChild(aFrame, presContext, desiredSize, kidReflowInput, wm,
|
||||||
wm, LogicalPoint(wm, aReflowInput.iCoord, aReflowInput.bCoord),
|
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
|
// The child will be reflowed again "for real" so no need to place it now
|
||||||
|
|
||||||
aFrame->SetRepeatable(IsRepeatable(desiredSize.Height(), pageHeight));
|
aFrame->SetRepeatable(IsRepeatable(desiredSize.Height(), pageHeight));
|
||||||
|
|
@ -2870,8 +2870,9 @@ nsTableFrame::PlaceRepeatedFooter(TableReflowInput& aReflowInput,
|
||||||
ReflowOutput desiredSize(aReflowInput.reflowInput);
|
ReflowOutput desiredSize(aReflowInput.reflowInput);
|
||||||
desiredSize.ClearSize();
|
desiredSize.ClearSize();
|
||||||
LogicalPoint kidPosition(wm, aReflowInput.iCoord, aReflowInput.bCoord);
|
LogicalPoint kidPosition(wm, aReflowInput.iCoord, aReflowInput.bCoord);
|
||||||
ReflowChild(aTfoot, presContext, desiredSize, footerReflowInput,
|
ReflowChild(aTfoot, presContext, desiredSize, footerReflowInput, wm,
|
||||||
wm, kidPosition, containerSize, 0, footerStatus);
|
kidPosition, containerSize, ReflowChildFlags::Default,
|
||||||
|
footerStatus);
|
||||||
footerReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
|
footerReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
|
||||||
|
|
||||||
PlaceChild(aReflowInput, aTfoot,
|
PlaceChild(aReflowInput, aTfoot,
|
||||||
|
|
@ -3029,8 +3030,9 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalPoint kidPosition(wm, aReflowInput.iCoord, aReflowInput.bCoord);
|
LogicalPoint kidPosition(wm, aReflowInput.iCoord, aReflowInput.bCoord);
|
||||||
ReflowChild(kidFrame, presContext, desiredSize, kidReflowInput,
|
ReflowChild(kidFrame, presContext, desiredSize, kidReflowInput, wm,
|
||||||
wm, kidPosition, containerSize, 0, aStatus);
|
kidPosition, containerSize, ReflowChildFlags::Default,
|
||||||
|
aStatus);
|
||||||
kidReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
|
kidReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
|
||||||
|
|
||||||
if (reorder) {
|
if (reorder) {
|
||||||
|
|
@ -3209,9 +3211,10 @@ nsTableFrame::ReflowColGroups(nsRenderingContext *aRenderingContext)
|
||||||
kidReflowInput(presContext, kidFrame, aRenderingContext,
|
kidReflowInput(presContext, kidFrame, aRenderingContext,
|
||||||
LogicalSize(kidFrame->GetWritingMode()));
|
LogicalSize(kidFrame->GetWritingMode()));
|
||||||
nsReflowStatus cgStatus;
|
nsReflowStatus cgStatus;
|
||||||
ReflowChild(kidFrame, presContext, kidMet, kidReflowInput, 0, 0, 0,
|
ReflowChild(kidFrame, presContext, kidMet, kidReflowInput, 0, 0,
|
||||||
cgStatus);
|
ReflowChildFlags::Default, cgStatus);
|
||||||
FinishReflowChild(kidFrame, presContext, kidMet, nullptr, 0, 0, 0);
|
FinishReflowChild(kidFrame, presContext, kidMet, nullptr, 0, 0,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetHaveReflowedColGroups(true);
|
SetHaveReflowedColGroups(true);
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,8 @@ nsTableRowFrame::DidResize()
|
||||||
FinishAndStoreOverflow(&desiredSize);
|
FinishAndStoreOverflow(&desiredSize);
|
||||||
if (HasView()) {
|
if (HasView()) {
|
||||||
nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this, GetView(),
|
nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this, GetView(),
|
||||||
desiredSize.VisualOverflow(), 0);
|
desiredSize.VisualOverflow(),
|
||||||
|
ReflowChildFlags::Default);
|
||||||
}
|
}
|
||||||
// Let our base class do the usual work
|
// Let our base class do the usual work
|
||||||
}
|
}
|
||||||
|
|
@ -812,7 +813,8 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
|
||||||
InitChildReflowInput(*aPresContext, LogicalSize(wm), false, kidReflowInput);
|
InitChildReflowInput(*aPresContext, LogicalSize(wm), false, kidReflowInput);
|
||||||
ReflowOutput desiredSize(aReflowInput);
|
ReflowOutput desiredSize(aReflowInput);
|
||||||
nsReflowStatus status;
|
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, nsDidReflowStatus::FINISHED);
|
kidFrame->DidReflow(aPresContext, nullptr, nsDidReflowStatus::FINISHED);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -906,8 +908,9 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
|
||||||
*kidReflowInput);
|
*kidReflowInput);
|
||||||
|
|
||||||
nsReflowStatus status;
|
nsReflowStatus status;
|
||||||
ReflowChild(kidFrame, aPresContext, desiredSize, *kidReflowInput,
|
ReflowChild(kidFrame, aPresContext, desiredSize, *kidReflowInput, wm,
|
||||||
wm, kidPosition, containerSize, 0, status);
|
kidPosition, containerSize, ReflowChildFlags::Default,
|
||||||
|
status);
|
||||||
|
|
||||||
// allow the table to determine if/how the table needs to be rebalanced
|
// 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
|
// If any of the cells are not complete, then we're not complete
|
||||||
|
|
@ -977,8 +980,8 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
|
||||||
// In vertical-rl mode, we are likely to have containerSize.width = 0
|
// In vertical-rl mode, we are likely to have containerSize.width = 0
|
||||||
// because ComputedWidth() was NS_UNCONSTRAINEDSIZE.
|
// because ComputedWidth() was NS_UNCONSTRAINEDSIZE.
|
||||||
// For cases where that's wrong, we will fix up the position later.
|
// For cases where that's wrong, we will fix up the position later.
|
||||||
FinishReflowChild(kidFrame, aPresContext, desiredSize, nullptr,
|
FinishReflowChild(kidFrame, aPresContext, desiredSize, nullptr, wm,
|
||||||
wm, kidPosition, containerSize, 0);
|
kidPosition, containerSize, ReflowChildFlags::Default);
|
||||||
|
|
||||||
nsTableFrame::InvalidateTableFrame(kidFrame, kidRect, kidVisualOverflow,
|
nsTableFrame::InvalidateTableFrame(kidFrame, kidRect, kidVisualOverflow,
|
||||||
firstReflow);
|
firstReflow);
|
||||||
|
|
@ -1149,8 +1152,8 @@ nsTableRowFrame::ReflowCellFrame(nsPresContext* aPresContext,
|
||||||
|
|
||||||
ReflowOutput desiredSize(aReflowInput);
|
ReflowOutput desiredSize(aReflowInput);
|
||||||
|
|
||||||
ReflowChild(aCellFrame, aPresContext, desiredSize, cellReflowInput,
|
ReflowChild(aCellFrame, aPresContext, desiredSize, cellReflowInput, 0, 0,
|
||||||
0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
|
ReflowChildFlags::NoMoveFrame, aStatus);
|
||||||
bool fullyComplete = NS_FRAME_IS_COMPLETE(aStatus) && !NS_FRAME_IS_TRUNCATED(aStatus);
|
bool fullyComplete = NS_FRAME_IS_COMPLETE(aStatus) && !NS_FRAME_IS_TRUNCATED(aStatus);
|
||||||
if (fullyComplete) {
|
if (fullyComplete) {
|
||||||
desiredSize.BSize(wm) = aAvailableBSize;
|
desiredSize.BSize(wm) = aAvailableBSize;
|
||||||
|
|
|
||||||
|
|
@ -279,8 +279,8 @@ nsTableRowGroupFrame::PlaceChild(nsPresContext* aPresContext,
|
||||||
bool isFirstReflow = aKidFrame->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
|
bool isFirstReflow = aKidFrame->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
|
||||||
|
|
||||||
// Place and size the child
|
// Place and size the child
|
||||||
FinishReflowChild(aKidFrame, aPresContext, aDesiredSize, nullptr,
|
FinishReflowChild(aKidFrame, aPresContext, aDesiredSize, nullptr, aWM,
|
||||||
aWM, aKidPosition, aContainerSize, 0);
|
aKidPosition, aContainerSize, ReflowChildFlags::Default);
|
||||||
|
|
||||||
nsTableFrame::InvalidateTableFrame(aKidFrame, aOriginalKidRect,
|
nsTableFrame::InvalidateTableFrame(aKidFrame, aOriginalKidRect,
|
||||||
aOriginalKidVisualOverflow, isFirstReflow);
|
aOriginalKidVisualOverflow, isFirstReflow);
|
||||||
|
|
@ -411,8 +411,9 @@ nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalPoint kidPosition(wm, 0, aReflowInput.bCoord);
|
LogicalPoint kidPosition(wm, 0, aReflowInput.bCoord);
|
||||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowInput,
|
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowInput, wm,
|
||||||
wm, kidPosition, containerSize, 0, aStatus);
|
kidPosition, containerSize, ReflowChildFlags::Default,
|
||||||
|
aStatus);
|
||||||
kidReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
|
kidReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
|
||||||
|
|
||||||
// Place the child
|
// Place the child
|
||||||
|
|
@ -1147,10 +1148,10 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
||||||
nsRect oldRowRect = rowFrame->GetRect();
|
nsRect oldRowRect = rowFrame->GetRect();
|
||||||
nsRect oldRowVisualOverflow = rowFrame->GetVisualOverflowRect();
|
nsRect oldRowVisualOverflow = rowFrame->GetVisualOverflowRect();
|
||||||
|
|
||||||
// Reflow the cell with the constrained height. A cell with rowspan >1 will get this
|
// Reflow the cell with the constrained height. A cell with rowspan >1
|
||||||
// reflow later during SplitSpanningCells.
|
// will get this reflow later during SplitSpanningCells.
|
||||||
ReflowChild(rowFrame, aPresContext, rowMetrics, rowReflowInput,
|
ReflowChild(rowFrame, aPresContext, rowMetrics, rowReflowInput, 0, 0,
|
||||||
0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
|
ReflowChildFlags::NoMoveFrame, aStatus);
|
||||||
rowFrame->SetSize(nsSize(rowMetrics.Width(), rowMetrics.Height()));
|
rowFrame->SetSize(nsSize(rowMetrics.Width(), rowMetrics.Height()));
|
||||||
rowFrame->DidReflow(aPresContext, nullptr, nsDidReflowStatus::FINISHED);
|
rowFrame->DidReflow(aPresContext, nullptr, nsDidReflowStatus::FINISHED);
|
||||||
rowFrame->DidResize();
|
rowFrame->DidResize();
|
||||||
|
|
|
||||||
|
|
@ -822,7 +822,7 @@ nsTableWrapperFrame::OuterDoReflowChild(nsPresContext* aPresContext,
|
||||||
|
|
||||||
// Use the current position as a best guess for placement.
|
// Use the current position as a best guess for placement.
|
||||||
LogicalPoint childPt = aChildFrame->GetLogicalPosition(wm, zeroCSize);
|
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
|
// 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
|
// frame, because table wrapper frames always assume that their inner table
|
||||||
|
|
@ -830,7 +830,7 @@ nsTableWrapperFrame::OuterDoReflowChild(nsPresContext* aPresContext,
|
||||||
// a next-in-flow of an already complete table wrapper frame, then it will
|
// a next-in-flow of an already complete table wrapper frame, then it will
|
||||||
// take care of removing it's inner table frame.
|
// take care of removing it's inner table frame.
|
||||||
if (aChildFrame == InnerTableFrame()) {
|
if (aChildFrame == InnerTableFrame()) {
|
||||||
flags |= NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD;
|
flags |= ReflowChildFlags::NoDeleteNextInFlowChild;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReflowChild(aChildFrame, aPresContext, aMetrics, aChildRI,
|
ReflowChild(aChildFrame, aPresContext, aMetrics, aChildRI,
|
||||||
|
|
@ -1024,7 +1024,8 @@ nsTableWrapperFrame::Reflow(nsPresContext* aPresContext,
|
||||||
GetCaptionOrigin(captionSide, containSize, innerSize, innerMargin,
|
GetCaptionOrigin(captionSide, containSize, innerSize, innerMargin,
|
||||||
captionSize, captionMargin, captionOrigin, wm);
|
captionSize, captionMargin, captionOrigin, wm);
|
||||||
FinishReflowChild(mCaptionFrames.FirstChild(), aPresContext, *captionMet,
|
FinishReflowChild(mCaptionFrames.FirstChild(), aPresContext, *captionMet,
|
||||||
captionRI.ptr(), wm, captionOrigin, containerSize, 0);
|
captionRI.ptr(), wm, captionOrigin, containerSize,
|
||||||
|
ReflowChildFlags::Default);
|
||||||
captionRI.reset();
|
captionRI.reset();
|
||||||
}
|
}
|
||||||
// XXX If the bsize is constrained then we need to check whether
|
// XXX If the bsize is constrained then we need to check whether
|
||||||
|
|
@ -1034,7 +1035,7 @@ nsTableWrapperFrame::Reflow(nsPresContext* aPresContext,
|
||||||
GetInnerOrigin(captionSide, containSize, captionSize, captionMargin,
|
GetInnerOrigin(captionSide, containSize, captionSize, captionMargin,
|
||||||
innerSize, innerMargin, innerOrigin, wm);
|
innerSize, innerMargin, innerOrigin, wm);
|
||||||
FinishReflowChild(InnerTableFrame(), aPresContext, innerMet, innerRI.ptr(),
|
FinishReflowChild(InnerTableFrame(), aPresContext, innerMet, innerRI.ptr(),
|
||||||
wm, innerOrigin, containerSize, 0);
|
wm, innerOrigin, containerSize, ReflowChildFlags::Default);
|
||||||
innerRI.reset();
|
innerRI.reset();
|
||||||
|
|
||||||
nsTableFrame::InvalidateTableFrame(InnerTableFrame(), origInnerRect,
|
nsTableFrame::InvalidateTableFrame(InnerTableFrame(), origInnerRect,
|
||||||
|
|
@ -1051,8 +1052,8 @@ nsTableWrapperFrame::Reflow(nsPresContext* aPresContext,
|
||||||
|
|
||||||
if (GetPrevInFlow()) {
|
if (GetPrevInFlow()) {
|
||||||
ReflowOverflowContainerChildren(aPresContext, aOuterRI,
|
ReflowOverflowContainerChildren(aPresContext, aOuterRI,
|
||||||
aDesiredSize.mOverflowAreas, 0,
|
aDesiredSize.mOverflowAreas,
|
||||||
aStatus);
|
ReflowChildFlags::Default, aStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aOuterRI, aStatus);
|
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aOuterRI, aStatus);
|
||||||
|
|
|
||||||
|
|
@ -235,16 +235,14 @@ nsBox::SetXULBounds(nsBoxLayoutState& aState, const nsRect& aRect, bool aRemoveO
|
||||||
|
|
||||||
nsRect rect(mRect);
|
nsRect rect(mRect);
|
||||||
|
|
||||||
uint32_t flags = GetXULLayoutFlags();
|
ReflowChildFlags flags = GetXULLayoutFlags() | aState.LayoutFlags();
|
||||||
|
|
||||||
uint32_t stateFlags = aState.LayoutFlags();
|
if ((flags & ReflowChildFlags::NoMoveFrame) ==
|
||||||
|
ReflowChildFlags::NoMoveFrame) {
|
||||||
flags |= stateFlags;
|
|
||||||
|
|
||||||
if ((flags & NS_FRAME_NO_MOVE_FRAME) == NS_FRAME_NO_MOVE_FRAME)
|
|
||||||
SetSize(aRect.Size());
|
SetSize(aRect.Size());
|
||||||
else
|
} else {
|
||||||
SetRect(aRect);
|
SetRect(aRect);
|
||||||
|
}
|
||||||
|
|
||||||
// Nuke the overflow area. The caller is responsible for restoring
|
// Nuke the overflow area. The caller is responsible for restoring
|
||||||
// it if necessary.
|
// it if necessary.
|
||||||
|
|
@ -253,8 +251,7 @@ nsBox::SetXULBounds(nsBoxLayoutState& aState, const nsRect& aRect, bool aRemoveO
|
||||||
ClearOverflowRects();
|
ClearOverflowRects();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & NS_FRAME_NO_MOVE_VIEW))
|
if (!(flags & ReflowChildFlags::NoMoveView)) {
|
||||||
{
|
|
||||||
nsContainerFrame::PositionFrameView(this);
|
nsContainerFrame::PositionFrameView(this);
|
||||||
if ((rect.x != aRect.x) || (rect.y != aRect.y))
|
if ((rect.x != aRect.x) || (rect.y != aRect.y))
|
||||||
nsContainerFrame::PositionChildViews(this);
|
nsContainerFrame::PositionChildViews(this);
|
||||||
|
|
@ -533,11 +530,7 @@ nsBox::SyncLayout(nsBoxLayoutState& aState)
|
||||||
|
|
||||||
nsPresContext* presContext = aState.PresContext();
|
nsPresContext* presContext = aState.PresContext();
|
||||||
|
|
||||||
uint32_t flags = GetXULLayoutFlags();
|
ReflowChildFlags flags = GetXULLayoutFlags() | aState.LayoutFlags();
|
||||||
|
|
||||||
uint32_t stateFlags = aState.LayoutFlags();
|
|
||||||
|
|
||||||
flags |= stateFlags;
|
|
||||||
|
|
||||||
nsRect visualOverflow;
|
nsRect visualOverflow;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -905,8 +905,8 @@ nsBoxFrame::GetXULFlex()
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsBoxFrame::DoXULLayout(nsBoxLayoutState& aState)
|
nsBoxFrame::DoXULLayout(nsBoxLayoutState& aState)
|
||||||
{
|
{
|
||||||
uint32_t oldFlags = aState.LayoutFlags();
|
ReflowChildFlags oldFlags = aState.LayoutFlags();
|
||||||
aState.SetLayoutFlags(0);
|
aState.SetLayoutFlags(ReflowChildFlags::Default);
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
if (mLayoutManager) {
|
if (mLayoutManager) {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ nsBoxLayoutState::nsBoxLayoutState(nsPresContext* aPresContext,
|
||||||
: mPresContext(aPresContext)
|
: mPresContext(aPresContext)
|
||||||
, mRenderingContext(aRenderingContext)
|
, mRenderingContext(aRenderingContext)
|
||||||
, mOuterReflowInput(aOuterReflowInput)
|
, mOuterReflowInput(aOuterReflowInput)
|
||||||
, mLayoutFlags(0)
|
, mLayoutFlags(nsIFrame::ReflowChildFlags::Default)
|
||||||
, mReflowDepth(aReflowDepth)
|
, mReflowDepth(aReflowDepth)
|
||||||
, mPaintingDisabled(false)
|
, mPaintingDisabled(false)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsPresContext.h"
|
#include "nsPresContext.h"
|
||||||
|
#include "nsIFrame.h"
|
||||||
#include "nsIPresShell.h"
|
#include "nsIPresShell.h"
|
||||||
|
|
||||||
class nsRenderingContext;
|
class nsRenderingContext;
|
||||||
|
|
@ -38,8 +39,10 @@ public:
|
||||||
nsPresContext* PresContext() const { return mPresContext; }
|
nsPresContext* PresContext() const { return mPresContext; }
|
||||||
nsIPresShell* PresShell() const { return mPresContext->PresShell(); }
|
nsIPresShell* PresShell() const { return mPresContext->PresShell(); }
|
||||||
|
|
||||||
uint32_t LayoutFlags() const { return mLayoutFlags; }
|
nsIFrame::ReflowChildFlags LayoutFlags() const { return mLayoutFlags; }
|
||||||
void SetLayoutFlags(uint32_t aFlags) { mLayoutFlags = aFlags; }
|
void SetLayoutFlags(nsIFrame::ReflowChildFlags aFlags) {
|
||||||
|
mLayoutFlags = aFlags;
|
||||||
|
}
|
||||||
|
|
||||||
// if true no one under us will paint during reflow.
|
// if true no one under us will paint during reflow.
|
||||||
void SetPaintingDisabled(bool aDisable) { mPaintingDisabled = aDisable; }
|
void SetPaintingDisabled(bool aDisable) { mPaintingDisabled = aDisable; }
|
||||||
|
|
@ -68,7 +71,7 @@ private:
|
||||||
RefPtr<nsPresContext> mPresContext;
|
RefPtr<nsPresContext> mPresContext;
|
||||||
nsRenderingContext *mRenderingContext;
|
nsRenderingContext *mRenderingContext;
|
||||||
const ReflowInput *mOuterReflowInput;
|
const ReflowInput *mOuterReflowInput;
|
||||||
uint32_t mLayoutFlags;
|
nsIFrame::ReflowChildFlags mLayoutFlags;
|
||||||
uint16_t mReflowDepth;
|
uint16_t mReflowDepth;
|
||||||
bool mPaintingDisabled;
|
bool mPaintingDisabled;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -202,8 +202,9 @@ nsDeckFrame::DoXULLayout(nsBoxLayoutState& aState)
|
||||||
{
|
{
|
||||||
// Make sure we tweak the state so it does not resize our children.
|
// Make sure we tweak the state so it does not resize our children.
|
||||||
// We will do that.
|
// We will do that.
|
||||||
uint32_t oldFlags = aState.LayoutFlags();
|
ReflowChildFlags oldFlags = aState.LayoutFlags();
|
||||||
aState.SetLayoutFlags(NS_FRAME_NO_SIZE_VIEW | NS_FRAME_NO_VISIBILITY);
|
aState.SetLayoutFlags(ReflowChildFlags::NoSizeView |
|
||||||
|
ReflowChildFlags::NoVisibility);
|
||||||
|
|
||||||
// do a normal layout
|
// do a normal layout
|
||||||
nsresult rv = nsBoxFrame::DoXULLayout(aState);
|
nsresult rv = nsBoxFrame::DoXULLayout(aState);
|
||||||
|
|
|
||||||
|
|
@ -531,7 +531,7 @@ nsMenuPopupFrame::LayoutPopup(nsBoxLayoutState& aState, nsIFrame* aParentMenu,
|
||||||
}
|
}
|
||||||
|
|
||||||
viewManager->SetViewVisibility(view, nsViewVisibility_kShow);
|
viewManager->SetViewVisibility(view, nsViewVisibility_kShow);
|
||||||
nsContainerFrame::SyncFrameViewProperties(pc, this, nullptr, view, 0);
|
nsContainerFrame::SyncFrameViewProperties(pc, this, nullptr, view);
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally, if the popup just opened, send a popupshown event
|
// finally, if the popup just opened, send a popupshown event
|
||||||
|
|
@ -993,10 +993,9 @@ nsMenuPopupFrame::HidePopup(bool aDeselectMenu, nsPopupState aNewState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
nsIFrame::ReflowChildFlags nsMenuPopupFrame::GetXULLayoutFlags() {
|
||||||
nsMenuPopupFrame::GetXULLayoutFlags()
|
return ReflowChildFlags::NoSizeView | ReflowChildFlags::NoMoveView |
|
||||||
{
|
ReflowChildFlags::NoVisibility;
|
||||||
return NS_FRAME_NO_SIZE_VIEW | NS_FRAME_NO_MOVE_VIEW | NS_FRAME_NO_VISIBILITY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,7 @@ protected:
|
||||||
nsPopupLevel PopupLevel(bool aIsNoAutoHide) const;
|
nsPopupLevel PopupLevel(bool aIsNoAutoHide) const;
|
||||||
|
|
||||||
// redefine to tell the box system not to move the views.
|
// redefine to tell the box system not to move the views.
|
||||||
virtual uint32_t GetXULLayoutFlags() override;
|
ReflowChildFlags GetXULLayoutFlags() override;
|
||||||
|
|
||||||
void InitPositionFromAnchorAlign(const nsAString& aAnchor,
|
void InitPositionFromAnchorAlign(const nsAString& aAnchor,
|
||||||
const nsAString& aAlign);
|
const nsAString& aAlign);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue