Bug 1277129 Part 7b - Rename various ReflowState variables to ReflowInput. r=dbaron
This patch is generated by the following script:
function rename() {
find .\
-type f\
! -path "./obj*"\
! -path "./.git"\
! -path "./.hg"\
\( -name "*.cpp" -or\
-name "*.h" \)\
-exec sed -i -r "s/$1/$2/g" "{}" \;
}
rename "([[:alpha:]]*)([rR])eflowState(s?)" "\1\2eflowInput\3"
MozReview-Commit-ID: ITFO7uMTkSb
This commit is contained in:
@@ -489,55 +489,55 @@ RestyleManager::RecomputePosition(nsIFrame* aFrame)
|
|||||||
LogicalSize parentSize = parentFrame->GetLogicalSize();
|
LogicalSize parentSize = parentFrame->GetLogicalSize();
|
||||||
|
|
||||||
nsFrameState savedState = parentFrame->GetStateBits();
|
nsFrameState savedState = parentFrame->GetStateBits();
|
||||||
ReflowInput parentReflowState(aFrame->PresContext(), parentFrame,
|
ReflowInput parentReflowInput(aFrame->PresContext(), parentFrame,
|
||||||
&rc, parentSize);
|
&rc, parentSize);
|
||||||
parentFrame->RemoveStateBits(~nsFrameState(0));
|
parentFrame->RemoveStateBits(~nsFrameState(0));
|
||||||
parentFrame->AddStateBits(savedState);
|
parentFrame->AddStateBits(savedState);
|
||||||
|
|
||||||
// The bogus parent state here was created with no parent state of its own,
|
// The bogus parent state here was created with no parent state of its own,
|
||||||
// and therefore it won't have an mCBReflowState set up.
|
// and therefore it won't have an mCBReflowInput set up.
|
||||||
// But we may need one (for InitCBReflowState in a child state), so let's
|
// But we may need one (for InitCBReflowInput in a child state), so let's
|
||||||
// try to create one here for the cases where it will be needed.
|
// try to create one here for the cases where it will be needed.
|
||||||
Maybe<ReflowInput> cbReflowState;
|
Maybe<ReflowInput> cbReflowInput;
|
||||||
nsIFrame* cbFrame = parentFrame->GetContainingBlock();
|
nsIFrame* cbFrame = parentFrame->GetContainingBlock();
|
||||||
if (cbFrame && (aFrame->GetContainingBlock() != parentFrame ||
|
if (cbFrame && (aFrame->GetContainingBlock() != parentFrame ||
|
||||||
parentFrame->GetType() == nsGkAtoms::tableFrame)) {
|
parentFrame->GetType() == nsGkAtoms::tableFrame)) {
|
||||||
LogicalSize cbSize = cbFrame->GetLogicalSize();
|
LogicalSize cbSize = cbFrame->GetLogicalSize();
|
||||||
cbReflowState.emplace(cbFrame->PresContext(), cbFrame, &rc, cbSize);
|
cbReflowInput.emplace(cbFrame->PresContext(), cbFrame, &rc, cbSize);
|
||||||
cbReflowState->ComputedPhysicalMargin() = cbFrame->GetUsedMargin();
|
cbReflowInput->ComputedPhysicalMargin() = cbFrame->GetUsedMargin();
|
||||||
cbReflowState->ComputedPhysicalPadding() = cbFrame->GetUsedPadding();
|
cbReflowInput->ComputedPhysicalPadding() = cbFrame->GetUsedPadding();
|
||||||
cbReflowState->ComputedPhysicalBorderPadding() =
|
cbReflowInput->ComputedPhysicalBorderPadding() =
|
||||||
cbFrame->GetUsedBorderAndPadding();
|
cbFrame->GetUsedBorderAndPadding();
|
||||||
parentReflowState.mCBReflowState = cbReflowState.ptr();
|
parentReflowInput.mCBReflowInput = cbReflowInput.ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_WARN_IF_FALSE(parentSize.ISize(parentWM) != NS_INTRINSICSIZE &&
|
NS_WARN_IF_FALSE(parentSize.ISize(parentWM) != NS_INTRINSICSIZE &&
|
||||||
parentSize.BSize(parentWM) != NS_INTRINSICSIZE,
|
parentSize.BSize(parentWM) != NS_INTRINSICSIZE,
|
||||||
"parentSize should be valid");
|
"parentSize should be valid");
|
||||||
parentReflowState.SetComputedISize(std::max(parentSize.ISize(parentWM), 0));
|
parentReflowInput.SetComputedISize(std::max(parentSize.ISize(parentWM), 0));
|
||||||
parentReflowState.SetComputedBSize(std::max(parentSize.BSize(parentWM), 0));
|
parentReflowInput.SetComputedBSize(std::max(parentSize.BSize(parentWM), 0));
|
||||||
parentReflowState.ComputedPhysicalMargin().SizeTo(0, 0, 0, 0);
|
parentReflowInput.ComputedPhysicalMargin().SizeTo(0, 0, 0, 0);
|
||||||
|
|
||||||
parentReflowState.ComputedPhysicalPadding() = parentFrame->GetUsedPadding();
|
parentReflowInput.ComputedPhysicalPadding() = parentFrame->GetUsedPadding();
|
||||||
parentReflowState.ComputedPhysicalBorderPadding() =
|
parentReflowInput.ComputedPhysicalBorderPadding() =
|
||||||
parentFrame->GetUsedBorderAndPadding();
|
parentFrame->GetUsedBorderAndPadding();
|
||||||
LogicalSize availSize = parentSize.ConvertTo(frameWM, parentWM);
|
LogicalSize availSize = parentSize.ConvertTo(frameWM, parentWM);
|
||||||
availSize.BSize(frameWM) = NS_INTRINSICSIZE;
|
availSize.BSize(frameWM) = NS_INTRINSICSIZE;
|
||||||
|
|
||||||
ViewportFrame* viewport = do_QueryFrame(parentFrame);
|
ViewportFrame* viewport = do_QueryFrame(parentFrame);
|
||||||
nsSize cbSize = viewport ?
|
nsSize cbSize = viewport ?
|
||||||
viewport->AdjustReflowStateAsContainingBlock(&parentReflowState).Size()
|
viewport->AdjustReflowInputAsContainingBlock(&parentReflowInput).Size()
|
||||||
: aFrame->GetContainingBlock()->GetSize();
|
: aFrame->GetContainingBlock()->GetSize();
|
||||||
const nsMargin& parentBorder =
|
const nsMargin& parentBorder =
|
||||||
parentReflowState.mStyleBorder->GetComputedBorder();
|
parentReflowInput.mStyleBorder->GetComputedBorder();
|
||||||
cbSize -= nsSize(parentBorder.LeftRight(), parentBorder.TopBottom());
|
cbSize -= nsSize(parentBorder.LeftRight(), parentBorder.TopBottom());
|
||||||
LogicalSize lcbSize(frameWM, cbSize);
|
LogicalSize lcbSize(frameWM, cbSize);
|
||||||
ReflowInput reflowState(aFrame->PresContext(), parentReflowState,
|
ReflowInput reflowInput(aFrame->PresContext(), parentReflowInput,
|
||||||
aFrame, availSize, &lcbSize);
|
aFrame, availSize, &lcbSize);
|
||||||
nsSize computedSize(reflowState.ComputedWidth(), reflowState.ComputedHeight());
|
nsSize computedSize(reflowInput.ComputedWidth(), reflowInput.ComputedHeight());
|
||||||
computedSize.width += reflowState.ComputedPhysicalBorderPadding().LeftRight();
|
computedSize.width += reflowInput.ComputedPhysicalBorderPadding().LeftRight();
|
||||||
if (computedSize.height != NS_INTRINSICSIZE) {
|
if (computedSize.height != NS_INTRINSICSIZE) {
|
||||||
computedSize.height += reflowState.ComputedPhysicalBorderPadding().TopBottom();
|
computedSize.height += reflowInput.ComputedPhysicalBorderPadding().TopBottom();
|
||||||
}
|
}
|
||||||
nsSize size = aFrame->GetSize();
|
nsSize size = aFrame->GetSize();
|
||||||
// The RecomputePosition hint is not used if any offset changed between auto
|
// The RecomputePosition hint is not used if any offset changed between auto
|
||||||
@@ -550,27 +550,27 @@ RestyleManager::RecomputePosition(nsIFrame* aFrame)
|
|||||||
(computedSize.height == NS_INTRINSICSIZE || computedSize.height == size.height)) {
|
(computedSize.height == NS_INTRINSICSIZE || computedSize.height == size.height)) {
|
||||||
// If we're solving for 'left' or 'top', then compute it here, in order to
|
// If we're solving for 'left' or 'top', then compute it here, in order to
|
||||||
// match the reflow code path.
|
// match the reflow code path.
|
||||||
if (NS_AUTOOFFSET == reflowState.ComputedPhysicalOffsets().left) {
|
if (NS_AUTOOFFSET == reflowInput.ComputedPhysicalOffsets().left) {
|
||||||
reflowState.ComputedPhysicalOffsets().left = cbSize.width -
|
reflowInput.ComputedPhysicalOffsets().left = cbSize.width -
|
||||||
reflowState.ComputedPhysicalOffsets().right -
|
reflowInput.ComputedPhysicalOffsets().right -
|
||||||
reflowState.ComputedPhysicalMargin().right -
|
reflowInput.ComputedPhysicalMargin().right -
|
||||||
size.width -
|
size.width -
|
||||||
reflowState.ComputedPhysicalMargin().left;
|
reflowInput.ComputedPhysicalMargin().left;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NS_AUTOOFFSET == reflowState.ComputedPhysicalOffsets().top) {
|
if (NS_AUTOOFFSET == reflowInput.ComputedPhysicalOffsets().top) {
|
||||||
reflowState.ComputedPhysicalOffsets().top = cbSize.height -
|
reflowInput.ComputedPhysicalOffsets().top = cbSize.height -
|
||||||
reflowState.ComputedPhysicalOffsets().bottom -
|
reflowInput.ComputedPhysicalOffsets().bottom -
|
||||||
reflowState.ComputedPhysicalMargin().bottom -
|
reflowInput.ComputedPhysicalMargin().bottom -
|
||||||
size.height -
|
size.height -
|
||||||
reflowState.ComputedPhysicalMargin().top;
|
reflowInput.ComputedPhysicalMargin().top;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move the frame
|
// Move the frame
|
||||||
nsPoint pos(parentBorder.left + reflowState.ComputedPhysicalOffsets().left +
|
nsPoint pos(parentBorder.left + reflowInput.ComputedPhysicalOffsets().left +
|
||||||
reflowState.ComputedPhysicalMargin().left,
|
reflowInput.ComputedPhysicalMargin().left,
|
||||||
parentBorder.top + reflowState.ComputedPhysicalOffsets().top +
|
parentBorder.top + reflowInput.ComputedPhysicalOffsets().top +
|
||||||
reflowState.ComputedPhysicalMargin().top);
|
reflowInput.ComputedPhysicalMargin().top);
|
||||||
aFrame->SetPosition(pos);
|
aFrame->SetPosition(pos);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ class nsIPercentBSizeObserver
|
|||||||
public:
|
public:
|
||||||
NS_DECL_QUERYFRAME_TARGET(nsIPercentBSizeObserver)
|
NS_DECL_QUERYFRAME_TARGET(nsIPercentBSizeObserver)
|
||||||
|
|
||||||
// Notify the observer that aReflowState has no computed bsize,
|
// Notify the observer that aReflowInput has no computed bsize,
|
||||||
// but it has a percent bsize
|
// but it has a percent bsize
|
||||||
virtual void NotifyPercentBSize(const mozilla::ReflowInput& aReflowState) = 0;
|
virtual void NotifyPercentBSize(const mozilla::ReflowInput& aReflowInput) = 0;
|
||||||
|
|
||||||
// Ask the observer if it should observe aReflowState.frame
|
// Ask the observer if it should observe aReflowInput.frame
|
||||||
virtual bool NeedsToObserve(const mozilla::ReflowInput& aReflowState) = 0;
|
virtual bool NeedsToObserve(const mozilla::ReflowInput& aReflowInput) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // nsIPercentBSizeObserver_h___
|
#endif // nsIPercentBSizeObserver_h___
|
||||||
|
|||||||
@@ -9545,12 +9545,12 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
|
|||||||
// Don't pass size directly to the reflow state, since a
|
// Don't pass size directly to the reflow state, since a
|
||||||
// constrained height implies page/column breaking.
|
// constrained height implies page/column breaking.
|
||||||
LogicalSize reflowSize(wm, size.ISize(wm), NS_UNCONSTRAINEDSIZE);
|
LogicalSize reflowSize(wm, size.ISize(wm), NS_UNCONSTRAINEDSIZE);
|
||||||
ReflowInput reflowState(mPresContext, target, &rcx, reflowSize,
|
ReflowInput reflowInput(mPresContext, target, &rcx, reflowSize,
|
||||||
ReflowInput::CALLER_WILL_INIT);
|
ReflowInput::CALLER_WILL_INIT);
|
||||||
reflowState.mOrthogonalLimit = size.BSize(wm);
|
reflowInput.mOrthogonalLimit = size.BSize(wm);
|
||||||
|
|
||||||
if (rootFrame == target) {
|
if (rootFrame == target) {
|
||||||
reflowState.Init(mPresContext);
|
reflowInput.Init(mPresContext);
|
||||||
|
|
||||||
// When the root frame is being reflowed with unconstrained block-size
|
// When the root frame is being reflowed with unconstrained block-size
|
||||||
// (which happens when we're called from
|
// (which happens when we're called from
|
||||||
@@ -9562,7 +9562,7 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
|
|||||||
bool hasUnconstrainedBSize = size.BSize(wm) == NS_UNCONSTRAINEDSIZE;
|
bool hasUnconstrainedBSize = size.BSize(wm) == NS_UNCONSTRAINEDSIZE;
|
||||||
|
|
||||||
if (hasUnconstrainedBSize || mLastRootReflowHadUnconstrainedBSize) {
|
if (hasUnconstrainedBSize || mLastRootReflowHadUnconstrainedBSize) {
|
||||||
reflowState.SetBResize(true);
|
reflowInput.SetBResize(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
mLastRootReflowHadUnconstrainedBSize = hasUnconstrainedBSize;
|
mLastRootReflowHadUnconstrainedBSize = hasUnconstrainedBSize;
|
||||||
@@ -9572,29 +9572,29 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
|
|||||||
// was reflowed by its parent.
|
// was reflowed by its parent.
|
||||||
nsMargin currentBorder = target->GetUsedBorder();
|
nsMargin currentBorder = target->GetUsedBorder();
|
||||||
nsMargin currentPadding = target->GetUsedPadding();
|
nsMargin currentPadding = target->GetUsedPadding();
|
||||||
reflowState.Init(mPresContext, nullptr, ¤tBorder, ¤tPadding);
|
reflowInput.Init(mPresContext, nullptr, ¤tBorder, ¤tPadding);
|
||||||
}
|
}
|
||||||
|
|
||||||
// fix the computed height
|
// fix the computed height
|
||||||
NS_ASSERTION(reflowState.ComputedPhysicalMargin() == nsMargin(0, 0, 0, 0),
|
NS_ASSERTION(reflowInput.ComputedPhysicalMargin() == nsMargin(0, 0, 0, 0),
|
||||||
"reflow state should not set margin for reflow roots");
|
"reflow state should not set margin for reflow roots");
|
||||||
if (size.BSize(wm) != NS_UNCONSTRAINEDSIZE) {
|
if (size.BSize(wm) != NS_UNCONSTRAINEDSIZE) {
|
||||||
nscoord computedBSize =
|
nscoord computedBSize =
|
||||||
size.BSize(wm) - reflowState.ComputedLogicalBorderPadding().BStartEnd(wm);
|
size.BSize(wm) - reflowInput.ComputedLogicalBorderPadding().BStartEnd(wm);
|
||||||
computedBSize = std::max(computedBSize, 0);
|
computedBSize = std::max(computedBSize, 0);
|
||||||
reflowState.SetComputedBSize(computedBSize);
|
reflowInput.SetComputedBSize(computedBSize);
|
||||||
}
|
}
|
||||||
NS_ASSERTION(reflowState.ComputedISize() ==
|
NS_ASSERTION(reflowInput.ComputedISize() ==
|
||||||
size.ISize(wm) -
|
size.ISize(wm) -
|
||||||
reflowState.ComputedLogicalBorderPadding().IStartEnd(wm),
|
reflowInput.ComputedLogicalBorderPadding().IStartEnd(wm),
|
||||||
"reflow state computed incorrect inline size");
|
"reflow state computed incorrect inline size");
|
||||||
|
|
||||||
mPresContext->ReflowStarted(aInterruptible);
|
mPresContext->ReflowStarted(aInterruptible);
|
||||||
mIsReflowing = true;
|
mIsReflowing = true;
|
||||||
|
|
||||||
nsReflowStatus status;
|
nsReflowStatus status;
|
||||||
ReflowOutput desiredSize(reflowState);
|
ReflowOutput desiredSize(reflowInput);
|
||||||
target->Reflow(mPresContext, desiredSize, reflowState, status);
|
target->Reflow(mPresContext, desiredSize, reflowInput, status);
|
||||||
|
|
||||||
// If an incremental reflow is initiated at a frame other than the
|
// If an incremental reflow is initiated at a frame other than the
|
||||||
// root frame, then its desired size had better not change! If it's
|
// root frame, then its desired size had better not change! If it's
|
||||||
|
|||||||
@@ -418,12 +418,12 @@ public:
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext,
|
nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState)
|
const ReflowInput& aReflowInput)
|
||||||
{
|
{
|
||||||
// All we want out of it later on, really, is the block size of a row, so we
|
// All we want out of it later on, really, is the block size of a row, so we
|
||||||
// don't even need to cache mDropdownFrame's ascent or anything. If we don't
|
// don't even need to cache mDropdownFrame's ascent or anything. If we don't
|
||||||
// need to reflow it, just bail out here.
|
// need to reflow it, just bail out here.
|
||||||
if (!aReflowState.ShouldReflowAllKids() &&
|
if (!aReflowInput.ShouldReflowAllKids() &&
|
||||||
!NS_SUBTREE_DIRTY(mDropdownFrame)) {
|
!NS_SUBTREE_DIRTY(mDropdownFrame)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -432,19 +432,19 @@ nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext,
|
|||||||
// on the appropriate edge for the scrollbar we don't show... but
|
// on the appropriate edge for the scrollbar we don't show... but
|
||||||
// that's the best we can do here for now.
|
// that's the best we can do here for now.
|
||||||
WritingMode wm = mDropdownFrame->GetWritingMode();
|
WritingMode wm = mDropdownFrame->GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.AvailableSize(wm);
|
LogicalSize availSize = aReflowInput.AvailableSize(wm);
|
||||||
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
ReflowInput kidReflowState(aPresContext, aReflowState, mDropdownFrame,
|
ReflowInput kidReflowInput(aPresContext, aReflowInput, mDropdownFrame,
|
||||||
availSize);
|
availSize);
|
||||||
|
|
||||||
// If the dropdown's intrinsic inline size is narrower than our
|
// If the dropdown's intrinsic inline size is narrower than our
|
||||||
// specified inline size, then expand it out. We want our border-box
|
// specified inline size, then expand it out. We want our border-box
|
||||||
// inline size to end up the same as the dropdown's so account for
|
// inline size to end up the same as the dropdown's so account for
|
||||||
// both sets of mComputedBorderPadding.
|
// both sets of mComputedBorderPadding.
|
||||||
nscoord forcedISize = aReflowState.ComputedISize() +
|
nscoord forcedISize = aReflowInput.ComputedISize() +
|
||||||
aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm) -
|
aReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm) -
|
||||||
kidReflowState.ComputedLogicalBorderPadding().IStartEnd(wm);
|
kidReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm);
|
||||||
kidReflowState.SetComputedISize(std::max(kidReflowState.ComputedISize(),
|
kidReflowInput.SetComputedISize(std::max(kidReflowInput.ComputedISize(),
|
||||||
forcedISize));
|
forcedISize));
|
||||||
|
|
||||||
// ensure we start off hidden
|
// ensure we start off hidden
|
||||||
@@ -470,14 +470,14 @@ nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext,
|
|||||||
// by AbsolutelyPositionDropDown().
|
// by AbsolutelyPositionDropDown().
|
||||||
WritingMode outerWM = GetWritingMode();
|
WritingMode outerWM = GetWritingMode();
|
||||||
const nsSize dummyContainerSize;
|
const nsSize dummyContainerSize;
|
||||||
ReflowOutput desiredSize(aReflowState);
|
ReflowOutput desiredSize(aReflowInput);
|
||||||
nsReflowStatus ignoredStatus;
|
nsReflowStatus ignoredStatus;
|
||||||
ReflowChild(mDropdownFrame, aPresContext, desiredSize,
|
ReflowChild(mDropdownFrame, aPresContext, desiredSize,
|
||||||
kidReflowState, outerWM, LogicalPoint(outerWM),
|
kidReflowInput, outerWM, LogicalPoint(outerWM),
|
||||||
dummyContainerSize, flags, ignoredStatus);
|
dummyContainerSize, flags, ignoredStatus);
|
||||||
|
|
||||||
// Set the child's width and height to its desired size
|
// Set the child's width and height to its desired size
|
||||||
FinishReflowChild(mDropdownFrame, aPresContext, desiredSize, &kidReflowState,
|
FinishReflowChild(mDropdownFrame, aPresContext, desiredSize, &kidReflowInput,
|
||||||
outerWM, LogicalPoint(outerWM), dummyContainerSize, flags);
|
outerWM, LogicalPoint(outerWM), dummyContainerSize, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -809,7 +809,7 @@ nsComboboxControlFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
|
|||||||
void
|
void
|
||||||
nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
@@ -848,7 +848,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// First reflow our dropdown so that we know how tall we should be.
|
// First reflow our dropdown so that we know how tall we should be.
|
||||||
ReflowDropdown(aPresContext, aReflowState);
|
ReflowDropdown(aPresContext, aReflowInput);
|
||||||
RefPtr<nsResizeDropdownAtFinalPosition> resize =
|
RefPtr<nsResizeDropdownAtFinalPosition> resize =
|
||||||
new nsResizeDropdownAtFinalPosition(this);
|
new nsResizeDropdownAtFinalPosition(this);
|
||||||
if (NS_SUCCEEDED(aPresContext->PresShell()->PostReflowCallback(resize))) {
|
if (NS_SUCCEEDED(aPresContext->PresShell()->PostReflowCallback(resize))) {
|
||||||
@@ -859,7 +859,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Get the width of the vertical scrollbar. That will be the inline
|
// Get the width of the vertical scrollbar. That will be the inline
|
||||||
// size of the dropdown button.
|
// size of the dropdown button.
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
nscoord buttonISize;
|
nscoord buttonISize;
|
||||||
const nsStyleDisplay *disp = StyleDisplay();
|
const nsStyleDisplay *disp = StyleDisplay();
|
||||||
if ((IsThemed(disp) && !aPresContext->GetTheme()->ThemeNeedsComboboxDropmarker()) ||
|
if ((IsThemed(disp) && !aPresContext->GetTheme()->ThemeNeedsComboboxDropmarker()) ||
|
||||||
@@ -870,25 +870,25 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame);
|
nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame);
|
||||||
NS_ASSERTION(scrollable, "List must be a scrollable frame");
|
NS_ASSERTION(scrollable, "List must be a scrollable frame");
|
||||||
buttonISize = scrollable->GetNondisappearingScrollbarWidth(
|
buttonISize = scrollable->GetNondisappearingScrollbarWidth(
|
||||||
PresContext(), aReflowState.mRenderingContext, wm);
|
PresContext(), aReflowInput.mRenderingContext, wm);
|
||||||
if (buttonISize > aReflowState.ComputedISize()) {
|
if (buttonISize > aReflowInput.ComputedISize()) {
|
||||||
buttonISize = 0;
|
buttonISize = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mDisplayISize = aReflowState.ComputedISize() - buttonISize;
|
mDisplayISize = aReflowInput.ComputedISize() - buttonISize;
|
||||||
|
|
||||||
nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
|
|
||||||
// The button should occupy the same space as a scrollbar
|
// The button should occupy the same space as a scrollbar
|
||||||
nsSize containerSize = aDesiredSize.PhysicalSize();
|
nsSize containerSize = aDesiredSize.PhysicalSize();
|
||||||
LogicalRect buttonRect = mButtonFrame->GetLogicalRect(containerSize);
|
LogicalRect buttonRect = mButtonFrame->GetLogicalRect(containerSize);
|
||||||
|
|
||||||
buttonRect.IStart(wm) =
|
buttonRect.IStart(wm) =
|
||||||
aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm) +
|
aReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm) +
|
||||||
mDisplayISize -
|
mDisplayISize -
|
||||||
(aReflowState.ComputedLogicalBorderPadding().IEnd(wm) -
|
(aReflowInput.ComputedLogicalBorderPadding().IEnd(wm) -
|
||||||
aReflowState.ComputedLogicalPadding().IEnd(wm));
|
aReflowInput.ComputedLogicalPadding().IEnd(wm));
|
||||||
buttonRect.ISize(wm) = buttonISize;
|
buttonRect.ISize(wm) = buttonISize;
|
||||||
|
|
||||||
buttonRect.BStart(wm) = this->GetLogicalUsedBorder(wm).BStart(wm);
|
buttonRect.BStart(wm) = this->GetLogicalUsedBorder(wm).BStart(wm);
|
||||||
@@ -1287,7 +1287,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
@@ -1309,17 +1309,17 @@ nsComboboxDisplayFrame::GetType() const
|
|||||||
void
|
void
|
||||||
nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext,
|
nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
ReflowInput state(aReflowState);
|
ReflowInput state(aReflowInput);
|
||||||
if (state.ComputedBSize() == NS_INTRINSICSIZE) {
|
if (state.ComputedBSize() == NS_INTRINSICSIZE) {
|
||||||
// Note that the only way we can have a computed block size here is
|
// Note that the only way we can have a computed block size here is
|
||||||
// if the combobox had a specified block size. If it didn't, size
|
// if the combobox had a specified block size. If it didn't, size
|
||||||
// based on what our rows look like, for lack of anything better.
|
// based on what our rows look like, for lack of anything better.
|
||||||
state.SetComputedBSize(mComboBox->mListControlFrame->GetBSizeOfARow());
|
state.SetComputedBSize(mComboBox->mListControlFrame->GetBSizeOfARow());
|
||||||
}
|
}
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
nscoord computedISize = mComboBox->mDisplayISize -
|
nscoord computedISize = mComboBox->mDisplayISize -
|
||||||
state.ComputedLogicalBorderPadding().IStartEnd(wm);
|
state.ComputedLogicalBorderPadding().IStartEnd(wm);
|
||||||
if (computedISize < 0) {
|
if (computedISize < 0) {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aCX,
|
virtual void Reflow(nsPresContext* aCX,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
||||||
@@ -217,7 +217,7 @@ protected:
|
|||||||
|
|
||||||
// Utilities
|
// Utilities
|
||||||
void ReflowDropdown(nsPresContext* aPresContext,
|
void ReflowDropdown(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState);
|
const ReflowInput& aReflowInput);
|
||||||
|
|
||||||
enum DropDownPositionState {
|
enum DropDownPositionState {
|
||||||
// can't show the dropdown at its current position
|
// can't show the dropdown at its current position
|
||||||
|
|||||||
@@ -384,14 +384,14 @@ nsFieldSetFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
|||||||
void
|
void
|
||||||
nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsFieldSetFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsFieldSetFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
NS_PRECONDITION(aReflowState.ComputedISize() != NS_INTRINSICSIZE,
|
NS_PRECONDITION(aReflowInput.ComputedISize() != NS_INTRINSICSIZE,
|
||||||
"Should have a precomputed inline-size!");
|
"Should have a precomputed inline-size!");
|
||||||
|
|
||||||
// Initialize OUT parameter
|
// Initialize OUT parameter
|
||||||
@@ -400,7 +400,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsOverflowAreas ocBounds;
|
nsOverflowAreas ocBounds;
|
||||||
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
||||||
if (GetPrevInFlow()) {
|
if (GetPrevInFlow()) {
|
||||||
ReflowOverflowContainerChildren(aPresContext, aReflowState, ocBounds, 0,
|
ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0,
|
||||||
ocStatus);
|
ocStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,7 +409,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
bool reflowLegend;
|
bool reflowLegend;
|
||||||
nsIFrame* legend = GetLegend();
|
nsIFrame* legend = GetLegend();
|
||||||
nsIFrame* inner = GetInner();
|
nsIFrame* inner = GetInner();
|
||||||
if (aReflowState.ShouldReflowAllKids()) {
|
if (aReflowInput.ShouldReflowAllKids()) {
|
||||||
reflowInner = inner != nullptr;
|
reflowInner = inner != nullptr;
|
||||||
reflowLegend = legend != nullptr;
|
reflowLegend = legend != nullptr;
|
||||||
} else {
|
} else {
|
||||||
@@ -424,43 +424,43 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
WritingMode wm = GetWritingMode();
|
WritingMode wm = GetWritingMode();
|
||||||
WritingMode innerWM = inner ? inner->GetWritingMode() : wm;
|
WritingMode innerWM = inner ? inner->GetWritingMode() : wm;
|
||||||
WritingMode legendWM = legend ? legend->GetWritingMode() : wm;
|
WritingMode legendWM = legend ? legend->GetWritingMode() : wm;
|
||||||
LogicalSize innerAvailSize = aReflowState.ComputedSizeWithPadding(innerWM);
|
LogicalSize innerAvailSize = aReflowInput.ComputedSizeWithPadding(innerWM);
|
||||||
LogicalSize legendAvailSize = aReflowState.ComputedSizeWithPadding(legendWM);
|
LogicalSize legendAvailSize = aReflowInput.ComputedSizeWithPadding(legendWM);
|
||||||
innerAvailSize.BSize(innerWM) = legendAvailSize.BSize(legendWM) =
|
innerAvailSize.BSize(innerWM) = legendAvailSize.BSize(legendWM) =
|
||||||
NS_UNCONSTRAINEDSIZE;
|
NS_UNCONSTRAINEDSIZE;
|
||||||
NS_ASSERTION(!inner ||
|
NS_ASSERTION(!inner ||
|
||||||
nsLayoutUtils::IntrinsicForContainer(aReflowState.mRenderingContext,
|
nsLayoutUtils::IntrinsicForContainer(aReflowInput.mRenderingContext,
|
||||||
inner,
|
inner,
|
||||||
nsLayoutUtils::MIN_ISIZE) <=
|
nsLayoutUtils::MIN_ISIZE) <=
|
||||||
innerAvailSize.ISize(innerWM),
|
innerAvailSize.ISize(innerWM),
|
||||||
"Bogus availSize.ISize; should be bigger");
|
"Bogus availSize.ISize; should be bigger");
|
||||||
NS_ASSERTION(!legend ||
|
NS_ASSERTION(!legend ||
|
||||||
nsLayoutUtils::IntrinsicForContainer(aReflowState.mRenderingContext,
|
nsLayoutUtils::IntrinsicForContainer(aReflowInput.mRenderingContext,
|
||||||
legend,
|
legend,
|
||||||
nsLayoutUtils::MIN_ISIZE) <=
|
nsLayoutUtils::MIN_ISIZE) <=
|
||||||
legendAvailSize.ISize(legendWM),
|
legendAvailSize.ISize(legendWM),
|
||||||
"Bogus availSize.ISize; should be bigger");
|
"Bogus availSize.ISize; should be bigger");
|
||||||
|
|
||||||
// get our border and padding
|
// get our border and padding
|
||||||
LogicalMargin border = aReflowState.ComputedLogicalBorderPadding() -
|
LogicalMargin border = aReflowInput.ComputedLogicalBorderPadding() -
|
||||||
aReflowState.ComputedLogicalPadding();
|
aReflowInput.ComputedLogicalPadding();
|
||||||
|
|
||||||
// Figure out how big the legend is if there is one.
|
// Figure out how big the legend is if there is one.
|
||||||
// get the legend's margin
|
// get the legend's margin
|
||||||
LogicalMargin legendMargin(wm);
|
LogicalMargin legendMargin(wm);
|
||||||
// reflow the legend only if needed
|
// reflow the legend only if needed
|
||||||
Maybe<ReflowInput> legendReflowState;
|
Maybe<ReflowInput> legendReflowInput;
|
||||||
if (legend) {
|
if (legend) {
|
||||||
legendReflowState.emplace(aPresContext, aReflowState, legend,
|
legendReflowInput.emplace(aPresContext, aReflowInput, legend,
|
||||||
legendAvailSize);
|
legendAvailSize);
|
||||||
}
|
}
|
||||||
if (reflowLegend) {
|
if (reflowLegend) {
|
||||||
ReflowOutput legendDesiredSize(aReflowState);
|
ReflowOutput legendDesiredSize(aReflowInput);
|
||||||
|
|
||||||
// We'll move the legend to its proper place later, so the position
|
// We'll move the legend to its proper place later, so the position
|
||||||
// and containerSize passed here are unimportant.
|
// and containerSize passed here are unimportant.
|
||||||
const nsSize dummyContainerSize;
|
const nsSize dummyContainerSize;
|
||||||
ReflowChild(legend, aPresContext, legendDesiredSize, *legendReflowState,
|
ReflowChild(legend, aPresContext, legendDesiredSize, *legendReflowInput,
|
||||||
wm, LogicalPoint(wm), dummyContainerSize,
|
wm, LogicalPoint(wm), dummyContainerSize,
|
||||||
NS_FRAME_NO_MOVE_FRAME, aStatus);
|
NS_FRAME_NO_MOVE_FRAME, aStatus);
|
||||||
#ifdef NOISY_REFLOW
|
#ifdef NOISY_REFLOW
|
||||||
@@ -490,7 +490,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
FinishReflowChild(legend, aPresContext, legendDesiredSize,
|
FinishReflowChild(legend, aPresContext, legendDesiredSize,
|
||||||
legendReflowState.ptr(), wm, LogicalPoint(wm),
|
legendReflowInput.ptr(), wm, LogicalPoint(wm),
|
||||||
dummyContainerSize, NS_FRAME_NO_MOVE_FRAME);
|
dummyContainerSize, NS_FRAME_NO_MOVE_FRAME);
|
||||||
} else if (!legend) {
|
} else if (!legend) {
|
||||||
mLegendRect.SetEmpty();
|
mLegendRect.SetEmpty();
|
||||||
@@ -507,34 +507,34 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
border.Size(wm)).GetPhysicalSize(wm);
|
border.Size(wm)).GetPhysicalSize(wm);
|
||||||
// reflow the content frame only if needed
|
// reflow the content frame only if needed
|
||||||
if (reflowInner) {
|
if (reflowInner) {
|
||||||
ReflowInput kidReflowState(aPresContext, aReflowState, inner,
|
ReflowInput kidReflowInput(aPresContext, aReflowInput, inner,
|
||||||
innerAvailSize, nullptr,
|
innerAvailSize, nullptr,
|
||||||
ReflowInput::CALLER_WILL_INIT);
|
ReflowInput::CALLER_WILL_INIT);
|
||||||
// Override computed padding, in case it's percentage padding
|
// Override computed padding, in case it's percentage padding
|
||||||
kidReflowState.Init(aPresContext, nullptr, nullptr,
|
kidReflowInput.Init(aPresContext, nullptr, nullptr,
|
||||||
&aReflowState.ComputedPhysicalPadding());
|
&aReflowInput.ComputedPhysicalPadding());
|
||||||
// Our child is "height:100%" but we actually want its height to be reduced
|
// Our child is "height:100%" but we actually want its height to be reduced
|
||||||
// by the amount of content-height the legend is eating up, unless our
|
// by the amount of content-height the legend is eating up, unless our
|
||||||
// height is unconstrained (in which case the child's will be too).
|
// height is unconstrained (in which case the child's will be too).
|
||||||
if (aReflowState.ComputedBSize() != NS_UNCONSTRAINEDSIZE) {
|
if (aReflowInput.ComputedBSize() != NS_UNCONSTRAINEDSIZE) {
|
||||||
kidReflowState.SetComputedBSize(
|
kidReflowInput.SetComputedBSize(
|
||||||
std::max(0, aReflowState.ComputedBSize() - mLegendSpace));
|
std::max(0, aReflowInput.ComputedBSize() - mLegendSpace));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aReflowState.ComputedMinBSize() > 0) {
|
if (aReflowInput.ComputedMinBSize() > 0) {
|
||||||
kidReflowState.ComputedMinBSize() =
|
kidReflowInput.ComputedMinBSize() =
|
||||||
std::max(0, aReflowState.ComputedMinBSize() - mLegendSpace);
|
std::max(0, aReflowInput.ComputedMinBSize() - mLegendSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aReflowState.ComputedMaxBSize() != NS_UNCONSTRAINEDSIZE) {
|
if (aReflowInput.ComputedMaxBSize() != NS_UNCONSTRAINEDSIZE) {
|
||||||
kidReflowState.ComputedMaxBSize() =
|
kidReflowInput.ComputedMaxBSize() =
|
||||||
std::max(0, aReflowState.ComputedMaxBSize() - mLegendSpace);
|
std::max(0, aReflowInput.ComputedMaxBSize() - mLegendSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReflowOutput kidDesiredSize(kidReflowState,
|
ReflowOutput kidDesiredSize(kidReflowInput,
|
||||||
aDesiredSize.mFlags);
|
aDesiredSize.mFlags);
|
||||||
// Reflow the frame
|
// Reflow the frame
|
||||||
NS_ASSERTION(kidReflowState.ComputedPhysicalMargin() == nsMargin(0,0,0,0),
|
NS_ASSERTION(kidReflowInput.ComputedPhysicalMargin() == nsMargin(0,0,0,0),
|
||||||
"Margins on anonymous fieldset child not supported!");
|
"Margins on anonymous fieldset child not supported!");
|
||||||
LogicalPoint pt(wm, border.IStart(wm), border.BStart(wm) + mLegendSpace);
|
LogicalPoint pt(wm, border.IStart(wm), border.BStart(wm) + mLegendSpace);
|
||||||
|
|
||||||
@@ -542,14 +542,14 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// so we use a dummy value for now; FinishReflowChild will fix the position
|
// so we use a dummy value for now; FinishReflowChild will fix the position
|
||||||
// if necessary.
|
// if necessary.
|
||||||
const nsSize dummyContainerSize;
|
const nsSize dummyContainerSize;
|
||||||
ReflowChild(inner, aPresContext, kidDesiredSize, kidReflowState,
|
ReflowChild(inner, aPresContext, kidDesiredSize, kidReflowInput,
|
||||||
wm, pt, dummyContainerSize, 0, aStatus);
|
wm, pt, dummyContainerSize, 0, 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,
|
||||||
&kidReflowState, wm, pt, containerSize, 0);
|
&kidReflowInput, wm, pt, containerSize, 0);
|
||||||
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
|
||||||
@@ -566,7 +566,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Our content rect must fill up the available width
|
// Our content rect must fill up the available width
|
||||||
LogicalSize availSize = aReflowState.ComputedSizeWithPadding(wm);
|
LogicalSize availSize = aReflowInput.ComputedSizeWithPadding(wm);
|
||||||
if (availSize.ISize(wm) > contentRect.ISize(wm)) {
|
if (availSize.ISize(wm) > contentRect.ISize(wm)) {
|
||||||
contentRect.ISize(wm) = innerAvailSize.ISize(wm);
|
contentRect.ISize(wm) = innerAvailSize.ISize(wm);
|
||||||
}
|
}
|
||||||
@@ -575,7 +575,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// The legend is positioned inline-wards within the inner's content rect
|
// The legend is positioned inline-wards within the inner's content rect
|
||||||
// (so that padding on the fieldset affects the legend position).
|
// (so that padding on the fieldset affects the legend position).
|
||||||
LogicalRect innerContentRect = contentRect;
|
LogicalRect innerContentRect = contentRect;
|
||||||
innerContentRect.Deflate(wm, aReflowState.ComputedLogicalPadding());
|
innerContentRect.Deflate(wm, aReflowInput.ComputedLogicalPadding());
|
||||||
// If the inner content rect is larger than the legend, we can align the
|
// If the inner content rect is larger than the legend, we can align the
|
||||||
// legend.
|
// legend.
|
||||||
if (innerContentRect.ISize(wm) > mLegendRect.ISize(wm)) {
|
if (innerContentRect.ISize(wm) > mLegendRect.ISize(wm)) {
|
||||||
@@ -607,7 +607,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
mLegendRect.IStart(wm) = innerContentRect.IStart(wm);
|
mLegendRect.IStart(wm) = innerContentRect.IStart(wm);
|
||||||
innerContentRect.ISize(wm) = mLegendRect.ISize(wm);
|
innerContentRect.ISize(wm) = mLegendRect.ISize(wm);
|
||||||
contentRect.ISize(wm) = mLegendRect.ISize(wm) +
|
contentRect.ISize(wm) = mLegendRect.ISize(wm) +
|
||||||
aReflowState.ComputedLogicalPadding().IStartEnd(wm);
|
aReflowInput.ComputedLogicalPadding().IStartEnd(wm);
|
||||||
}
|
}
|
||||||
|
|
||||||
// place the legend
|
// place the legend
|
||||||
@@ -618,8 +618,8 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// Note that legend's writing mode may be different from the fieldset's,
|
// Note that legend's writing mode may be different from the fieldset's,
|
||||||
// so we need to convert offsets before applying them to it (bug 1134534).
|
// so we need to convert offsets before applying them to it (bug 1134534).
|
||||||
LogicalMargin offsets =
|
LogicalMargin offsets =
|
||||||
legendReflowState->ComputedLogicalOffsets().
|
legendReflowInput->ComputedLogicalOffsets().
|
||||||
ConvertTo(wm, legendReflowState->GetWritingMode());
|
ConvertTo(wm, legendReflowInput->GetWritingMode());
|
||||||
ReflowInput::ApplyRelativePositioning(legend, wm, offsets,
|
ReflowInput::ApplyRelativePositioning(legend, wm, offsets,
|
||||||
&actualLegendPos,
|
&actualLegendPos,
|
||||||
containerSize);
|
containerSize);
|
||||||
@@ -647,11 +647,11 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
aDesiredSize.mOverflowAreas.UnionWith(ocBounds);
|
aDesiredSize.mOverflowAreas.UnionWith(ocBounds);
|
||||||
NS_MergeReflowStatusInto(&aStatus, ocStatus);
|
NS_MergeReflowStatusInto(&aStatus, ocStatus);
|
||||||
|
|
||||||
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus);
|
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
|
|
||||||
InvalidateFrame();
|
InvalidateFrame();
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
|
|||||||
@@ -115,23 +115,23 @@ nsFormControlFrame::GetLogicalBaseline(WritingMode aWritingMode) const
|
|||||||
void
|
void
|
||||||
nsFormControlFrame::Reflow(nsPresContext* aPresContext,
|
nsFormControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsFormControlFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsFormControlFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("enter nsFormControlFrame::Reflow: aMaxSize=%d,%d",
|
("enter nsFormControlFrame::Reflow: aMaxSize=%d,%d",
|
||||||
aReflowState.AvailableWidth(), aReflowState.AvailableHeight()));
|
aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight()));
|
||||||
|
|
||||||
if (mState & NS_FRAME_FIRST_REFLOW) {
|
if (mState & NS_FRAME_FIRST_REFLOW) {
|
||||||
RegUnRegAccessKey(static_cast<nsIFrame*>(this), true);
|
RegUnRegAccessKey(static_cast<nsIFrame*>(this), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
aDesiredSize.SetSize(aReflowState.GetWritingMode(),
|
aDesiredSize.SetSize(aReflowInput.GetWritingMode(),
|
||||||
aReflowState.ComputedSizeWithBorderPadding());
|
aReflowInput.ComputedSizeWithBorderPadding());
|
||||||
|
|
||||||
if (nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) {
|
if (nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) {
|
||||||
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
|
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
|
||||||
@@ -142,7 +142,7 @@ nsFormControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("exit nsFormControlFrame::Reflow: size=%d,%d",
|
("exit nsFormControlFrame::Reflow: size=%d,%d",
|
||||||
aDesiredSize.Width(), aDesiredSize.Height()));
|
aDesiredSize.Width(), aDesiredSize.Height()));
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
|
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
FinishAndStoreOverflow(&aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void Reflow(nsPresContext* aCX,
|
virtual void Reflow(nsPresContext* aCX,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
|
||||||
|
|||||||
@@ -185,14 +185,14 @@ nsHTMLButtonControlFrame::GetPrefISize(nsRenderingContext* aRenderingContext)
|
|||||||
void
|
void
|
||||||
nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsHTMLButtonControlFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsHTMLButtonControlFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
NS_PRECONDITION(aReflowState.ComputedISize() != NS_INTRINSICSIZE,
|
NS_PRECONDITION(aReflowInput.ComputedISize() != NS_INTRINSICSIZE,
|
||||||
"Should have real computed inline-size by now");
|
"Should have real computed inline-size by now");
|
||||||
|
|
||||||
if (mState & NS_FRAME_FIRST_REFLOW) {
|
if (mState & NS_FRAME_FIRST_REFLOW) {
|
||||||
@@ -210,14 +210,14 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
"Button's child frame has unexpected pseudo type!");
|
"Button's child frame has unexpected pseudo type!");
|
||||||
|
|
||||||
// XXXbz Eventually we may want to check-and-bail if
|
// XXXbz Eventually we may want to check-and-bail if
|
||||||
// !aReflowState.ShouldReflowAllKids() &&
|
// !aReflowInput.ShouldReflowAllKids() &&
|
||||||
// !NS_SUBTREE_DIRTY(firstKid).
|
// !NS_SUBTREE_DIRTY(firstKid).
|
||||||
// We'd need to cache our ascent for that, of course.
|
// We'd need to cache our ascent for that, of course.
|
||||||
|
|
||||||
// Reflow the contents of the button.
|
// Reflow the contents of the button.
|
||||||
// (This populates our aDesiredSize, too.)
|
// (This populates our aDesiredSize, too.)
|
||||||
ReflowButtonContents(aPresContext, aDesiredSize,
|
ReflowButtonContents(aPresContext, aDesiredSize,
|
||||||
aReflowState, firstKid);
|
aReflowInput, firstKid);
|
||||||
|
|
||||||
if (!ShouldClipPaintingToBorderBox()) {
|
if (!ShouldClipPaintingToBorderBox()) {
|
||||||
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, firstKid);
|
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, firstKid);
|
||||||
@@ -227,14 +227,14 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize,
|
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize,
|
||||||
aReflowState, aStatus);
|
aReflowInput, aStatus);
|
||||||
|
|
||||||
// We're always complete and we don't support overflow containers
|
// We're always complete and we don't support overflow containers
|
||||||
// so we shouldn't have a next-in-flow ever.
|
// so we shouldn't have a next-in-flow ever.
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
MOZ_ASSERT(!GetNextInFlow());
|
MOZ_ASSERT(!GetNextInFlow());
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper-function that lets us clone the button's reflow state, but with its
|
// Helper-function that lets us clone the button's reflow state, but with its
|
||||||
@@ -243,22 +243,22 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// appropriate content-box size for descendents' percent sizes to resolve
|
// appropriate content-box size for descendents' percent sizes to resolve
|
||||||
// against.)
|
// against.)
|
||||||
static ReflowInput
|
static ReflowInput
|
||||||
CloneReflowStateWithReducedContentBox(
|
CloneReflowInputWithReducedContentBox(
|
||||||
const ReflowInput& aButtonReflowState,
|
const ReflowInput& aButtonReflowInput,
|
||||||
const nsMargin& aFocusPadding)
|
const nsMargin& aFocusPadding)
|
||||||
{
|
{
|
||||||
nscoord adjustedWidth =
|
nscoord adjustedWidth =
|
||||||
aButtonReflowState.ComputedWidth() - aFocusPadding.LeftRight();
|
aButtonReflowInput.ComputedWidth() - aFocusPadding.LeftRight();
|
||||||
adjustedWidth = std::max(0, adjustedWidth);
|
adjustedWidth = std::max(0, adjustedWidth);
|
||||||
|
|
||||||
// (Only adjust height if it's an actual length.)
|
// (Only adjust height if it's an actual length.)
|
||||||
nscoord adjustedHeight = aButtonReflowState.ComputedHeight();
|
nscoord adjustedHeight = aButtonReflowInput.ComputedHeight();
|
||||||
if (adjustedHeight != NS_INTRINSICSIZE) {
|
if (adjustedHeight != NS_INTRINSICSIZE) {
|
||||||
adjustedHeight -= aFocusPadding.TopBottom();
|
adjustedHeight -= aFocusPadding.TopBottom();
|
||||||
adjustedHeight = std::max(0, adjustedHeight);
|
adjustedHeight = std::max(0, adjustedHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReflowInput clone(aButtonReflowState);
|
ReflowInput clone(aButtonReflowInput);
|
||||||
clone.SetComputedWidth(adjustedWidth);
|
clone.SetComputedWidth(adjustedWidth);
|
||||||
clone.SetComputedHeight(adjustedHeight);
|
clone.SetComputedHeight(adjustedHeight);
|
||||||
|
|
||||||
@@ -268,11 +268,11 @@ CloneReflowStateWithReducedContentBox(
|
|||||||
void
|
void
|
||||||
nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aButtonDesiredSize,
|
ReflowOutput& aButtonDesiredSize,
|
||||||
const ReflowInput& aButtonReflowState,
|
const ReflowInput& aButtonReflowInput,
|
||||||
nsIFrame* aFirstKid)
|
nsIFrame* aFirstKid)
|
||||||
{
|
{
|
||||||
WritingMode wm = GetWritingMode();
|
WritingMode wm = GetWritingMode();
|
||||||
LogicalSize availSize = aButtonReflowState.ComputedSize(wm);
|
LogicalSize availSize = aButtonReflowInput.ComputedSize(wm);
|
||||||
availSize.BSize(wm) = NS_INTRINSICSIZE;
|
availSize.BSize(wm) = NS_INTRINSICSIZE;
|
||||||
|
|
||||||
// Buttons have some bonus renderer-determined border/padding,
|
// Buttons have some bonus renderer-determined border/padding,
|
||||||
@@ -286,8 +286,8 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
|||||||
// focuspadding (which other browsers don't have) so that there's a
|
// focuspadding (which other browsers don't have) so that there's a
|
||||||
// little more space for it.
|
// little more space for it.
|
||||||
// Note that GetMinISize includes the focusPadding.
|
// Note that GetMinISize includes the focusPadding.
|
||||||
nscoord IOverflow = GetMinISize(aButtonReflowState.mRenderingContext) -
|
nscoord IOverflow = GetMinISize(aButtonReflowInput.mRenderingContext) -
|
||||||
aButtonReflowState.ComputedISize();
|
aButtonReflowInput.ComputedISize();
|
||||||
nscoord IFocusPadding = focusPadding.IStartEnd(wm);
|
nscoord IFocusPadding = focusPadding.IStartEnd(wm);
|
||||||
nscoord focusPaddingReduction = std::min(IFocusPadding,
|
nscoord focusPaddingReduction = std::min(IFocusPadding,
|
||||||
std::max(IOverflow, 0));
|
std::max(IOverflow, 0));
|
||||||
@@ -303,7 +303,7 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// shorthand for a value we need to use in a bunch of places
|
// shorthand for a value we need to use in a bunch of places
|
||||||
const LogicalMargin& clbp = aButtonReflowState.ComputedLogicalBorderPadding();
|
const LogicalMargin& clbp = aButtonReflowInput.ComputedLogicalBorderPadding();
|
||||||
|
|
||||||
// Indent the child inside us by the focus border. We must do this separate
|
// Indent the child inside us by the focus border. We must do this separate
|
||||||
// from the regular border.
|
// from the regular border.
|
||||||
@@ -315,16 +315,16 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Give child a clone of the button's reflow state, with height/width reduced
|
// Give child a clone of the button's reflow state, with height/width reduced
|
||||||
// by focusPadding, so that descendants with height:100% don't protrude.
|
// by focusPadding, so that descendants with height:100% don't protrude.
|
||||||
ReflowInput adjustedButtonReflowState =
|
ReflowInput adjustedButtonReflowInput =
|
||||||
CloneReflowStateWithReducedContentBox(aButtonReflowState,
|
CloneReflowInputWithReducedContentBox(aButtonReflowInput,
|
||||||
focusPadding.GetPhysicalMargin(wm));
|
focusPadding.GetPhysicalMargin(wm));
|
||||||
|
|
||||||
ReflowInput contentsReflowState(aPresContext,
|
ReflowInput contentsReflowInput(aPresContext,
|
||||||
adjustedButtonReflowState,
|
adjustedButtonReflowInput,
|
||||||
aFirstKid, availSize);
|
aFirstKid, availSize);
|
||||||
|
|
||||||
nsReflowStatus contentsReflowStatus;
|
nsReflowStatus contentsReflowStatus;
|
||||||
ReflowOutput contentsDesiredSize(aButtonReflowState);
|
ReflowOutput contentsDesiredSize(aButtonReflowInput);
|
||||||
childPos.B(wm) = 0; // This will be set properly later, after reflowing the
|
childPos.B(wm) = 0; // This will be set properly later, after reflowing the
|
||||||
// child to determine its size.
|
// child to determine its size.
|
||||||
|
|
||||||
@@ -332,7 +332,7 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
|||||||
// repositioned later by FinishReflowChild.
|
// repositioned later by FinishReflowChild.
|
||||||
nsSize dummyContainerSize;
|
nsSize dummyContainerSize;
|
||||||
ReflowChild(aFirstKid, aPresContext,
|
ReflowChild(aFirstKid, aPresContext,
|
||||||
contentsDesiredSize, contentsReflowState,
|
contentsDesiredSize, contentsReflowInput,
|
||||||
wm, childPos, dummyContainerSize, 0, contentsReflowStatus);
|
wm, childPos, dummyContainerSize, 0, 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, "
|
||||||
@@ -340,9 +340,9 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Compute the button's content-box size:
|
// Compute the button's content-box size:
|
||||||
LogicalSize buttonContentBox(wm);
|
LogicalSize buttonContentBox(wm);
|
||||||
if (aButtonReflowState.ComputedBSize() != NS_INTRINSICSIZE) {
|
if (aButtonReflowInput.ComputedBSize() != NS_INTRINSICSIZE) {
|
||||||
// Button has a fixed block-size -- that's its content-box bSize.
|
// Button has a fixed block-size -- that's its content-box bSize.
|
||||||
buttonContentBox.BSize(wm) = aButtonReflowState.ComputedBSize();
|
buttonContentBox.BSize(wm) = aButtonReflowInput.ComputedBSize();
|
||||||
} else {
|
} else {
|
||||||
// Button is intrinsically sized -- it should shrinkwrap the
|
// Button is intrinsically sized -- it should shrinkwrap the
|
||||||
// button-contents' bSize, plus any focus-padding space:
|
// button-contents' bSize, plus any focus-padding space:
|
||||||
@@ -351,23 +351,23 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Make sure we obey min/max-bSize in the case when we're doing intrinsic
|
// Make sure we obey min/max-bSize in the case when we're doing intrinsic
|
||||||
// sizing (we get it for free when we have a non-intrinsic
|
// sizing (we get it for free when we have a non-intrinsic
|
||||||
// aButtonReflowState.ComputedBSize()). Note that we do this before
|
// aButtonReflowInput.ComputedBSize()). Note that we do this before
|
||||||
// adjusting for borderpadding, since mComputedMaxBSize and
|
// adjusting for borderpadding, since mComputedMaxBSize and
|
||||||
// mComputedMinBSize are content bSizes.
|
// mComputedMinBSize are content bSizes.
|
||||||
buttonContentBox.BSize(wm) =
|
buttonContentBox.BSize(wm) =
|
||||||
NS_CSS_MINMAX(buttonContentBox.BSize(wm),
|
NS_CSS_MINMAX(buttonContentBox.BSize(wm),
|
||||||
aButtonReflowState.ComputedMinBSize(),
|
aButtonReflowInput.ComputedMinBSize(),
|
||||||
aButtonReflowState.ComputedMaxBSize());
|
aButtonReflowInput.ComputedMaxBSize());
|
||||||
}
|
}
|
||||||
if (aButtonReflowState.ComputedISize() != NS_INTRINSICSIZE) {
|
if (aButtonReflowInput.ComputedISize() != NS_INTRINSICSIZE) {
|
||||||
buttonContentBox.ISize(wm) = aButtonReflowState.ComputedISize();
|
buttonContentBox.ISize(wm) = aButtonReflowInput.ComputedISize();
|
||||||
} else {
|
} else {
|
||||||
buttonContentBox.ISize(wm) =
|
buttonContentBox.ISize(wm) =
|
||||||
contentsDesiredSize.ISize(wm) + focusPadding.IStartEnd(wm);
|
contentsDesiredSize.ISize(wm) + focusPadding.IStartEnd(wm);
|
||||||
buttonContentBox.ISize(wm) =
|
buttonContentBox.ISize(wm) =
|
||||||
NS_CSS_MINMAX(buttonContentBox.ISize(wm),
|
NS_CSS_MINMAX(buttonContentBox.ISize(wm),
|
||||||
aButtonReflowState.ComputedMinISize(),
|
aButtonReflowInput.ComputedMinISize(),
|
||||||
aButtonReflowState.ComputedMaxISize());
|
aButtonReflowInput.ComputedMaxISize());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Center child in the block-direction in the button
|
// Center child in the block-direction in the button
|
||||||
@@ -387,13 +387,13 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Place the child
|
// Place the child
|
||||||
FinishReflowChild(aFirstKid, aPresContext,
|
FinishReflowChild(aFirstKid, aPresContext,
|
||||||
contentsDesiredSize, &contentsReflowState,
|
contentsDesiredSize, &contentsReflowInput,
|
||||||
wm, childPos, containerSize, 0);
|
wm, childPos, containerSize, 0);
|
||||||
|
|
||||||
// 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() ==
|
||||||
ReflowOutput::ASK_FOR_BASELINE) {
|
ReflowOutput::ASK_FOR_BASELINE) {
|
||||||
WritingMode wm = aButtonReflowState.GetWritingMode();
|
WritingMode wm = aButtonReflowInput.GetWritingMode();
|
||||||
contentsDesiredSize.SetBlockStartAscent(aFirstKid->GetLogicalBaseline(wm));
|
contentsDesiredSize.SetBlockStartAscent(aFirstKid->GetLogicalBaseline(wm));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,7 +401,7 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
|||||||
// Use what we learned to populate the button frame's reflow metrics.
|
// Use what we learned to populate the button frame's reflow metrics.
|
||||||
// * Button's height & width are content-box size + border-box contribution:
|
// * Button's height & width are content-box size + border-box contribution:
|
||||||
aButtonDesiredSize.SetSize(wm,
|
aButtonDesiredSize.SetSize(wm,
|
||||||
LogicalSize(wm, aButtonReflowState.ComputedISize() + clbp.IStartEnd(wm),
|
LogicalSize(wm, aButtonReflowInput.ComputedISize() + clbp.IStartEnd(wm),
|
||||||
buttonContentBox.BSize(wm) + clbp.BStartEnd(wm)));
|
buttonContentBox.BSize(wm) + clbp.BStartEnd(wm)));
|
||||||
|
|
||||||
// * Button's ascent is its child's ascent, plus the child's block-offset
|
// * Button's ascent is its child's ascent, plus the child's block-offset
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
||||||
@@ -102,7 +102,7 @@ protected:
|
|||||||
// of the button itself from the results.
|
// of the button itself from the results.
|
||||||
void ReflowButtonContents(nsPresContext* aPresContext,
|
void ReflowButtonContents(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aButtonDesiredSize,
|
ReflowOutput& aButtonDesiredSize,
|
||||||
const ReflowInput& aButtonReflowState,
|
const ReflowInput& aButtonReflowInput,
|
||||||
nsIFrame* aFirstKid);
|
nsIFrame* aFirstKid);
|
||||||
|
|
||||||
nsButtonFrameRenderer mRenderer;
|
nsButtonFrameRenderer mRenderer;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
||||||
@@ -127,15 +127,15 @@ nsImageControlFrame::GetType() const
|
|||||||
void
|
void
|
||||||
nsImageControlFrame::Reflow(nsPresContext* aPresContext,
|
nsImageControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsImageControlFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsImageControlFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
if (!GetPrevInFlow() && (mState & NS_FRAME_FIRST_REFLOW)) {
|
if (!GetPrevInFlow() && (mState & NS_FRAME_FIRST_REFLOW)) {
|
||||||
nsFormControlFrame::RegUnRegAccessKey(this, true);
|
nsFormControlFrame::RegUnRegAccessKey(this, true);
|
||||||
}
|
}
|
||||||
return nsImageFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
return nsImageFrame::Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|||||||
@@ -50,15 +50,15 @@ NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
|
|||||||
void
|
void
|
||||||
nsLegendFrame::Reflow(nsPresContext* aPresContext,
|
nsLegendFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsLegendFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsLegendFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
if (mState & NS_FRAME_FIRST_REFLOW) {
|
if (mState & NS_FRAME_FIRST_REFLOW) {
|
||||||
nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), true);
|
nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), true);
|
||||||
}
|
}
|
||||||
return nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
return nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t
|
int32_t
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
|
||||||
|
|||||||
@@ -356,10 +356,10 @@ nsListControlFrame::GetMinISize(nsRenderingContext *aRenderingContext)
|
|||||||
void
|
void
|
||||||
nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(aReflowState.ComputedISize() != NS_UNCONSTRAINEDSIZE,
|
NS_PRECONDITION(aReflowInput.ComputedISize() != NS_UNCONSTRAINEDSIZE,
|
||||||
"Must have a computed inline size");
|
"Must have a computed inline size");
|
||||||
|
|
||||||
SchedulePaint();
|
SchedulePaint();
|
||||||
@@ -382,7 +382,7 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IsInDropDownMode()) {
|
if (IsInDropDownMode()) {
|
||||||
ReflowAsDropdown(aPresContext, aDesiredSize, aReflowState, aStatus);
|
ReflowAsDropdown(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,12 +409,12 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
* the old one.
|
* the old one.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool autoBSize = (aReflowState.ComputedBSize() == NS_UNCONSTRAINEDSIZE);
|
bool autoBSize = (aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE);
|
||||||
|
|
||||||
mMightNeedSecondPass = autoBSize &&
|
mMightNeedSecondPass = autoBSize &&
|
||||||
(NS_SUBTREE_DIRTY(this) || aReflowState.ShouldReflowAllKids());
|
(NS_SUBTREE_DIRTY(this) || aReflowInput.ShouldReflowAllKids());
|
||||||
|
|
||||||
ReflowInput state(aReflowState);
|
ReflowInput state(aReflowInput);
|
||||||
int32_t length = GetNumberOfRows();
|
int32_t length = GetNumberOfRows();
|
||||||
|
|
||||||
nscoord oldBSizeOfARow = BSizeOfARow();
|
nscoord oldBSizeOfARow = BSizeOfARow();
|
||||||
@@ -494,23 +494,23 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
void
|
void
|
||||||
nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
|
nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(aReflowState.ComputedBSize() == NS_UNCONSTRAINEDSIZE,
|
NS_PRECONDITION(aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE,
|
||||||
"We should not have a computed block size here!");
|
"We should not have a computed block size here!");
|
||||||
|
|
||||||
mMightNeedSecondPass = NS_SUBTREE_DIRTY(this) ||
|
mMightNeedSecondPass = NS_SUBTREE_DIRTY(this) ||
|
||||||
aReflowState.ShouldReflowAllKids();
|
aReflowInput.ShouldReflowAllKids();
|
||||||
|
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
nscoord oldBSizeOfARow = BSizeOfARow();
|
nscoord oldBSizeOfARow = BSizeOfARow();
|
||||||
nscoord oldVisibleBSize = (GetStateBits() & NS_FRAME_FIRST_REFLOW) ?
|
nscoord oldVisibleBSize = (GetStateBits() & NS_FRAME_FIRST_REFLOW) ?
|
||||||
NS_UNCONSTRAINEDSIZE : GetScrolledFrame()->BSize(wm);
|
NS_UNCONSTRAINEDSIZE : GetScrolledFrame()->BSize(wm);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ReflowInput state(aReflowState);
|
ReflowInput state(aReflowInput);
|
||||||
|
|
||||||
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||||
// When not doing an initial reflow, and when the block size is
|
// When not doing an initial reflow, and when the block size is
|
||||||
@@ -583,7 +583,7 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
|
|||||||
mNumDisplayRows = 1;
|
mNumDisplayRows = 1;
|
||||||
mDropdownCanGrow = GetNumberOfRows() > 1;
|
mDropdownCanGrow = GetNumberOfRows() > 1;
|
||||||
} else {
|
} else {
|
||||||
nscoord bp = aReflowState.ComputedLogicalBorderPadding().BStartEnd(wm);
|
nscoord bp = aReflowInput.ComputedLogicalBorderPadding().BStartEnd(wm);
|
||||||
nscoord availableBSize = std::max(before, after) - bp;
|
nscoord availableBSize = std::max(before, after) - bp;
|
||||||
nscoord newBSize;
|
nscoord newBSize;
|
||||||
uint32_t rows;
|
uint32_t rows;
|
||||||
@@ -1494,13 +1494,13 @@ nsListControlFrame::AboutToRollup()
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsListControlFrame::DidReflow(nsPresContext* aPresContext,
|
nsListControlFrame::DidReflow(nsPresContext* aPresContext,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
nsDidReflowStatus aStatus)
|
nsDidReflowStatus aStatus)
|
||||||
{
|
{
|
||||||
bool wasInterrupted = !mHasPendingInterruptAtStartOfReflow &&
|
bool wasInterrupted = !mHasPendingInterruptAtStartOfReflow &&
|
||||||
aPresContext->HasPendingInterrupt();
|
aPresContext->HasPendingInterrupt();
|
||||||
|
|
||||||
nsHTMLScrollFrame::DidReflow(aPresContext, aReflowState, aStatus);
|
nsHTMLScrollFrame::DidReflow(aPresContext, aReflowInput, aStatus);
|
||||||
|
|
||||||
if (mNeedToReset && !wasInterrupted) {
|
if (mNeedToReset && !wasInterrupted) {
|
||||||
mNeedToReset = false;
|
mNeedToReset = false;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aCX,
|
virtual void Reflow(nsPresContext* aCX,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual void Init(nsIContent* aContent,
|
virtual void Init(nsIContent* aContent,
|
||||||
@@ -76,7 +76,7 @@ public:
|
|||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
|
|
||||||
virtual void DidReflow(nsPresContext* aPresContext,
|
virtual void DidReflow(nsPresContext* aPresContext,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
nsDidReflowStatus aStatus) override;
|
nsDidReflowStatus aStatus) override;
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
|
||||||
|
|
||||||
@@ -346,7 +346,7 @@ protected:
|
|||||||
*/
|
*/
|
||||||
void ReflowAsDropdown(nsPresContext* aPresContext,
|
void ReflowAsDropdown(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
// Selection
|
// Selection
|
||||||
|
|||||||
@@ -105,12 +105,12 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
|
|||||||
void
|
void
|
||||||
nsMeterFrame::Reflow(nsPresContext* aPresContext,
|
nsMeterFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsMeterFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsMeterFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
NS_ASSERTION(mBarDiv, "Meter bar div must exist!");
|
NS_ASSERTION(mBarDiv, "Meter bar div must exist!");
|
||||||
NS_ASSERTION(!GetPrevContinuation(),
|
NS_ASSERTION(!GetPrevContinuation(),
|
||||||
@@ -124,10 +124,10 @@ nsMeterFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsIFrame* barFrame = mBarDiv->GetPrimaryFrame();
|
nsIFrame* barFrame = mBarDiv->GetPrimaryFrame();
|
||||||
NS_ASSERTION(barFrame, "The meter frame should have a child with a frame!");
|
NS_ASSERTION(barFrame, "The meter frame should have a child with a frame!");
|
||||||
|
|
||||||
ReflowBarFrame(barFrame, aPresContext, aReflowState, aStatus);
|
ReflowBarFrame(barFrame, aPresContext, aReflowInput, aStatus);
|
||||||
|
|
||||||
aDesiredSize.SetSize(aReflowState.GetWritingMode(),
|
aDesiredSize.SetSize(aReflowInput.GetWritingMode(),
|
||||||
aReflowState.ComputedSizeWithBorderPadding());
|
aReflowInput.ComputedSizeWithBorderPadding());
|
||||||
|
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, barFrame);
|
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, barFrame);
|
||||||
@@ -135,25 +135,25 @@ nsMeterFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsMeterFrame::ReflowBarFrame(nsIFrame* aBarFrame,
|
nsMeterFrame::ReflowBarFrame(nsIFrame* aBarFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
bool vertical = ResolvedOrientationIsVertical();
|
bool vertical = ResolvedOrientationIsVertical();
|
||||||
WritingMode wm = aBarFrame->GetWritingMode();
|
WritingMode wm = aBarFrame->GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.ComputedSize(wm);
|
LogicalSize availSize = aReflowInput.ComputedSize(wm);
|
||||||
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
ReflowInput reflowState(aPresContext, aReflowState,
|
ReflowInput reflowInput(aPresContext, aReflowInput,
|
||||||
aBarFrame, availSize);
|
aBarFrame, availSize);
|
||||||
nscoord size = vertical ? aReflowState.ComputedHeight()
|
nscoord size = vertical ? aReflowInput.ComputedHeight()
|
||||||
: aReflowState.ComputedWidth();
|
: aReflowInput.ComputedWidth();
|
||||||
nscoord xoffset = aReflowState.ComputedPhysicalBorderPadding().left;
|
nscoord xoffset = aReflowInput.ComputedPhysicalBorderPadding().left;
|
||||||
nscoord yoffset = aReflowState.ComputedPhysicalBorderPadding().top;
|
nscoord yoffset = aReflowInput.ComputedPhysicalBorderPadding().top;
|
||||||
|
|
||||||
// NOTE: Introduce a new function getPosition in the content part ?
|
// NOTE: Introduce a new function getPosition in the content part ?
|
||||||
HTMLMeterElement* meterElement = static_cast<HTMLMeterElement*>(mContent);
|
HTMLMeterElement* meterElement = static_cast<HTMLMeterElement*>(mContent);
|
||||||
@@ -168,32 +168,32 @@ nsMeterFrame::ReflowBarFrame(nsIFrame* aBarFrame,
|
|||||||
size = NSToCoordRound(size * position);
|
size = NSToCoordRound(size * position);
|
||||||
|
|
||||||
if (!vertical && (wm.IsVertical() ? wm.IsVerticalRL() : !wm.IsBidiLTR())) {
|
if (!vertical && (wm.IsVertical() ? wm.IsVerticalRL() : !wm.IsBidiLTR())) {
|
||||||
xoffset += aReflowState.ComputedWidth() - size;
|
xoffset += aReflowInput.ComputedWidth() - size;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The bar position is *always* constrained.
|
// The bar position is *always* constrained.
|
||||||
if (vertical) {
|
if (vertical) {
|
||||||
// We want the bar to begin at the bottom.
|
// We want the bar to begin at the bottom.
|
||||||
yoffset += aReflowState.ComputedHeight() - size;
|
yoffset += aReflowInput.ComputedHeight() - size;
|
||||||
|
|
||||||
size -= reflowState.ComputedPhysicalMargin().TopBottom() +
|
size -= reflowInput.ComputedPhysicalMargin().TopBottom() +
|
||||||
reflowState.ComputedPhysicalBorderPadding().TopBottom();
|
reflowInput.ComputedPhysicalBorderPadding().TopBottom();
|
||||||
size = std::max(size, 0);
|
size = std::max(size, 0);
|
||||||
reflowState.SetComputedHeight(size);
|
reflowInput.SetComputedHeight(size);
|
||||||
} else {
|
} else {
|
||||||
size -= reflowState.ComputedPhysicalMargin().LeftRight() +
|
size -= reflowInput.ComputedPhysicalMargin().LeftRight() +
|
||||||
reflowState.ComputedPhysicalBorderPadding().LeftRight();
|
reflowInput.ComputedPhysicalBorderPadding().LeftRight();
|
||||||
size = std::max(size, 0);
|
size = std::max(size, 0);
|
||||||
reflowState.SetComputedWidth(size);
|
reflowInput.SetComputedWidth(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
xoffset += reflowState.ComputedPhysicalMargin().left;
|
xoffset += reflowInput.ComputedPhysicalMargin().left;
|
||||||
yoffset += reflowState.ComputedPhysicalMargin().top;
|
yoffset += reflowInput.ComputedPhysicalMargin().top;
|
||||||
|
|
||||||
ReflowOutput barDesiredSize(reflowState);
|
ReflowOutput barDesiredSize(reflowInput);
|
||||||
ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowState, xoffset,
|
ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowInput, xoffset,
|
||||||
yoffset, 0, aStatus);
|
yoffset, 0, aStatus);
|
||||||
FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowState,
|
FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowInput,
|
||||||
xoffset, yoffset, 0);
|
xoffset, yoffset, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aCX,
|
virtual void Reflow(nsPresContext* aCX,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsIAtom* GetType() const override;
|
virtual nsIAtom* GetType() const override;
|
||||||
@@ -82,7 +82,7 @@ protected:
|
|||||||
// Helper function which reflow the anonymous div frame.
|
// Helper function which reflow the anonymous div frame.
|
||||||
void ReflowBarFrame(nsIFrame* aBarFrame,
|
void ReflowBarFrame(nsIFrame* aBarFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
/**
|
/**
|
||||||
* The div used to show the meter bar.
|
* The div used to show the meter bar.
|
||||||
|
|||||||
@@ -106,12 +106,12 @@ nsNumberControlFrame::GetPrefISize(nsRenderingContext* aRenderingContext)
|
|||||||
void
|
void
|
||||||
nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsNumberControlFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsNumberControlFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
NS_ASSERTION(mOuterWrapper, "Outer wrapper div must exist!");
|
NS_ASSERTION(mOuterWrapper, "Outer wrapper div must exist!");
|
||||||
|
|
||||||
@@ -127,22 +127,22 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsFormControlFrame::RegUnRegAccessKey(this, true);
|
nsFormControlFrame::RegUnRegAccessKey(this, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
const WritingMode myWM = aReflowState.GetWritingMode();
|
const WritingMode myWM = aReflowInput.GetWritingMode();
|
||||||
|
|
||||||
// The ISize of our content box, which is the available ISize
|
// The ISize of our content box, which is the available ISize
|
||||||
// for our anonymous content:
|
// for our anonymous content:
|
||||||
const nscoord contentBoxISize = aReflowState.ComputedISize();
|
const nscoord contentBoxISize = aReflowInput.ComputedISize();
|
||||||
nscoord contentBoxBSize = aReflowState.ComputedBSize();
|
nscoord contentBoxBSize = aReflowInput.ComputedBSize();
|
||||||
|
|
||||||
// Figure out our border-box sizes as well (by adding borderPadding to
|
// Figure out our border-box sizes as well (by adding borderPadding to
|
||||||
// content-box sizes):
|
// content-box sizes):
|
||||||
const nscoord borderBoxISize = contentBoxISize +
|
const nscoord borderBoxISize = contentBoxISize +
|
||||||
aReflowState.ComputedLogicalBorderPadding().IStartEnd(myWM);
|
aReflowInput.ComputedLogicalBorderPadding().IStartEnd(myWM);
|
||||||
|
|
||||||
nscoord borderBoxBSize;
|
nscoord borderBoxBSize;
|
||||||
if (contentBoxBSize != NS_INTRINSICSIZE) {
|
if (contentBoxBSize != NS_INTRINSICSIZE) {
|
||||||
borderBoxBSize = contentBoxBSize +
|
borderBoxBSize = contentBoxBSize +
|
||||||
aReflowState.ComputedLogicalBorderPadding().BStartEnd(myWM);
|
aReflowInput.ComputedLogicalBorderPadding().BStartEnd(myWM);
|
||||||
} // else, we'll figure out borderBoxBSize after we resolve contentBoxBSize.
|
} // else, we'll figure out borderBoxBSize after we resolve contentBoxBSize.
|
||||||
|
|
||||||
nsIFrame* outerWrapperFrame = mOuterWrapper->GetPrimaryFrame();
|
nsIFrame* outerWrapperFrame = mOuterWrapper->GetPrimaryFrame();
|
||||||
@@ -151,30 +151,30 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
if (contentBoxBSize == NS_INTRINSICSIZE) {
|
if (contentBoxBSize == NS_INTRINSICSIZE) {
|
||||||
contentBoxBSize = 0;
|
contentBoxBSize = 0;
|
||||||
borderBoxBSize =
|
borderBoxBSize =
|
||||||
aReflowState.ComputedLogicalBorderPadding().BStartEnd(myWM);
|
aReflowInput.ComputedLogicalBorderPadding().BStartEnd(myWM);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
NS_ASSERTION(outerWrapperFrame == mFrames.FirstChild(), "huh?");
|
NS_ASSERTION(outerWrapperFrame == mFrames.FirstChild(), "huh?");
|
||||||
|
|
||||||
ReflowOutput wrappersDesiredSize(aReflowState);
|
ReflowOutput wrappersDesiredSize(aReflowInput);
|
||||||
|
|
||||||
WritingMode wrapperWM = outerWrapperFrame->GetWritingMode();
|
WritingMode wrapperWM = outerWrapperFrame->GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.ComputedSize(wrapperWM);
|
LogicalSize availSize = aReflowInput.ComputedSize(wrapperWM);
|
||||||
availSize.BSize(wrapperWM) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wrapperWM) = NS_UNCONSTRAINEDSIZE;
|
||||||
|
|
||||||
ReflowInput wrapperReflowState(aPresContext, aReflowState,
|
ReflowInput wrapperReflowInput(aPresContext, aReflowInput,
|
||||||
outerWrapperFrame, availSize);
|
outerWrapperFrame, availSize);
|
||||||
|
|
||||||
// Convert wrapper margin into my own writing-mode (in case it differs):
|
// Convert wrapper margin into my own writing-mode (in case it differs):
|
||||||
LogicalMargin wrapperMargin =
|
LogicalMargin wrapperMargin =
|
||||||
wrapperReflowState.ComputedLogicalMargin().ConvertTo(myWM, wrapperWM);
|
wrapperReflowInput.ComputedLogicalMargin().ConvertTo(myWM, wrapperWM);
|
||||||
|
|
||||||
// offsets of wrapper frame within this frame:
|
// offsets of wrapper frame within this frame:
|
||||||
LogicalPoint
|
LogicalPoint
|
||||||
wrapperOffset(myWM,
|
wrapperOffset(myWM,
|
||||||
aReflowState.ComputedLogicalBorderPadding().IStart(myWM) +
|
aReflowInput.ComputedLogicalBorderPadding().IStart(myWM) +
|
||||||
wrapperMargin.IStart(myWM),
|
wrapperMargin.IStart(myWM),
|
||||||
aReflowState.ComputedLogicalBorderPadding().BStart(myWM) +
|
aReflowInput.ComputedLogicalBorderPadding().BStart(myWM) +
|
||||||
wrapperMargin.BStart(myWM));
|
wrapperMargin.BStart(myWM));
|
||||||
|
|
||||||
nsReflowStatus childStatus;
|
nsReflowStatus childStatus;
|
||||||
@@ -182,7 +182,7 @@ 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,
|
||||||
wrapperReflowState, myWM, wrapperOffset, dummyContainerSize, 0,
|
wrapperReflowInput, myWM, wrapperOffset, dummyContainerSize, 0,
|
||||||
childStatus);
|
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, "
|
||||||
@@ -198,16 +198,16 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Make sure we obey min/max-bsize in the case when we're doing intrinsic
|
// Make sure we obey min/max-bsize in the case when we're doing intrinsic
|
||||||
// sizing (we get it for free when we have a non-intrinsic
|
// sizing (we get it for free when we have a non-intrinsic
|
||||||
// aReflowState.ComputedBSize()). Note that we do this before
|
// aReflowInput.ComputedBSize()). Note that we do this before
|
||||||
// adjusting for borderpadding, since ComputedMaxBSize and
|
// adjusting for borderpadding, since ComputedMaxBSize and
|
||||||
// ComputedMinBSize are content heights.
|
// ComputedMinBSize are content heights.
|
||||||
contentBoxBSize =
|
contentBoxBSize =
|
||||||
NS_CSS_MINMAX(contentBoxBSize,
|
NS_CSS_MINMAX(contentBoxBSize,
|
||||||
aReflowState.ComputedMinBSize(),
|
aReflowInput.ComputedMinBSize(),
|
||||||
aReflowState.ComputedMaxBSize());
|
aReflowInput.ComputedMaxBSize());
|
||||||
|
|
||||||
borderBoxBSize = contentBoxBSize +
|
borderBoxBSize = contentBoxBSize +
|
||||||
aReflowState.ComputedLogicalBorderPadding().BStartEnd(myWM);
|
aReflowInput.ComputedLogicalBorderPadding().BStartEnd(myWM);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Center child in block axis
|
// Center child in block axis
|
||||||
@@ -220,7 +220,7 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Place the child
|
// Place the child
|
||||||
FinishReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
FinishReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
||||||
&wrapperReflowState, myWM, wrapperOffset,
|
&wrapperReflowInput, myWM, wrapperOffset,
|
||||||
borderBoxSize, 0);
|
borderBoxSize, 0);
|
||||||
|
|
||||||
nsSize contentBoxSize =
|
nsSize contentBoxSize =
|
||||||
@@ -228,7 +228,7 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
GetPhysicalSize(myWM);
|
GetPhysicalSize(myWM);
|
||||||
aDesiredSize.SetBlockStartAscent(
|
aDesiredSize.SetBlockStartAscent(
|
||||||
wrappersDesiredSize.BlockStartAscent() +
|
wrappersDesiredSize.BlockStartAscent() +
|
||||||
outerWrapperFrame->BStart(aReflowState.GetWritingMode(),
|
outerWrapperFrame->BStart(aReflowInput.GetWritingMode(),
|
||||||
contentBoxSize));
|
contentBoxSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,7 +245,7 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
||||||
|
|||||||
@@ -110,12 +110,12 @@ nsProgressFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||||||
void
|
void
|
||||||
nsProgressFrame::Reflow(nsPresContext* aPresContext,
|
nsProgressFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsProgressFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsProgressFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
NS_ASSERTION(mBarDiv, "Progress bar div must exist!");
|
NS_ASSERTION(mBarDiv, "Progress bar div must exist!");
|
||||||
NS_ASSERTION(!GetPrevContinuation(),
|
NS_ASSERTION(!GetPrevContinuation(),
|
||||||
@@ -129,35 +129,35 @@ nsProgressFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsIFrame* barFrame = mBarDiv->GetPrimaryFrame();
|
nsIFrame* barFrame = mBarDiv->GetPrimaryFrame();
|
||||||
NS_ASSERTION(barFrame, "The progress frame should have a child with a frame!");
|
NS_ASSERTION(barFrame, "The progress frame should have a child with a frame!");
|
||||||
|
|
||||||
ReflowBarFrame(barFrame, aPresContext, aReflowState, aStatus);
|
ReflowBarFrame(barFrame, aPresContext, aReflowInput, aStatus);
|
||||||
|
|
||||||
aDesiredSize.SetSize(aReflowState.GetWritingMode(),
|
aDesiredSize.SetSize(aReflowInput.GetWritingMode(),
|
||||||
aReflowState.ComputedSizeWithBorderPadding());
|
aReflowInput.ComputedSizeWithBorderPadding());
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, barFrame);
|
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, barFrame);
|
||||||
FinishAndStoreOverflow(&aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsProgressFrame::ReflowBarFrame(nsIFrame* aBarFrame,
|
nsProgressFrame::ReflowBarFrame(nsIFrame* aBarFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
bool vertical = ResolvedOrientationIsVertical();
|
bool vertical = ResolvedOrientationIsVertical();
|
||||||
WritingMode wm = aBarFrame->GetWritingMode();
|
WritingMode wm = aBarFrame->GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.ComputedSize(wm);
|
LogicalSize availSize = aReflowInput.ComputedSize(wm);
|
||||||
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
ReflowInput reflowState(aPresContext, aReflowState,
|
ReflowInput reflowInput(aPresContext, aReflowInput,
|
||||||
aBarFrame, availSize);
|
aBarFrame, availSize);
|
||||||
nscoord size = vertical ? aReflowState.ComputedHeight()
|
nscoord size = vertical ? aReflowInput.ComputedHeight()
|
||||||
: aReflowState.ComputedWidth();
|
: aReflowInput.ComputedWidth();
|
||||||
nscoord xoffset = aReflowState.ComputedPhysicalBorderPadding().left;
|
nscoord xoffset = aReflowInput.ComputedPhysicalBorderPadding().left;
|
||||||
nscoord yoffset = aReflowState.ComputedPhysicalBorderPadding().top;
|
nscoord yoffset = aReflowInput.ComputedPhysicalBorderPadding().top;
|
||||||
|
|
||||||
double position = static_cast<HTMLProgressElement*>(mContent)->Position();
|
double position = static_cast<HTMLProgressElement*>(mContent)->Position();
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ nsProgressFrame::ReflowBarFrame(nsIFrame* aBarFrame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!vertical && (wm.IsVertical() ? wm.IsVerticalRL() : !wm.IsBidiLTR())) {
|
if (!vertical && (wm.IsVertical() ? wm.IsVerticalRL() : !wm.IsBidiLTR())) {
|
||||||
xoffset += aReflowState.ComputedWidth() - size;
|
xoffset += aReflowInput.ComputedWidth() - size;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The bar size is fixed in these cases:
|
// The bar size is fixed in these cases:
|
||||||
@@ -181,32 +181,32 @@ nsProgressFrame::ReflowBarFrame(nsIFrame* aBarFrame,
|
|||||||
if (position != -1 || ShouldUseNativeStyle()) {
|
if (position != -1 || ShouldUseNativeStyle()) {
|
||||||
if (vertical) {
|
if (vertical) {
|
||||||
// We want the bar to begin at the bottom.
|
// We want the bar to begin at the bottom.
|
||||||
yoffset += aReflowState.ComputedHeight() - size;
|
yoffset += aReflowInput.ComputedHeight() - size;
|
||||||
|
|
||||||
size -= reflowState.ComputedPhysicalMargin().TopBottom() +
|
size -= reflowInput.ComputedPhysicalMargin().TopBottom() +
|
||||||
reflowState.ComputedPhysicalBorderPadding().TopBottom();
|
reflowInput.ComputedPhysicalBorderPadding().TopBottom();
|
||||||
size = std::max(size, 0);
|
size = std::max(size, 0);
|
||||||
reflowState.SetComputedHeight(size);
|
reflowInput.SetComputedHeight(size);
|
||||||
} else {
|
} else {
|
||||||
size -= reflowState.ComputedPhysicalMargin().LeftRight() +
|
size -= reflowInput.ComputedPhysicalMargin().LeftRight() +
|
||||||
reflowState.ComputedPhysicalBorderPadding().LeftRight();
|
reflowInput.ComputedPhysicalBorderPadding().LeftRight();
|
||||||
size = std::max(size, 0);
|
size = std::max(size, 0);
|
||||||
reflowState.SetComputedWidth(size);
|
reflowInput.SetComputedWidth(size);
|
||||||
}
|
}
|
||||||
} else if (vertical) {
|
} else if (vertical) {
|
||||||
// For vertical progress bars, we need to position the bar specificly when
|
// For vertical progress bars, we need to position the bar specificly when
|
||||||
// the width isn't constrained (position == -1 and !ShouldUseNativeStyle())
|
// the width isn't constrained (position == -1 and !ShouldUseNativeStyle())
|
||||||
// because aReflowState.ComputedHeight() - size == 0.
|
// because aReflowInput.ComputedHeight() - size == 0.
|
||||||
yoffset += aReflowState.ComputedHeight() - reflowState.ComputedHeight();
|
yoffset += aReflowInput.ComputedHeight() - reflowInput.ComputedHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
xoffset += reflowState.ComputedPhysicalMargin().left;
|
xoffset += reflowInput.ComputedPhysicalMargin().left;
|
||||||
yoffset += reflowState.ComputedPhysicalMargin().top;
|
yoffset += reflowInput.ComputedPhysicalMargin().top;
|
||||||
|
|
||||||
ReflowOutput barDesiredSize(aReflowState);
|
ReflowOutput barDesiredSize(aReflowInput);
|
||||||
ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowState, xoffset,
|
ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowInput, xoffset,
|
||||||
yoffset, 0, aStatus);
|
yoffset, 0, aStatus);
|
||||||
FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowState,
|
FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowInput,
|
||||||
xoffset, yoffset, 0);
|
xoffset, yoffset, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aCX,
|
virtual void Reflow(nsPresContext* aCX,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsIAtom* GetType() const override;
|
virtual nsIAtom* GetType() const override;
|
||||||
@@ -89,7 +89,7 @@ protected:
|
|||||||
// Helper function which reflow the anonymous div frame.
|
// Helper function which reflow the anonymous div frame.
|
||||||
void ReflowBarFrame(nsIFrame* aBarFrame,
|
void ReflowBarFrame(nsIFrame* aBarFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -315,12 +315,12 @@ nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||||||
void
|
void
|
||||||
nsRangeFrame::Reflow(nsPresContext* aPresContext,
|
nsRangeFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsRangeFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsRangeFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
NS_ASSERTION(mTrackDiv, "::-moz-range-track div must exist!");
|
NS_ASSERTION(mTrackDiv, "::-moz-range-track div must exist!");
|
||||||
NS_ASSERTION(mProgressDiv, "::-moz-range-progress div must exist!");
|
NS_ASSERTION(mProgressDiv, "::-moz-range-progress div must exist!");
|
||||||
@@ -333,20 +333,20 @@ nsRangeFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsFormControlFrame::RegUnRegAccessKey(this, true);
|
nsFormControlFrame::RegUnRegAccessKey(this, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
nscoord computedBSize = aReflowState.ComputedBSize();
|
nscoord computedBSize = aReflowInput.ComputedBSize();
|
||||||
if (computedBSize == NS_AUTOHEIGHT) {
|
if (computedBSize == NS_AUTOHEIGHT) {
|
||||||
computedBSize = 0;
|
computedBSize = 0;
|
||||||
}
|
}
|
||||||
LogicalSize
|
LogicalSize
|
||||||
finalSize(wm,
|
finalSize(wm,
|
||||||
aReflowState.ComputedISize() +
|
aReflowInput.ComputedISize() +
|
||||||
aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm),
|
aReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm),
|
||||||
computedBSize +
|
computedBSize +
|
||||||
aReflowState.ComputedLogicalBorderPadding().BStartEnd(wm));
|
aReflowInput.ComputedLogicalBorderPadding().BStartEnd(wm));
|
||||||
aDesiredSize.SetSize(wm, finalSize);
|
aDesiredSize.SetSize(wm, finalSize);
|
||||||
|
|
||||||
ReflowAnonymousContent(aPresContext, aDesiredSize, aReflowState);
|
ReflowAnonymousContent(aPresContext, aDesiredSize, aReflowInput);
|
||||||
|
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
|
|
||||||
@@ -369,18 +369,18 @@ nsRangeFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState)
|
const ReflowInput& aReflowInput)
|
||||||
{
|
{
|
||||||
// The width/height of our content box, which is the available width/height
|
// The width/height of our content box, which is the available width/height
|
||||||
// for our anonymous content:
|
// for our anonymous content:
|
||||||
nscoord rangeFrameContentBoxWidth = aReflowState.ComputedWidth();
|
nscoord rangeFrameContentBoxWidth = aReflowInput.ComputedWidth();
|
||||||
nscoord rangeFrameContentBoxHeight = aReflowState.ComputedHeight();
|
nscoord rangeFrameContentBoxHeight = aReflowInput.ComputedHeight();
|
||||||
if (rangeFrameContentBoxHeight == NS_AUTOHEIGHT) {
|
if (rangeFrameContentBoxHeight == NS_AUTOHEIGHT) {
|
||||||
rangeFrameContentBoxHeight = 0;
|
rangeFrameContentBoxHeight = 0;
|
||||||
}
|
}
|
||||||
@@ -397,9 +397,9 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
|||||||
// box.
|
// box.
|
||||||
|
|
||||||
WritingMode wm = trackFrame->GetWritingMode();
|
WritingMode wm = trackFrame->GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.ComputedSize(wm);
|
LogicalSize availSize = aReflowInput.ComputedSize(wm);
|
||||||
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
ReflowInput trackReflowState(aPresContext, aReflowState,
|
ReflowInput trackReflowInput(aPresContext, aReflowInput,
|
||||||
trackFrame, availSize);
|
trackFrame, availSize);
|
||||||
|
|
||||||
// Find the x/y position of the track frame such that it will be positioned
|
// Find the x/y position of the track frame such that it will be positioned
|
||||||
@@ -409,45 +409,45 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
|||||||
nscoord trackY = rangeFrameContentBoxHeight / 2;
|
nscoord trackY = rangeFrameContentBoxHeight / 2;
|
||||||
|
|
||||||
// Account for the track's border and padding (we ignore its margin):
|
// Account for the track's border and padding (we ignore its margin):
|
||||||
trackX -= trackReflowState.ComputedPhysicalBorderPadding().left +
|
trackX -= trackReflowInput.ComputedPhysicalBorderPadding().left +
|
||||||
trackReflowState.ComputedWidth() / 2;
|
trackReflowInput.ComputedWidth() / 2;
|
||||||
trackY -= trackReflowState.ComputedPhysicalBorderPadding().top +
|
trackY -= trackReflowInput.ComputedPhysicalBorderPadding().top +
|
||||||
trackReflowState.ComputedHeight() / 2;
|
trackReflowInput.ComputedHeight() / 2;
|
||||||
|
|
||||||
// Make relative to our border box instead of our content box:
|
// Make relative to our border box instead of our content box:
|
||||||
trackX += aReflowState.ComputedPhysicalBorderPadding().left;
|
trackX += aReflowInput.ComputedPhysicalBorderPadding().left;
|
||||||
trackY += aReflowState.ComputedPhysicalBorderPadding().top;
|
trackY += aReflowInput.ComputedPhysicalBorderPadding().top;
|
||||||
|
|
||||||
nsReflowStatus frameStatus;
|
nsReflowStatus frameStatus;
|
||||||
ReflowOutput trackDesiredSize(aReflowState);
|
ReflowOutput trackDesiredSize(aReflowInput);
|
||||||
ReflowChild(trackFrame, aPresContext, trackDesiredSize,
|
ReflowChild(trackFrame, aPresContext, trackDesiredSize,
|
||||||
trackReflowState, trackX, trackY, 0, frameStatus);
|
trackReflowInput, trackX, trackY, 0, 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,
|
||||||
&trackReflowState, trackX, trackY, 0);
|
&trackReflowInput, trackX, trackY, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame();
|
nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame();
|
||||||
|
|
||||||
if (thumbFrame) { // display:none?
|
if (thumbFrame) { // display:none?
|
||||||
WritingMode wm = thumbFrame->GetWritingMode();
|
WritingMode wm = thumbFrame->GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.ComputedSize(wm);
|
LogicalSize availSize = aReflowInput.ComputedSize(wm);
|
||||||
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
ReflowInput thumbReflowState(aPresContext, aReflowState,
|
ReflowInput thumbReflowInput(aPresContext, aReflowInput,
|
||||||
thumbFrame, availSize);
|
thumbFrame, availSize);
|
||||||
|
|
||||||
// Where we position the thumb depends on its size, so we first reflow
|
// Where we position the thumb depends on its size, so we first reflow
|
||||||
// the thumb at {0,0} to obtain its size, then position it afterwards.
|
// the thumb at {0,0} to obtain its size, then position it afterwards.
|
||||||
|
|
||||||
nsReflowStatus frameStatus;
|
nsReflowStatus frameStatus;
|
||||||
ReflowOutput thumbDesiredSize(aReflowState);
|
ReflowOutput thumbDesiredSize(aReflowInput);
|
||||||
ReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
|
ReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
|
||||||
thumbReflowState, 0, 0, 0, frameStatus);
|
thumbReflowInput, 0, 0, 0, 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,
|
||||||
&thumbReflowState, 0, 0, 0);
|
&thumbReflowInput, 0, 0, 0);
|
||||||
DoUpdateThumbPosition(thumbFrame, nsSize(aDesiredSize.Width(),
|
DoUpdateThumbPosition(thumbFrame, nsSize(aDesiredSize.Width(),
|
||||||
aDesiredSize.Height()));
|
aDesiredSize.Height()));
|
||||||
}
|
}
|
||||||
@@ -456,9 +456,9 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
if (rangeProgressFrame) { // display:none?
|
if (rangeProgressFrame) { // display:none?
|
||||||
WritingMode wm = rangeProgressFrame->GetWritingMode();
|
WritingMode wm = rangeProgressFrame->GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.ComputedSize(wm);
|
LogicalSize availSize = aReflowInput.ComputedSize(wm);
|
||||||
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
ReflowInput progressReflowState(aPresContext, aReflowState,
|
ReflowInput progressReflowInput(aPresContext, aReflowInput,
|
||||||
rangeProgressFrame, availSize);
|
rangeProgressFrame, availSize);
|
||||||
|
|
||||||
// We first reflow the range-progress frame at {0,0} to obtain its
|
// We first reflow the range-progress frame at {0,0} to obtain its
|
||||||
@@ -466,14 +466,14 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
|||||||
// ends at the thumb.
|
// ends at the thumb.
|
||||||
|
|
||||||
nsReflowStatus frameStatus;
|
nsReflowStatus frameStatus;
|
||||||
ReflowOutput progressDesiredSize(aReflowState);
|
ReflowOutput progressDesiredSize(aReflowInput);
|
||||||
ReflowChild(rangeProgressFrame, aPresContext,
|
ReflowChild(rangeProgressFrame, aPresContext,
|
||||||
progressDesiredSize, progressReflowState, 0, 0,
|
progressDesiredSize, progressReflowInput, 0, 0,
|
||||||
0, frameStatus);
|
0, 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, &progressReflowState, 0, 0, 0);
|
progressDesiredSize, &progressReflowInput, 0, 0, 0);
|
||||||
DoUpdateRangeProgressFrame(rangeProgressFrame, nsSize(aDesiredSize.Width(),
|
DoUpdateRangeProgressFrame(rangeProgressFrame, nsSize(aDesiredSize.Width(),
|
||||||
aDesiredSize.Height()));
|
aDesiredSize.Height()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
@@ -159,7 +159,7 @@ private:
|
|||||||
// Helper function which reflows the anonymous div frames.
|
// Helper function which reflows the anonymous div frames.
|
||||||
void ReflowAnonymousContent(nsPresContext* aPresContext,
|
void ReflowAnonymousContent(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState);
|
const ReflowInput& aReflowInput);
|
||||||
|
|
||||||
void DoUpdateThumbPosition(nsIFrame* aThumbFrame,
|
void DoUpdateThumbPosition(nsIFrame* aThumbFrame,
|
||||||
const nsSize& aRangeSize);
|
const nsSize& aRangeSize);
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ nsSelectsAreaFrame::BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
|
|||||||
void
|
void
|
||||||
nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext,
|
nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsListControlFrame* list = GetEnclosingListFrame(this);
|
nsListControlFrame* list = GetEnclosingListFrame(this);
|
||||||
@@ -173,7 +173,7 @@ nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// See similar logic in nsListControlFrame::Reflow and
|
// See similar logic in nsListControlFrame::Reflow and
|
||||||
// nsListControlFrame::ReflowAsDropdown. We need to match it here.
|
// nsListControlFrame::ReflowAsDropdown. We need to match it here.
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
nscoord oldBSize;
|
nscoord oldBSize;
|
||||||
if (isInDropdownMode) {
|
if (isInDropdownMode) {
|
||||||
// Store the block size now in case it changes during
|
// Store the block size now in case it changes during
|
||||||
@@ -185,7 +185,7 @@ nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
|
|
||||||
// Check whether we need to suppress scrollbar updates. We want to do
|
// Check whether we need to suppress scrollbar updates. We want to do
|
||||||
// that if we're in a possible first pass and our block size of a row
|
// that if we're in a possible first pass and our block size of a row
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aCX,
|
virtual void Reflow(nsPresContext* aCX,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
nscoord BSizeOfARow() const { return mBSizeOfARow; }
|
nscoord BSizeOfARow() const { return mBSizeOfARow; }
|
||||||
|
|||||||
@@ -486,12 +486,12 @@ nsTextControlFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
|||||||
void
|
void
|
||||||
nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsTextControlFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsTextControlFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
// make sure that the form registers itself on the initial/first reflow
|
// make sure that the form registers itself on the initial/first reflow
|
||||||
if (mState & NS_FRAME_FIRST_REFLOW) {
|
if (mState & NS_FRAME_FIRST_REFLOW) {
|
||||||
@@ -499,17 +499,17 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set values of reflow's out parameters
|
// set values of reflow's out parameters
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
LogicalSize
|
LogicalSize
|
||||||
finalSize(wm,
|
finalSize(wm,
|
||||||
aReflowState.ComputedISize() +
|
aReflowInput.ComputedISize() +
|
||||||
aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm),
|
aReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm),
|
||||||
aReflowState.ComputedBSize() +
|
aReflowInput.ComputedBSize() +
|
||||||
aReflowState.ComputedLogicalBorderPadding().BStartEnd(wm));
|
aReflowInput.ComputedLogicalBorderPadding().BStartEnd(wm));
|
||||||
aDesiredSize.SetSize(wm, finalSize);
|
aDesiredSize.SetSize(wm, finalSize);
|
||||||
|
|
||||||
// computation of the ascent wrt the input height
|
// computation of the ascent wrt the input height
|
||||||
nscoord lineHeight = aReflowState.ComputedBSize();
|
nscoord lineHeight = aReflowInput.ComputedBSize();
|
||||||
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
|
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
|
||||||
if (!IsSingleLineTextControl()) {
|
if (!IsSingleLineTextControl()) {
|
||||||
lineHeight = ReflowInput::CalcLineHeight(GetContent(), StyleContext(),
|
lineHeight = ReflowInput::CalcLineHeight(GetContent(), StyleContext(),
|
||||||
@@ -521,14 +521,14 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
aDesiredSize.SetBlockStartAscent(
|
aDesiredSize.SetBlockStartAscent(
|
||||||
nsLayoutUtils::GetCenteredFontBaseline(fontMet, lineHeight,
|
nsLayoutUtils::GetCenteredFontBaseline(fontMet, lineHeight,
|
||||||
wm.IsLineInverted()) +
|
wm.IsLineInverted()) +
|
||||||
aReflowState.ComputedLogicalBorderPadding().BStart(wm));
|
aReflowInput.ComputedLogicalBorderPadding().BStart(wm));
|
||||||
|
|
||||||
// overflow handling
|
// overflow handling
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
// perform reflow on all kids
|
// perform reflow on all kids
|
||||||
nsIFrame* kid = mFrames.FirstChild();
|
nsIFrame* kid = mFrames.FirstChild();
|
||||||
while (kid) {
|
while (kid) {
|
||||||
ReflowTextControlChild(kid, aPresContext, aReflowState, aStatus, aDesiredSize);
|
ReflowTextControlChild(kid, aPresContext, aReflowInput, aStatus, aDesiredSize);
|
||||||
kid = kid->GetNextSibling();
|
kid = kid->GetNextSibling();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -536,45 +536,45 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
FinishAndStoreOverflow(&aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsTextControlFrame::ReflowTextControlChild(nsIFrame* aKid,
|
nsTextControlFrame::ReflowTextControlChild(nsIFrame* aKid,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
ReflowOutput& aParentDesiredSize)
|
ReflowOutput& aParentDesiredSize)
|
||||||
{
|
{
|
||||||
// compute available size and frame offsets for child
|
// compute available size and frame offsets for child
|
||||||
WritingMode wm = aKid->GetWritingMode();
|
WritingMode wm = aKid->GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.ComputedSizeWithPadding(wm);
|
LogicalSize availSize = aReflowInput.ComputedSizeWithPadding(wm);
|
||||||
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
|
|
||||||
ReflowInput kidReflowState(aPresContext, aReflowState,
|
ReflowInput kidReflowInput(aPresContext, aReflowInput,
|
||||||
aKid, availSize, nullptr,
|
aKid, availSize, nullptr,
|
||||||
ReflowInput::CALLER_WILL_INIT);
|
ReflowInput::CALLER_WILL_INIT);
|
||||||
// Override padding with our computed padding in case we got it from theming or percentage
|
// Override padding with our computed padding in case we got it from theming or percentage
|
||||||
kidReflowState.Init(aPresContext, nullptr, nullptr, &aReflowState.ComputedPhysicalPadding());
|
kidReflowInput.Init(aPresContext, nullptr, nullptr, &aReflowInput.ComputedPhysicalPadding());
|
||||||
|
|
||||||
// Set computed width and computed height for the child
|
// Set computed width and computed height for the child
|
||||||
kidReflowState.SetComputedWidth(aReflowState.ComputedWidth());
|
kidReflowInput.SetComputedWidth(aReflowInput.ComputedWidth());
|
||||||
kidReflowState.SetComputedHeight(aReflowState.ComputedHeight());
|
kidReflowInput.SetComputedHeight(aReflowInput.ComputedHeight());
|
||||||
|
|
||||||
// Offset the frame by the size of the parent's border
|
// Offset the frame by the size of the parent's border
|
||||||
nscoord xOffset = aReflowState.ComputedPhysicalBorderPadding().left -
|
nscoord xOffset = aReflowInput.ComputedPhysicalBorderPadding().left -
|
||||||
aReflowState.ComputedPhysicalPadding().left;
|
aReflowInput.ComputedPhysicalPadding().left;
|
||||||
nscoord yOffset = aReflowState.ComputedPhysicalBorderPadding().top -
|
nscoord yOffset = aReflowInput.ComputedPhysicalBorderPadding().top -
|
||||||
aReflowState.ComputedPhysicalPadding().top;
|
aReflowInput.ComputedPhysicalPadding().top;
|
||||||
|
|
||||||
// reflow the child
|
// reflow the child
|
||||||
ReflowOutput desiredSize(aReflowState);
|
ReflowOutput desiredSize(aReflowInput);
|
||||||
ReflowChild(aKid, aPresContext, desiredSize, kidReflowState,
|
ReflowChild(aKid, aPresContext, desiredSize, kidReflowInput,
|
||||||
xOffset, yOffset, 0, aStatus);
|
xOffset, yOffset, 0, aStatus);
|
||||||
|
|
||||||
// place the child
|
// place the child
|
||||||
FinishReflowChild(aKid, aPresContext, desiredSize,
|
FinishReflowChild(aKid, aPresContext, desiredSize,
|
||||||
&kidReflowState, xOffset, yOffset, 0);
|
&kidReflowInput, xOffset, yOffset, 0);
|
||||||
|
|
||||||
// consider the overflow
|
// consider the overflow
|
||||||
aParentDesiredSize.mOverflowAreas.UnionWith(desiredSize.mOverflowAreas);
|
aParentDesiredSize.mOverflowAreas.UnionWith(desiredSize.mOverflowAreas);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
|
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
|
||||||
@@ -160,7 +160,7 @@ protected:
|
|||||||
*/
|
*/
|
||||||
void ReflowTextControlChild(nsIFrame* aFrame,
|
void ReflowTextControlChild(nsIFrame* aFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
ReflowOutput& aParentDesiredSize);
|
ReflowOutput& aParentDesiredSize);
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ using namespace mozilla::layout;
|
|||||||
static bool sFloatFragmentsInsideColumnEnabled;
|
static bool sFloatFragmentsInsideColumnEnabled;
|
||||||
static bool sFloatFragmentsInsideColumnPrefCached;
|
static bool sFloatFragmentsInsideColumnPrefCached;
|
||||||
|
|
||||||
BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowState,
|
BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowInput,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
nsBlockFrame* aFrame,
|
nsBlockFrame* aFrame,
|
||||||
bool aBStartMarginRoot,
|
bool aBStartMarginRoot,
|
||||||
@@ -37,11 +37,11 @@ BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowState,
|
|||||||
nscoord aConsumedBSize)
|
nscoord aConsumedBSize)
|
||||||
: mBlock(aFrame),
|
: mBlock(aFrame),
|
||||||
mPresContext(aPresContext),
|
mPresContext(aPresContext),
|
||||||
mReflowState(aReflowState),
|
mReflowInput(aReflowInput),
|
||||||
mContentArea(aReflowState.GetWritingMode()),
|
mContentArea(aReflowInput.GetWritingMode()),
|
||||||
mPushedFloats(nullptr),
|
mPushedFloats(nullptr),
|
||||||
mOverflowTracker(nullptr),
|
mOverflowTracker(nullptr),
|
||||||
mBorderPadding(mReflowState.ComputedLogicalBorderPadding()),
|
mBorderPadding(mReflowInput.ComputedLogicalBorderPadding()),
|
||||||
mPrevBEndMargin(),
|
mPrevBEndMargin(),
|
||||||
mLineNumber(0),
|
mLineNumber(0),
|
||||||
mFlags(0),
|
mFlags(0),
|
||||||
@@ -55,24 +55,24 @@ BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowState,
|
|||||||
}
|
}
|
||||||
SetFlag(BRS_FLOAT_FRAGMENTS_INSIDE_COLUMN_ENABLED, sFloatFragmentsInsideColumnEnabled);
|
SetFlag(BRS_FLOAT_FRAGMENTS_INSIDE_COLUMN_ENABLED, sFloatFragmentsInsideColumnEnabled);
|
||||||
|
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
SetFlag(BRS_ISFIRSTINFLOW, aFrame->GetPrevInFlow() == nullptr);
|
SetFlag(BRS_ISFIRSTINFLOW, aFrame->GetPrevInFlow() == nullptr);
|
||||||
SetFlag(BRS_ISOVERFLOWCONTAINER, IS_TRUE_OVERFLOW_CONTAINER(aFrame));
|
SetFlag(BRS_ISOVERFLOWCONTAINER, IS_TRUE_OVERFLOW_CONTAINER(aFrame));
|
||||||
|
|
||||||
nsIFrame::LogicalSides logicalSkipSides =
|
nsIFrame::LogicalSides logicalSkipSides =
|
||||||
aFrame->GetLogicalSkipSides(&aReflowState);
|
aFrame->GetLogicalSkipSides(&aReflowInput);
|
||||||
mBorderPadding.ApplySkipSides(logicalSkipSides);
|
mBorderPadding.ApplySkipSides(logicalSkipSides);
|
||||||
|
|
||||||
// Note that mContainerSize is the physical size, needed to
|
// Note that mContainerSize is the physical size, needed to
|
||||||
// convert logical block-coordinates in vertical-rl writing mode
|
// convert logical block-coordinates in vertical-rl writing mode
|
||||||
// (measured from a RHS origin) to physical coordinates within the
|
// (measured from a RHS origin) to physical coordinates within the
|
||||||
// containing block.
|
// containing block.
|
||||||
// If aReflowState doesn't have a constrained ComputedWidth(), we set
|
// If aReflowInput doesn't have a constrained ComputedWidth(), we set
|
||||||
// mContainerSize.width to zero, which means lines will be positioned
|
// mContainerSize.width to zero, which means lines will be positioned
|
||||||
// (physically) incorrectly; we will fix them up at the end of
|
// (physically) incorrectly; we will fix them up at the end of
|
||||||
// nsBlockFrame::Reflow, after we know the total block-size of the
|
// nsBlockFrame::Reflow, after we know the total block-size of the
|
||||||
// frame.
|
// frame.
|
||||||
mContainerSize.width = aReflowState.ComputedWidth();
|
mContainerSize.width = aReflowInput.ComputedWidth();
|
||||||
if (mContainerSize.width == NS_UNCONSTRAINEDSIZE) {
|
if (mContainerSize.width == NS_UNCONSTRAINEDSIZE) {
|
||||||
mContainerSize.width = 0;
|
mContainerSize.width = 0;
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowState,
|
|||||||
// For now at least, we don't do that fix-up for mContainerHeight.
|
// For now at least, we don't do that fix-up for mContainerHeight.
|
||||||
// It's only used in nsBidiUtils::ReorderFrames for vertical rtl
|
// It's only used in nsBidiUtils::ReorderFrames for vertical rtl
|
||||||
// writing modes, which aren't fully supported for the time being.
|
// writing modes, which aren't fully supported for the time being.
|
||||||
mContainerSize.height = aReflowState.ComputedHeight() +
|
mContainerSize.height = aReflowInput.ComputedHeight() +
|
||||||
mBorderPadding.TopBottom(wm);
|
mBorderPadding.TopBottom(wm);
|
||||||
|
|
||||||
if ((aBStartMarginRoot && !logicalSkipSides.BStart()) ||
|
if ((aBStartMarginRoot && !logicalSkipSides.BStart()) ||
|
||||||
@@ -98,7 +98,7 @@ BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowState,
|
|||||||
SetFlag(BRS_FLOAT_MGR, true);
|
SetFlag(BRS_FLOAT_MGR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
mFloatManager = aReflowState.mFloatManager;
|
mFloatManager = aReflowInput.mFloatManager;
|
||||||
|
|
||||||
NS_ASSERTION(mFloatManager,
|
NS_ASSERTION(mFloatManager,
|
||||||
"FloatManager should be set in BlockReflowInput" );
|
"FloatManager should be set in BlockReflowInput" );
|
||||||
@@ -112,11 +112,11 @@ BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowState,
|
|||||||
|
|
||||||
mNextInFlow = static_cast<nsBlockFrame*>(mBlock->GetNextInFlow());
|
mNextInFlow = static_cast<nsBlockFrame*>(mBlock->GetNextInFlow());
|
||||||
|
|
||||||
LAYOUT_WARN_IF_FALSE(NS_UNCONSTRAINEDSIZE != aReflowState.ComputedISize(),
|
LAYOUT_WARN_IF_FALSE(NS_UNCONSTRAINEDSIZE != aReflowInput.ComputedISize(),
|
||||||
"have unconstrained width; this should only result "
|
"have unconstrained width; this should only result "
|
||||||
"from very large sizes, not attempts at intrinsic "
|
"from very large sizes, not attempts at intrinsic "
|
||||||
"width calculation");
|
"width calculation");
|
||||||
mContentArea.ISize(wm) = aReflowState.ComputedISize();
|
mContentArea.ISize(wm) = aReflowInput.ComputedISize();
|
||||||
|
|
||||||
// Compute content area height. Unlike the width, if we have a
|
// Compute content area height. Unlike the width, if we have a
|
||||||
// specified style height we ignore it since extra content is
|
// specified style height we ignore it since extra content is
|
||||||
@@ -124,11 +124,11 @@ BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowState,
|
|||||||
// specified style height then we may end up limiting our height if
|
// specified style height then we may end up limiting our height if
|
||||||
// the availableHeight is constrained (this situation occurs when we
|
// the availableHeight is constrained (this situation occurs when we
|
||||||
// are paginated).
|
// are paginated).
|
||||||
if (NS_UNCONSTRAINEDSIZE != aReflowState.AvailableBSize()) {
|
if (NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableBSize()) {
|
||||||
// We are in a paginated situation. The bottom edge is just inside
|
// We are in a paginated situation. The bottom edge is just inside
|
||||||
// the bottom border and padding. The content area height doesn't
|
// the bottom border and padding. The content area height doesn't
|
||||||
// include either border or padding edge.
|
// include either border or padding edge.
|
||||||
mBEndEdge = aReflowState.AvailableBSize() - mBorderPadding.BEnd(wm);
|
mBEndEdge = aReflowInput.AvailableBSize() - mBorderPadding.BEnd(wm);
|
||||||
mContentArea.BSize(wm) = std::max(0, mBEndEdge - mBorderPadding.BStart(wm));
|
mContentArea.BSize(wm) = std::max(0, mBEndEdge - mBorderPadding.BStart(wm));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -143,7 +143,7 @@ BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowState,
|
|||||||
mPrevChild = nullptr;
|
mPrevChild = nullptr;
|
||||||
mCurrentLine = aFrame->end_lines();
|
mCurrentLine = aFrame->end_lines();
|
||||||
|
|
||||||
mMinLineHeight = aReflowState.CalcLineHeight();
|
mMinLineHeight = aReflowInput.CalcLineHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
@@ -163,7 +163,7 @@ BlockReflowInput::ComputeReplacedBlockOffsetsForFloats(
|
|||||||
nscoord& aIStartResult,
|
nscoord& aIStartResult,
|
||||||
nscoord& aIEndResult) const
|
nscoord& aIEndResult) const
|
||||||
{
|
{
|
||||||
WritingMode wm = mReflowState.GetWritingMode();
|
WritingMode wm = mReflowInput.GetWritingMode();
|
||||||
// The frame is clueless about the float manager and therefore we
|
// The frame is clueless about the float manager and therefore we
|
||||||
// only give it free space. An example is a table frame - the
|
// only give it free space. An example is a table frame - the
|
||||||
// tables do not flow around floats.
|
// tables do not flow around floats.
|
||||||
@@ -181,7 +181,7 @@ BlockReflowInput::ComputeReplacedBlockOffsetsForFloats(
|
|||||||
iEndOffset = 0;
|
iEndOffset = 0;
|
||||||
} else {
|
} else {
|
||||||
LogicalMargin frameMargin(wm);
|
LogicalMargin frameMargin(wm);
|
||||||
SizeComputationInput os(aFrame, mReflowState.mRenderingContext,
|
SizeComputationInput os(aFrame, mReflowInput.mRenderingContext,
|
||||||
wm, mContentArea.ISize(wm));
|
wm, mContentArea.ISize(wm));
|
||||||
frameMargin =
|
frameMargin =
|
||||||
os.ComputedLogicalMargin().ConvertTo(wm, aFrame->GetWritingMode());
|
os.ComputedLogicalMargin().ConvertTo(wm, aFrame->GetWritingMode());
|
||||||
@@ -232,12 +232,12 @@ BlockReflowInput::ComputeBlockAvailSpace(nsIFrame* aFrame,
|
|||||||
printf("CBAS frame=%p has floats %d\n",
|
printf("CBAS frame=%p has floats %d\n",
|
||||||
aFrame, aFloatAvailableSpace.mHasFloats);
|
aFrame, aFloatAvailableSpace.mHasFloats);
|
||||||
#endif
|
#endif
|
||||||
WritingMode wm = mReflowState.GetWritingMode();
|
WritingMode wm = mReflowInput.GetWritingMode();
|
||||||
aResult.BStart(wm) = mBCoord;
|
aResult.BStart(wm) = mBCoord;
|
||||||
aResult.BSize(wm) = GetFlag(BRS_UNCONSTRAINEDBSIZE)
|
aResult.BSize(wm) = GetFlag(BRS_UNCONSTRAINEDBSIZE)
|
||||||
? NS_UNCONSTRAINEDSIZE
|
? NS_UNCONSTRAINEDSIZE
|
||||||
: mReflowState.AvailableBSize() - mBCoord
|
: mReflowInput.AvailableBSize() - mBCoord
|
||||||
- GetBEndMarginClone(aFrame, mReflowState.mRenderingContext, mContentArea, wm);
|
- GetBEndMarginClone(aFrame, mReflowInput.mRenderingContext, mContentArea, wm);
|
||||||
// mBCoord might be greater than mBEndEdge if the block's top margin pushes
|
// mBCoord might be greater than mBEndEdge if the block's top margin pushes
|
||||||
// it off the page/column. Negative available height can confuse other code
|
// it off the page/column. Negative available height can confuse other code
|
||||||
// and is nonsense in principle.
|
// and is nonsense in principle.
|
||||||
@@ -312,7 +312,7 @@ BlockReflowInput::ReplacedBlockFitsInAvailSpace(nsIFrame* aReplacedBlock,
|
|||||||
// somewhat expensive.
|
// somewhat expensive.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
WritingMode wm = mReflowState.GetWritingMode();
|
WritingMode wm = mReflowInput.GetWritingMode();
|
||||||
nsBlockFrame::ReplacedElementISizeToClear replacedISize =
|
nsBlockFrame::ReplacedElementISizeToClear replacedISize =
|
||||||
nsBlockFrame::ISizeToClearPastFloats(*this, aFloatAvailableSpace.mRect,
|
nsBlockFrame::ISizeToClearPastFloats(*this, aFloatAvailableSpace.mRect,
|
||||||
aReplacedBlock);
|
aReplacedBlock);
|
||||||
@@ -334,7 +334,7 @@ BlockReflowInput::GetFloatAvailableSpaceWithState(
|
|||||||
nscoord aBCoord,
|
nscoord aBCoord,
|
||||||
nsFloatManager::SavedState *aState) const
|
nsFloatManager::SavedState *aState) const
|
||||||
{
|
{
|
||||||
WritingMode wm = mReflowState.GetWritingMode();
|
WritingMode wm = mReflowInput.GetWritingMode();
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// Verify that the caller setup the coordinate system properly
|
// Verify that the caller setup the coordinate system properly
|
||||||
nscoord wI, wB;
|
nscoord wI, wB;
|
||||||
@@ -371,7 +371,7 @@ BlockReflowInput::GetFloatAvailableSpaceForBSize(
|
|||||||
nscoord aBCoord, nscoord aBSize,
|
nscoord aBCoord, nscoord aBSize,
|
||||||
nsFloatManager::SavedState *aState) const
|
nsFloatManager::SavedState *aState) const
|
||||||
{
|
{
|
||||||
WritingMode wm = mReflowState.GetWritingMode();
|
WritingMode wm = mReflowInput.GetWritingMode();
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// Verify that the caller setup the coordinate system properly
|
// Verify that the caller setup the coordinate system properly
|
||||||
nscoord wI, wB;
|
nscoord wI, wB;
|
||||||
@@ -485,7 +485,7 @@ void
|
|||||||
BlockReflowInput::RecoverFloats(nsLineList::iterator aLine,
|
BlockReflowInput::RecoverFloats(nsLineList::iterator aLine,
|
||||||
nscoord aDeltaBCoord)
|
nscoord aDeltaBCoord)
|
||||||
{
|
{
|
||||||
WritingMode wm = mReflowState.GetWritingMode();
|
WritingMode wm = mReflowInput.GetWritingMode();
|
||||||
if (aLine->HasFloats()) {
|
if (aLine->HasFloats()) {
|
||||||
// Place the floats into the space-manager again. Also slide
|
// Place the floats into the space-manager again. Also slide
|
||||||
// them, just like the regular frames on the line.
|
// them, just like the regular frames on the line.
|
||||||
@@ -629,7 +629,7 @@ BlockReflowInput::AddFloat(nsLineLayout* aLineLayout,
|
|||||||
placed = FlowAndPlaceFloat(aFloat);
|
placed = FlowAndPlaceFloat(aFloat);
|
||||||
if (placed) {
|
if (placed) {
|
||||||
// Pass on updated available space to the current inline reflow engine
|
// Pass on updated available space to the current inline reflow engine
|
||||||
WritingMode wm = mReflowState.GetWritingMode();
|
WritingMode wm = mReflowInput.GetWritingMode();
|
||||||
nsFlowAreaRect floatAvailSpace = GetFloatAvailableSpace(mBCoord);
|
nsFlowAreaRect floatAvailSpace = GetFloatAvailableSpace(mBCoord);
|
||||||
LogicalRect availSpace(wm, floatAvailSpace.mRect.IStart(wm), mBCoord,
|
LogicalRect availSpace(wm, floatAvailSpace.mRect.IStart(wm), mBCoord,
|
||||||
floatAvailSpace.mRect.ISize(wm),
|
floatAvailSpace.mRect.ISize(wm),
|
||||||
@@ -666,7 +666,7 @@ BlockReflowInput::CanPlaceFloat(nscoord aFloatISize,
|
|||||||
// been placed.
|
// been placed.
|
||||||
// FIXME: We should allow overflow by up to half a pixel here (bug 21193).
|
// FIXME: We should allow overflow by up to half a pixel here (bug 21193).
|
||||||
return !aFloatAvailableSpace.mHasFloats ||
|
return !aFloatAvailableSpace.mHasFloats ||
|
||||||
aFloatAvailableSpace.mRect.ISize(mReflowState.GetWritingMode()) >=
|
aFloatAvailableSpace.mRect.ISize(mReflowInput.GetWritingMode()) >=
|
||||||
aFloatISize;
|
aFloatISize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -676,7 +676,7 @@ BlockReflowInput::CanPlaceFloat(nscoord aFloatISize,
|
|||||||
// has block-size:auto, and we'll need to actually reflow it to find out
|
// has block-size:auto, and we'll need to actually reflow it to find out
|
||||||
// how much inline-size it will occupy in the containing block's mode.
|
// how much inline-size it will occupy in the containing block's mode.
|
||||||
static nscoord
|
static nscoord
|
||||||
FloatMarginISize(const ReflowInput& aCBReflowState,
|
FloatMarginISize(const ReflowInput& aCBReflowInput,
|
||||||
nscoord aFloatAvailableISize,
|
nscoord aFloatAvailableISize,
|
||||||
nsIFrame *aFloat,
|
nsIFrame *aFloat,
|
||||||
const SizeComputationInput& aFloatOffsetState)
|
const SizeComputationInput& aFloatOffsetState)
|
||||||
@@ -686,9 +686,9 @@ FloatMarginISize(const ReflowInput& aCBReflowState,
|
|||||||
|
|
||||||
LogicalSize floatSize =
|
LogicalSize floatSize =
|
||||||
aFloat->ComputeSize(
|
aFloat->ComputeSize(
|
||||||
aCBReflowState.mRenderingContext,
|
aCBReflowInput.mRenderingContext,
|
||||||
wm,
|
wm,
|
||||||
aCBReflowState.ComputedSize(wm),
|
aCBReflowInput.ComputedSize(wm),
|
||||||
aFloatAvailableISize,
|
aFloatAvailableISize,
|
||||||
aFloatOffsetState.ComputedLogicalMargin().Size(wm),
|
aFloatOffsetState.ComputedLogicalMargin().Size(wm),
|
||||||
aFloatOffsetState.ComputedLogicalBorderPadding().Size(wm) -
|
aFloatOffsetState.ComputedLogicalBorderPadding().Size(wm) -
|
||||||
@@ -696,7 +696,7 @@ FloatMarginISize(const ReflowInput& aCBReflowState,
|
|||||||
aFloatOffsetState.ComputedLogicalPadding().Size(wm),
|
aFloatOffsetState.ComputedLogicalPadding().Size(wm),
|
||||||
nsIFrame::ComputeSizeFlags::eShrinkWrap);
|
nsIFrame::ComputeSizeFlags::eShrinkWrap);
|
||||||
|
|
||||||
WritingMode cbwm = aCBReflowState.GetWritingMode();
|
WritingMode cbwm = aCBReflowInput.GetWritingMode();
|
||||||
nscoord floatISize = floatSize.ConvertTo(cbwm, wm).ISize(cbwm);
|
nscoord floatISize = floatSize.ConvertTo(cbwm, wm).ISize(cbwm);
|
||||||
if (floatISize == NS_UNCONSTRAINEDSIZE) {
|
if (floatISize == NS_UNCONSTRAINEDSIZE) {
|
||||||
return NS_UNCONSTRAINEDSIZE; // reflow is needed to get the true size
|
return NS_UNCONSTRAINEDSIZE; // reflow is needed to get the true size
|
||||||
@@ -712,7 +712,7 @@ FloatMarginISize(const ReflowInput& aCBReflowState,
|
|||||||
bool
|
bool
|
||||||
BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
|
BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||||
{
|
{
|
||||||
WritingMode wm = mReflowState.GetWritingMode();
|
WritingMode wm = mReflowInput.GetWritingMode();
|
||||||
// Save away the Y coordinate before placing the float. We will
|
// Save away the Y coordinate before placing the float. We will
|
||||||
// restore mBCoord at the end after placing the float. This is
|
// restore mBCoord at the end after placing the float. This is
|
||||||
// necessary because any adjustments to mBCoord during the float
|
// necessary because any adjustments to mBCoord during the float
|
||||||
@@ -746,10 +746,10 @@ BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
|
|||||||
NS_ASSERTION(aFloat->GetParent() == mBlock,
|
NS_ASSERTION(aFloat->GetParent() == mBlock,
|
||||||
"Float frame has wrong parent");
|
"Float frame has wrong parent");
|
||||||
|
|
||||||
SizeComputationInput offsets(aFloat, mReflowState.mRenderingContext,
|
SizeComputationInput offsets(aFloat, mReflowInput.mRenderingContext,
|
||||||
wm, mReflowState.ComputedISize());
|
wm, mReflowInput.ComputedISize());
|
||||||
|
|
||||||
nscoord floatMarginISize = FloatMarginISize(mReflowState,
|
nscoord floatMarginISize = FloatMarginISize(mReflowInput,
|
||||||
adjustedAvailableSpace.ISize(wm),
|
adjustedAvailableSpace.ISize(wm),
|
||||||
aFloat, offsets);
|
aFloat, offsets);
|
||||||
|
|
||||||
@@ -791,10 +791,10 @@ BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
|
|||||||
// at the top of the page (to avoid an infinite loop of pushing and
|
// at the top of the page (to avoid an infinite loop of pushing and
|
||||||
// breaking).
|
// breaking).
|
||||||
bool mustPlaceFloat =
|
bool mustPlaceFloat =
|
||||||
mReflowState.mFlags.mIsTopOfPage && IsAdjacentWithTop();
|
mReflowInput.mFlags.mIsTopOfPage && IsAdjacentWithTop();
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (mReflowState.AvailableHeight() != NS_UNCONSTRAINEDSIZE &&
|
if (mReflowInput.AvailableHeight() != NS_UNCONSTRAINEDSIZE &&
|
||||||
floatAvailableSpace.mRect.BSize(wm) <= 0 &&
|
floatAvailableSpace.mRect.BSize(wm) <= 0 &&
|
||||||
!mustPlaceFloat) {
|
!mustPlaceFloat) {
|
||||||
// No space, nowhere to put anything.
|
// No space, nowhere to put anything.
|
||||||
@@ -859,7 +859,7 @@ BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
|
|||||||
floatAvailableSpace = GetFloatAvailableSpace(mBCoord);
|
floatAvailableSpace = GetFloatAvailableSpace(mBCoord);
|
||||||
adjustedAvailableSpace = mBlock->AdjustFloatAvailableSpace(*this,
|
adjustedAvailableSpace = mBlock->AdjustFloatAvailableSpace(*this,
|
||||||
floatAvailableSpace.mRect, aFloat);
|
floatAvailableSpace.mRect, aFloat);
|
||||||
floatMarginISize = FloatMarginISize(mReflowState,
|
floatMarginISize = FloatMarginISize(mReflowInput,
|
||||||
adjustedAvailableSpace.ISize(wm),
|
adjustedAvailableSpace.ISize(wm),
|
||||||
aFloat, offsets);
|
aFloat, offsets);
|
||||||
}
|
}
|
||||||
@@ -930,12 +930,12 @@ BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We can't use aFloat->ShouldAvoidBreakInside(mReflowState) here since
|
// We can't use aFloat->ShouldAvoidBreakInside(mReflowInput) here since
|
||||||
// its mIsTopOfPage may be true even though the float isn't at the
|
// its mIsTopOfPage may be true even though the float isn't at the
|
||||||
// top when floatPos.B(wm) > 0.
|
// top when floatPos.B(wm) > 0.
|
||||||
if (ContentBSize() != NS_UNCONSTRAINEDSIZE &&
|
if (ContentBSize() != NS_UNCONSTRAINEDSIZE &&
|
||||||
!mustPlaceFloat &&
|
!mustPlaceFloat &&
|
||||||
(!mReflowState.mFlags.mIsTopOfPage || floatPos.B(wm) > 0) &&
|
(!mReflowInput.mFlags.mIsTopOfPage || floatPos.B(wm) > 0) &&
|
||||||
NS_STYLE_PAGE_BREAK_AVOID == aFloat->StyleDisplay()->mBreakInside &&
|
NS_STYLE_PAGE_BREAK_AVOID == aFloat->StyleDisplay()->mBreakInside &&
|
||||||
(!NS_FRAME_IS_FULLY_COMPLETE(reflowStatus) ||
|
(!NS_FRAME_IS_FULLY_COMPLETE(reflowStatus) ||
|
||||||
aFloat->BSize(wm) + floatMargin.BStartEnd(wm) >
|
aFloat->BSize(wm) + floatMargin.BStartEnd(wm) >
|
||||||
@@ -1037,7 +1037,7 @@ BlockReflowInput::PushFloatPastBreak(nsIFrame *aFloat)
|
|||||||
// * don't waste much time trying to reflow this float again until
|
// * don't waste much time trying to reflow this float again until
|
||||||
// after the break
|
// after the break
|
||||||
uint8_t floatStyle =
|
uint8_t floatStyle =
|
||||||
aFloat->StyleDisplay()->PhysicalFloats(mReflowState.GetWritingMode());
|
aFloat->StyleDisplay()->PhysicalFloats(mReflowInput.GetWritingMode());
|
||||||
if (floatStyle == NS_STYLE_FLOAT_LEFT) {
|
if (floatStyle == NS_STYLE_FLOAT_LEFT) {
|
||||||
mFloatManager->SetPushedLeftFloatPastBreak();
|
mFloatManager->SetPushedLeftFloatPastBreak();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class BlockReflowInput {
|
|||||||
using ReflowInput = mozilla::ReflowInput;
|
using ReflowInput = mozilla::ReflowInput;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BlockReflowInput(const ReflowInput& aReflowState,
|
BlockReflowInput(const ReflowInput& aReflowInput,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
nsBlockFrame* aFrame,
|
nsBlockFrame* aFrame,
|
||||||
bool aBStartMarginRoot, bool aBEndMarginRoot,
|
bool aBStartMarginRoot, bool aBEndMarginRoot,
|
||||||
@@ -137,12 +137,12 @@ public:
|
|||||||
// next column/page).
|
// next column/page).
|
||||||
bool AdvanceToNextBand(const mozilla::LogicalRect& aFloatAvailableSpace,
|
bool AdvanceToNextBand(const mozilla::LogicalRect& aFloatAvailableSpace,
|
||||||
nscoord *aBCoord) const {
|
nscoord *aBCoord) const {
|
||||||
mozilla::WritingMode wm = mReflowState.GetWritingMode();
|
mozilla::WritingMode wm = mReflowInput.GetWritingMode();
|
||||||
if (aFloatAvailableSpace.BSize(wm) > 0) {
|
if (aFloatAvailableSpace.BSize(wm) > 0) {
|
||||||
// See if there's room in the next band.
|
// See if there's room in the next band.
|
||||||
*aBCoord += aFloatAvailableSpace.BSize(wm);
|
*aBCoord += aFloatAvailableSpace.BSize(wm);
|
||||||
} else {
|
} else {
|
||||||
if (mReflowState.AvailableHeight() != NS_UNCONSTRAINEDSIZE) {
|
if (mReflowInput.AvailableHeight() != NS_UNCONSTRAINEDSIZE) {
|
||||||
// Stop trying to clear here; we'll just get pushed to the
|
// Stop trying to clear here; we'll just get pushed to the
|
||||||
// next column or page and try again there.
|
// next column or page and try again there.
|
||||||
return false;
|
return false;
|
||||||
@@ -157,7 +157,7 @@ public:
|
|||||||
const nsFlowAreaRect& aFloatAvailableSpace) const;
|
const nsFlowAreaRect& aFloatAvailableSpace) const;
|
||||||
|
|
||||||
bool IsAdjacentWithTop() const {
|
bool IsAdjacentWithTop() const {
|
||||||
return mBCoord == mBorderPadding.BStart(mReflowState.GetWritingMode());
|
return mBCoord == mBorderPadding.BStart(mReflowInput.GetWritingMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -209,7 +209,7 @@ public:
|
|||||||
|
|
||||||
nsPresContext* mPresContext;
|
nsPresContext* mPresContext;
|
||||||
|
|
||||||
const ReflowInput& mReflowState;
|
const ReflowInput& mReflowInput;
|
||||||
|
|
||||||
nsFloatManager* mFloatManager;
|
nsFloatManager* mFloatManager;
|
||||||
|
|
||||||
@@ -242,25 +242,25 @@ public:
|
|||||||
// coordinate overflow may occur.
|
// coordinate overflow may occur.
|
||||||
mozilla::LogicalRect mContentArea;
|
mozilla::LogicalRect mContentArea;
|
||||||
nscoord ContentIStart() const {
|
nscoord ContentIStart() const {
|
||||||
return mContentArea.IStart(mReflowState.GetWritingMode());
|
return mContentArea.IStart(mReflowInput.GetWritingMode());
|
||||||
}
|
}
|
||||||
nscoord ContentISize() const {
|
nscoord ContentISize() const {
|
||||||
return mContentArea.ISize(mReflowState.GetWritingMode());
|
return mContentArea.ISize(mReflowInput.GetWritingMode());
|
||||||
}
|
}
|
||||||
nscoord ContentIEnd() const {
|
nscoord ContentIEnd() const {
|
||||||
return mContentArea.IEnd(mReflowState.GetWritingMode());
|
return mContentArea.IEnd(mReflowInput.GetWritingMode());
|
||||||
}
|
}
|
||||||
nscoord ContentBStart() const {
|
nscoord ContentBStart() const {
|
||||||
return mContentArea.BStart(mReflowState.GetWritingMode());
|
return mContentArea.BStart(mReflowInput.GetWritingMode());
|
||||||
}
|
}
|
||||||
nscoord ContentBSize() const {
|
nscoord ContentBSize() const {
|
||||||
return mContentArea.BSize(mReflowState.GetWritingMode());
|
return mContentArea.BSize(mReflowInput.GetWritingMode());
|
||||||
}
|
}
|
||||||
nscoord ContentBEnd() const {
|
nscoord ContentBEnd() const {
|
||||||
return mContentArea.BEnd(mReflowState.GetWritingMode());
|
return mContentArea.BEnd(mReflowInput.GetWritingMode());
|
||||||
}
|
}
|
||||||
mozilla::LogicalSize ContentSize(mozilla::WritingMode aWM) const {
|
mozilla::LogicalSize ContentSize(mozilla::WritingMode aWM) const {
|
||||||
mozilla::WritingMode wm = mReflowState.GetWritingMode();
|
mozilla::WritingMode wm = mReflowInput.GetWritingMode();
|
||||||
return mContentArea.Size(wm).ConvertTo(aWM, wm);
|
return mContentArea.Size(wm).ConvertTo(aWM, wm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext,
|
|||||||
MOZ_ASSERT(aPresContext, "no pres context");
|
MOZ_ASSERT(aPresContext, "no pres context");
|
||||||
MOZ_ASSERT(aFrame, "no frame");
|
MOZ_ASSERT(aFrame, "no frame");
|
||||||
MOZ_ASSERT(aPresContext == aFrame->PresContext(), "wrong pres context");
|
MOZ_ASSERT(aPresContext == aFrame->PresContext(), "wrong pres context");
|
||||||
mParentReflowState = nullptr;
|
mParentReflowInput = nullptr;
|
||||||
AvailableISize() = aAvailableSpace.ISize(mWritingMode);
|
AvailableISize() = aAvailableSpace.ISize(mWritingMode);
|
||||||
AvailableBSize() = aAvailableSpace.BSize(mWritingMode);
|
AvailableBSize() = aAvailableSpace.BSize(mWritingMode);
|
||||||
mFloatManager = nullptr;
|
mFloatManager = nullptr;
|
||||||
@@ -76,7 +76,7 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext,
|
|||||||
mPercentBSizeObserver = nullptr;
|
mPercentBSizeObserver = nullptr;
|
||||||
|
|
||||||
if (aFlags & DUMMY_PARENT_REFLOW_STATE) {
|
if (aFlags & DUMMY_PARENT_REFLOW_STATE) {
|
||||||
mFlags.mDummyParentReflowState = true;
|
mFlags.mDummyParentReflowInput = true;
|
||||||
}
|
}
|
||||||
if (aFlags & COMPUTE_SIZE_SHRINK_WRAP) {
|
if (aFlags & COMPUTE_SIZE_SHRINK_WRAP) {
|
||||||
mFlags.mShrinkWrap = true;
|
mFlags.mShrinkWrap = true;
|
||||||
@@ -166,7 +166,7 @@ SizeComputationInput::SizeComputationInput(nsIFrame *aFrame,
|
|||||||
"padding contribution - see SizeComputationInput::InitOffsets");
|
"padding contribution - see SizeComputationInput::InitOffsets");
|
||||||
LogicalSize cbSize(aContainingBlockWritingMode, aContainingBlockISize,
|
LogicalSize cbSize(aContainingBlockWritingMode, aContainingBlockISize,
|
||||||
aContainingBlockISize);
|
aContainingBlockISize);
|
||||||
ReflowStateFlags flags;
|
ReflowInputFlags flags;
|
||||||
InitOffsets(aContainingBlockWritingMode, cbSize, mFrame->GetType(), flags);
|
InitOffsets(aContainingBlockWritingMode, cbSize, mFrame->GetType(), flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,16 +175,16 @@ SizeComputationInput::SizeComputationInput(nsIFrame *aFrame,
|
|||||||
// computed.
|
// computed.
|
||||||
ReflowInput::ReflowInput(
|
ReflowInput::ReflowInput(
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aParentReflowState,
|
const ReflowInput& aParentReflowInput,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
const LogicalSize& aAvailableSpace,
|
const LogicalSize& aAvailableSpace,
|
||||||
const LogicalSize* aContainingBlockSize,
|
const LogicalSize* aContainingBlockSize,
|
||||||
uint32_t aFlags)
|
uint32_t aFlags)
|
||||||
: SizeComputationInput(aFrame, aParentReflowState.mRenderingContext)
|
: SizeComputationInput(aFrame, aParentReflowInput.mRenderingContext)
|
||||||
, mBlockDelta(0)
|
, mBlockDelta(0)
|
||||||
, mOrthogonalLimit(NS_UNCONSTRAINEDSIZE)
|
, mOrthogonalLimit(NS_UNCONSTRAINEDSIZE)
|
||||||
, mReflowDepth(aParentReflowState.mReflowDepth + 1)
|
, mReflowDepth(aParentReflowInput.mReflowDepth + 1)
|
||||||
, mFlags(aParentReflowState.mFlags)
|
, mFlags(aParentReflowInput.mFlags)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aPresContext, "no pres context");
|
MOZ_ASSERT(aPresContext, "no pres context");
|
||||||
MOZ_ASSERT(aFrame, "no frame");
|
MOZ_ASSERT(aFrame, "no frame");
|
||||||
@@ -193,56 +193,56 @@ ReflowInput::ReflowInput(
|
|||||||
!NS_SUBTREE_DIRTY(aFrame),
|
!NS_SUBTREE_DIRTY(aFrame),
|
||||||
"frame should be clean when getting special bsize reflow");
|
"frame should be clean when getting special bsize reflow");
|
||||||
|
|
||||||
mParentReflowState = &aParentReflowState;
|
mParentReflowInput = &aParentReflowInput;
|
||||||
|
|
||||||
// If the parent is dirty, then the child is as well.
|
// If the parent is dirty, then the child is as well.
|
||||||
// XXX Are the other cases where the parent reflows a child a second
|
// XXX Are the other cases where the parent reflows a child a second
|
||||||
// time, as a resize?
|
// time, as a resize?
|
||||||
if (!mFlags.mSpecialBSizeReflow)
|
if (!mFlags.mSpecialBSizeReflow)
|
||||||
mFrame->AddStateBits(mParentReflowState->mFrame->GetStateBits() &
|
mFrame->AddStateBits(mParentReflowInput->mFrame->GetStateBits() &
|
||||||
NS_FRAME_IS_DIRTY);
|
NS_FRAME_IS_DIRTY);
|
||||||
|
|
||||||
AvailableISize() = aAvailableSpace.ISize(mWritingMode);
|
AvailableISize() = aAvailableSpace.ISize(mWritingMode);
|
||||||
AvailableBSize() = aAvailableSpace.BSize(mWritingMode);
|
AvailableBSize() = aAvailableSpace.BSize(mWritingMode);
|
||||||
|
|
||||||
if (mWritingMode.IsOrthogonalTo(aParentReflowState.GetWritingMode())) {
|
if (mWritingMode.IsOrthogonalTo(aParentReflowInput.GetWritingMode())) {
|
||||||
// If we're setting up for an orthogonal flow, and the parent reflow state
|
// If we're setting up for an orthogonal flow, and the parent reflow state
|
||||||
// had a constrained ComputedBSize, we can use that as our AvailableISize
|
// had a constrained ComputedBSize, we can use that as our AvailableISize
|
||||||
// in preference to leaving it unconstrained.
|
// in preference to leaving it unconstrained.
|
||||||
if (AvailableISize() == NS_UNCONSTRAINEDSIZE &&
|
if (AvailableISize() == NS_UNCONSTRAINEDSIZE &&
|
||||||
aParentReflowState.ComputedBSize() != NS_UNCONSTRAINEDSIZE) {
|
aParentReflowInput.ComputedBSize() != NS_UNCONSTRAINEDSIZE) {
|
||||||
AvailableISize() = aParentReflowState.ComputedBSize();
|
AvailableISize() = aParentReflowInput.ComputedBSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mFloatManager = aParentReflowState.mFloatManager;
|
mFloatManager = aParentReflowInput.mFloatManager;
|
||||||
if (mFrame->IsFrameOfType(nsIFrame::eLineParticipant))
|
if (mFrame->IsFrameOfType(nsIFrame::eLineParticipant))
|
||||||
mLineLayout = aParentReflowState.mLineLayout;
|
mLineLayout = aParentReflowInput.mLineLayout;
|
||||||
else
|
else
|
||||||
mLineLayout = nullptr;
|
mLineLayout = nullptr;
|
||||||
|
|
||||||
// Note: mFlags was initialized as a copy of aParentReflowState.mFlags up in
|
// Note: mFlags was initialized as a copy of aParentReflowInput.mFlags up in
|
||||||
// this constructor's init list, so the only flags that we need to explicitly
|
// this constructor's init list, so the only flags that we need to explicitly
|
||||||
// initialize here are those that may need a value other than our parent's.
|
// initialize here are those that may need a value other than our parent's.
|
||||||
mFlags.mNextInFlowUntouched = aParentReflowState.mFlags.mNextInFlowUntouched &&
|
mFlags.mNextInFlowUntouched = aParentReflowInput.mFlags.mNextInFlowUntouched &&
|
||||||
CheckNextInFlowParenthood(aFrame, aParentReflowState.mFrame);
|
CheckNextInFlowParenthood(aFrame, aParentReflowInput.mFrame);
|
||||||
mFlags.mAssumingHScrollbar = mFlags.mAssumingVScrollbar = false;
|
mFlags.mAssumingHScrollbar = mFlags.mAssumingVScrollbar = false;
|
||||||
mFlags.mIsColumnBalancing = false;
|
mFlags.mIsColumnBalancing = false;
|
||||||
mFlags.mIsFlexContainerMeasuringHeight = false;
|
mFlags.mIsFlexContainerMeasuringHeight = false;
|
||||||
mFlags.mDummyParentReflowState = false;
|
mFlags.mDummyParentReflowInput = false;
|
||||||
mFlags.mShrinkWrap = !!(aFlags & COMPUTE_SIZE_SHRINK_WRAP);
|
mFlags.mShrinkWrap = !!(aFlags & COMPUTE_SIZE_SHRINK_WRAP);
|
||||||
mFlags.mUseAutoBSize = !!(aFlags & COMPUTE_SIZE_USE_AUTO_BSIZE);
|
mFlags.mUseAutoBSize = !!(aFlags & COMPUTE_SIZE_USE_AUTO_BSIZE);
|
||||||
mFlags.mStaticPosIsCBOrigin = !!(aFlags & STATIC_POS_IS_CB_ORIGIN);
|
mFlags.mStaticPosIsCBOrigin = !!(aFlags & STATIC_POS_IS_CB_ORIGIN);
|
||||||
|
|
||||||
mDiscoveredClearance = nullptr;
|
mDiscoveredClearance = nullptr;
|
||||||
mPercentBSizeObserver = (aParentReflowState.mPercentBSizeObserver &&
|
mPercentBSizeObserver = (aParentReflowInput.mPercentBSizeObserver &&
|
||||||
aParentReflowState.mPercentBSizeObserver->NeedsToObserve(*this))
|
aParentReflowInput.mPercentBSizeObserver->NeedsToObserve(*this))
|
||||||
? aParentReflowState.mPercentBSizeObserver : nullptr;
|
? aParentReflowInput.mPercentBSizeObserver : nullptr;
|
||||||
|
|
||||||
if ((aFlags & DUMMY_PARENT_REFLOW_STATE) ||
|
if ((aFlags & DUMMY_PARENT_REFLOW_STATE) ||
|
||||||
(mParentReflowState->mFlags.mDummyParentReflowState &&
|
(mParentReflowInput->mFlags.mDummyParentReflowInput &&
|
||||||
mFrame->GetType() == nsGkAtoms::tableFrame)) {
|
mFrame->GetType() == nsGkAtoms::tableFrame)) {
|
||||||
mFlags.mDummyParentReflowState = true;
|
mFlags.mDummyParentReflowInput = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(aFlags & CALLER_WILL_INIT)) {
|
if (!(aFlags & CALLER_WILL_INIT)) {
|
||||||
@@ -354,8 +354,8 @@ ReflowInput::Init(nsPresContext* aPresContext,
|
|||||||
if (AvailableISize() == NS_UNCONSTRAINEDSIZE) {
|
if (AvailableISize() == NS_UNCONSTRAINEDSIZE) {
|
||||||
// Look up the parent chain for an orthogonal inline limit,
|
// Look up the parent chain for an orthogonal inline limit,
|
||||||
// and reset AvailableISize() if found.
|
// and reset AvailableISize() if found.
|
||||||
for (const ReflowInput *parent = mParentReflowState;
|
for (const ReflowInput *parent = mParentReflowInput;
|
||||||
parent != nullptr; parent = parent->mParentReflowState) {
|
parent != nullptr; parent = parent->mParentReflowInput) {
|
||||||
if (parent->GetWritingMode().IsOrthogonalTo(mWritingMode) &&
|
if (parent->GetWritingMode().IsOrthogonalTo(mWritingMode) &&
|
||||||
parent->mOrthogonalLimit != NS_UNCONSTRAINEDSIZE) {
|
parent->mOrthogonalLimit != NS_UNCONSTRAINEDSIZE) {
|
||||||
AvailableISize() = parent->mOrthogonalLimit;
|
AvailableISize() = parent->mOrthogonalLimit;
|
||||||
@@ -380,7 +380,7 @@ ReflowInput::Init(nsPresContext* aPresContext,
|
|||||||
nsIAtom* type = mFrame->GetType();
|
nsIAtom* type = mFrame->GetType();
|
||||||
|
|
||||||
InitFrameType(type);
|
InitFrameType(type);
|
||||||
InitCBReflowState();
|
InitCBReflowInput();
|
||||||
|
|
||||||
LogicalSize cbSize(mWritingMode, -1, -1);
|
LogicalSize cbSize(mWritingMode, -1, -1);
|
||||||
if (aContainingBlockSize) {
|
if (aContainingBlockSize) {
|
||||||
@@ -446,8 +446,8 @@ ReflowInput::Init(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mParentReflowState &&
|
if (mParentReflowInput &&
|
||||||
mParentReflowState->GetWritingMode().IsOrthogonalTo(mWritingMode)) {
|
mParentReflowInput->GetWritingMode().IsOrthogonalTo(mWritingMode)) {
|
||||||
// Orthogonal frames are always reflowed with an unconstrained
|
// Orthogonal frames are always reflowed with an unconstrained
|
||||||
// dimension to avoid incomplete reflow across an orthogonal
|
// dimension to avoid incomplete reflow across an orthogonal
|
||||||
// boundary. Normally this is the block-size, but for column sets
|
// boundary. Normally this is the block-size, but for column sets
|
||||||
@@ -470,23 +470,23 @@ ReflowInput::Init(nsPresContext* aPresContext,
|
|||||||
"intrinsic inline-size calculation");
|
"intrinsic inline-size calculation");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReflowInput::InitCBReflowState()
|
void ReflowInput::InitCBReflowInput()
|
||||||
{
|
{
|
||||||
if (!mParentReflowState) {
|
if (!mParentReflowInput) {
|
||||||
mCBReflowState = nullptr;
|
mCBReflowInput = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mParentReflowState->mFrame == mFrame->GetContainingBlock()) {
|
if (mParentReflowInput->mFrame == mFrame->GetContainingBlock()) {
|
||||||
// Inner table frames need to use the containing block of the outer
|
// Inner table frames need to use the containing block of the outer
|
||||||
// table frame.
|
// table frame.
|
||||||
if (mFrame->GetType() == nsGkAtoms::tableFrame) {
|
if (mFrame->GetType() == nsGkAtoms::tableFrame) {
|
||||||
mCBReflowState = mParentReflowState->mCBReflowState;
|
mCBReflowInput = mParentReflowInput->mCBReflowInput;
|
||||||
} else {
|
} else {
|
||||||
mCBReflowState = mParentReflowState;
|
mCBReflowInput = mParentReflowInput;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mCBReflowState = mParentReflowState->mCBReflowState;
|
mCBReflowInput = mParentReflowInput->mCBReflowInput;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -535,7 +535,7 @@ ReflowInput::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType)
|
|||||||
// (where we shouldn't be inflating anyway, and where
|
// (where we shouldn't be inflating anyway, and where
|
||||||
// reflow state construction is probably to construct a
|
// reflow state construction is probably to construct a
|
||||||
// dummy parent reflow state anyway).
|
// dummy parent reflow state anyway).
|
||||||
!mFlags.mDummyParentReflowState;
|
!mFlags.mDummyParentReflowInput;
|
||||||
|
|
||||||
if (dirty || (!mFrame->GetParent() && isIResize)) {
|
if (dirty || (!mFrame->GetParent() && isIResize)) {
|
||||||
// When font size inflation is enabled, a change in either:
|
// When font size inflation is enabled, a change in either:
|
||||||
@@ -615,7 +615,7 @@ ReflowInput::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType)
|
|||||||
SetIResize(!(mFrame->GetStateBits() & NS_FRAME_IS_DIRTY) &&
|
SetIResize(!(mFrame->GetStateBits() & NS_FRAME_IS_DIRTY) &&
|
||||||
isIResize);
|
isIResize);
|
||||||
|
|
||||||
// XXX Should we really need to null check mCBReflowState? (We do for
|
// XXX Should we really need to null check mCBReflowInput? (We do for
|
||||||
// at least nsBoxFrame).
|
// at least nsBoxFrame).
|
||||||
if (IS_TABLE_CELL(aFrameType) &&
|
if (IS_TABLE_CELL(aFrameType) &&
|
||||||
(mFlags.mSpecialBSizeReflow ||
|
(mFlags.mSpecialBSizeReflow ||
|
||||||
@@ -623,16 +623,16 @@ ReflowInput::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType)
|
|||||||
NS_TABLE_CELL_HAD_SPECIAL_REFLOW)) &&
|
NS_TABLE_CELL_HAD_SPECIAL_REFLOW)) &&
|
||||||
(mFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
|
(mFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
|
||||||
// Need to set the bit on the cell so that
|
// Need to set the bit on the cell so that
|
||||||
// mCBReflowState->IsBResize() is set correctly below when
|
// mCBReflowInput->IsBResize() is set correctly below when
|
||||||
// reflowing descendant.
|
// reflowing descendant.
|
||||||
SetBResize(true);
|
SetBResize(true);
|
||||||
} else if (mCBReflowState && mFrame->IsBlockWrapper()) {
|
} else if (mCBReflowInput && mFrame->IsBlockWrapper()) {
|
||||||
// XXX Is this problematic for relatively positioned inlines acting
|
// XXX Is this problematic for relatively positioned inlines acting
|
||||||
// as containing block for absolutely positioned elements?
|
// as containing block for absolutely positioned elements?
|
||||||
// Possibly; in that case we should at least be checking
|
// Possibly; in that case we should at least be checking
|
||||||
// NS_SUBTREE_DIRTY, I'd think.
|
// NS_SUBTREE_DIRTY, I'd think.
|
||||||
SetBResize(mCBReflowState->IsBResizeForWM(wm));
|
SetBResize(mCBReflowInput->IsBResizeForWM(wm));
|
||||||
} else if (mCBReflowState && !nsLayoutUtils::GetAsBlock(mFrame)) {
|
} else if (mCBReflowInput && !nsLayoutUtils::GetAsBlock(mFrame)) {
|
||||||
// Some non-block frames (e.g. table frames) aggressively optimize out their
|
// Some non-block frames (e.g. table frames) aggressively optimize out their
|
||||||
// BSize recomputation when they don't have the BResize flag set. This
|
// BSize recomputation when they don't have the BResize flag set. This
|
||||||
// means that if they go from having a computed non-auto height to having an
|
// means that if they go from having a computed non-auto height to having an
|
||||||
@@ -651,14 +651,14 @@ ReflowInput::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType)
|
|||||||
// Note that we _also_ need to set the BResize flag if we have auto
|
// Note that we _also_ need to set the BResize flag if we have auto
|
||||||
// ComputedBSize() and a dirty subtree, since that might require us to
|
// ComputedBSize() and a dirty subtree, since that might require us to
|
||||||
// change BSize due to kids having been added or removed.
|
// change BSize due to kids having been added or removed.
|
||||||
SetBResize(mCBReflowState->IsBResizeForWM(wm));
|
SetBResize(mCBReflowInput->IsBResizeForWM(wm));
|
||||||
if (ComputedBSize() == NS_AUTOHEIGHT) {
|
if (ComputedBSize() == NS_AUTOHEIGHT) {
|
||||||
SetBResize(IsBResize() || NS_SUBTREE_DIRTY(mFrame));
|
SetBResize(IsBResize() || NS_SUBTREE_DIRTY(mFrame));
|
||||||
}
|
}
|
||||||
} else if (ComputedBSize() == NS_AUTOHEIGHT) {
|
} else if (ComputedBSize() == NS_AUTOHEIGHT) {
|
||||||
if (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
|
if (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
|
||||||
mCBReflowState) {
|
mCBReflowInput) {
|
||||||
SetBResize(mCBReflowState->IsBResizeForWM(wm));
|
SetBResize(mCBReflowInput->IsBResizeForWM(wm));
|
||||||
} else {
|
} else {
|
||||||
SetBResize(IsIResize());
|
SetBResize(IsIResize());
|
||||||
}
|
}
|
||||||
@@ -696,10 +696,10 @@ ReflowInput::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType)
|
|||||||
// special bsize reflow. However, don't do this if it actually is
|
// special bsize reflow. However, don't do this if it actually is
|
||||||
// the special bsize reflow, since in that case it will already be
|
// the special bsize reflow, since in that case it will already be
|
||||||
// set correctly above if we need it set.
|
// set correctly above if we need it set.
|
||||||
if (!IsBResize() && mCBReflowState &&
|
if (!IsBResize() && mCBReflowInput &&
|
||||||
(IS_TABLE_CELL(mCBReflowState->mFrame->GetType()) ||
|
(IS_TABLE_CELL(mCBReflowInput->mFrame->GetType()) ||
|
||||||
mCBReflowState->mFlags.mHeightDependsOnAncestorCell) &&
|
mCBReflowInput->mFlags.mHeightDependsOnAncestorCell) &&
|
||||||
!mCBReflowState->mFlags.mSpecialBSizeReflow &&
|
!mCBReflowInput->mFlags.mSpecialBSizeReflow &&
|
||||||
dependsOnCBBSize) {
|
dependsOnCBBSize) {
|
||||||
SetBResize(true);
|
SetBResize(true);
|
||||||
mFlags.mHeightDependsOnAncestorCell = true;
|
mFlags.mHeightDependsOnAncestorCell = true;
|
||||||
@@ -714,11 +714,11 @@ ReflowInput::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType)
|
|||||||
// of table cells) can cause not just a single percentage height to
|
// of table cells) can cause not just a single percentage height to
|
||||||
// become fixed, but an entire descendant chain of percentage height
|
// become fixed, but an entire descendant chain of percentage height
|
||||||
// to become fixed.
|
// to become fixed.
|
||||||
if (dependsOnCBBSize && mCBReflowState) {
|
if (dependsOnCBBSize && mCBReflowInput) {
|
||||||
const ReflowInput *rs = this;
|
const ReflowInput *rs = this;
|
||||||
bool hitCBReflowState = false;
|
bool hitCBReflowInput = false;
|
||||||
do {
|
do {
|
||||||
rs = rs->mParentReflowState;
|
rs = rs->mParentReflowInput;
|
||||||
if (!rs) {
|
if (!rs) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -729,14 +729,14 @@ ReflowInput::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType)
|
|||||||
|
|
||||||
// Keep track of whether we've hit the containing block, because
|
// Keep track of whether we've hit the containing block, because
|
||||||
// we need to go at least that far.
|
// we need to go at least that far.
|
||||||
if (rs == mCBReflowState) {
|
if (rs == mCBReflowInput) {
|
||||||
hitCBReflowState = true;
|
hitCBReflowInput = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX What about orthogonal flows? It doesn't make sense to
|
// XXX What about orthogonal flows? It doesn't make sense to
|
||||||
// keep propagating this bit across an orthogonal boundary,
|
// keep propagating this bit across an orthogonal boundary,
|
||||||
// where the meaning of BSize changes. Bug 1175517.
|
// where the meaning of BSize changes. Bug 1175517.
|
||||||
} while (!hitCBReflowState ||
|
} while (!hitCBReflowInput ||
|
||||||
(eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
|
(eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
|
||||||
!IsQuirkContainingBlockHeight(rs, rs->mFrame->GetType())));
|
!IsQuirkContainingBlockHeight(rs, rs->mFrame->GetType())));
|
||||||
// Note: We actually don't need to set the
|
// Note: We actually don't need to set the
|
||||||
@@ -756,12 +756,12 @@ ReflowInput::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType)
|
|||||||
nscoord
|
nscoord
|
||||||
ReflowInput::GetContainingBlockContentISize(WritingMode aWritingMode) const
|
ReflowInput::GetContainingBlockContentISize(WritingMode aWritingMode) const
|
||||||
{
|
{
|
||||||
if (!mCBReflowState) {
|
if (!mCBReflowInput) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return mCBReflowState->GetWritingMode().IsOrthogonalTo(aWritingMode)
|
return mCBReflowInput->GetWritingMode().IsOrthogonalTo(aWritingMode)
|
||||||
? mCBReflowState->ComputedBSize()
|
? mCBReflowInput->ComputedBSize()
|
||||||
: mCBReflowState->ComputedISize();
|
: mCBReflowInput->ComputedISize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1037,8 +1037,8 @@ ReflowInput::GetHypotheticalBoxContainer(nsIFrame* aFrame,
|
|||||||
If so, use the info from the reflow state. */
|
If so, use the info from the reflow state. */
|
||||||
const ReflowInput* state;
|
const ReflowInput* state;
|
||||||
if (aFrame->GetStateBits() & NS_FRAME_IN_REFLOW) {
|
if (aFrame->GetStateBits() & NS_FRAME_IN_REFLOW) {
|
||||||
for (state = mParentReflowState; state && state->mFrame != aFrame;
|
for (state = mParentReflowInput; state && state->mFrame != aFrame;
|
||||||
state = state->mParentReflowState) {
|
state = state->mParentReflowInput) {
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1842,27 +1842,27 @@ ReflowInput::InitAbsoluteConstraints(nsPresContext* aPresContext,
|
|||||||
// This will not be converted to abstract coordinates because it's only
|
// This will not be converted to abstract coordinates because it's only
|
||||||
// used in CalcQuirkContainingBlockHeight
|
// used in CalcQuirkContainingBlockHeight
|
||||||
nscoord
|
nscoord
|
||||||
GetBlockMarginBorderPadding(const ReflowInput* aReflowState)
|
GetBlockMarginBorderPadding(const ReflowInput* aReflowInput)
|
||||||
{
|
{
|
||||||
nscoord result = 0;
|
nscoord result = 0;
|
||||||
if (!aReflowState) return result;
|
if (!aReflowInput) return result;
|
||||||
|
|
||||||
// zero auto margins
|
// zero auto margins
|
||||||
nsMargin margin = aReflowState->ComputedPhysicalMargin();
|
nsMargin margin = aReflowInput->ComputedPhysicalMargin();
|
||||||
if (NS_AUTOMARGIN == margin.top)
|
if (NS_AUTOMARGIN == margin.top)
|
||||||
margin.top = 0;
|
margin.top = 0;
|
||||||
if (NS_AUTOMARGIN == margin.bottom)
|
if (NS_AUTOMARGIN == margin.bottom)
|
||||||
margin.bottom = 0;
|
margin.bottom = 0;
|
||||||
|
|
||||||
result += margin.top + margin.bottom;
|
result += margin.top + margin.bottom;
|
||||||
result += aReflowState->ComputedPhysicalBorderPadding().top +
|
result += aReflowInput->ComputedPhysicalBorderPadding().top +
|
||||||
aReflowState->ComputedPhysicalBorderPadding().bottom;
|
aReflowInput->ComputedPhysicalBorderPadding().bottom;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the height based on the viewport of the containing block specified
|
/* Get the height based on the viewport of the containing block specified
|
||||||
* in aReflowState when the containing block has mComputedHeight == NS_AUTOHEIGHT
|
* in aReflowInput when the containing block has mComputedHeight == NS_AUTOHEIGHT
|
||||||
* This will walk up the chain of containing blocks looking for a computed height
|
* This will walk up the chain of containing blocks looking for a computed height
|
||||||
* until it finds the canvas frame, or it encounters a frame that is not a block,
|
* until it finds the canvas frame, or it encounters a frame that is not a block,
|
||||||
* area, or scroll frame. This handles compatibility with IE (see bug 85016 and bug 219693)
|
* area, or scroll frame. This handles compatibility with IE (see bug 85016 and bug 219693)
|
||||||
@@ -1873,7 +1873,7 @@ GetBlockMarginBorderPadding(const ReflowInput* aReflowState)
|
|||||||
* See also IsQuirkContainingBlockHeight.
|
* See also IsQuirkContainingBlockHeight.
|
||||||
*/
|
*/
|
||||||
static nscoord
|
static nscoord
|
||||||
CalcQuirkContainingBlockHeight(const ReflowInput* aCBReflowState)
|
CalcQuirkContainingBlockHeight(const ReflowInput* aCBReflowInput)
|
||||||
{
|
{
|
||||||
const ReflowInput* firstAncestorRS = nullptr; // a candidate for html frame
|
const ReflowInput* firstAncestorRS = nullptr; // a candidate for html frame
|
||||||
const ReflowInput* secondAncestorRS = nullptr; // a candidate for body frame
|
const ReflowInput* secondAncestorRS = nullptr; // a candidate for body frame
|
||||||
@@ -1883,8 +1883,8 @@ CalcQuirkContainingBlockHeight(const ReflowInput* aCBReflowState)
|
|||||||
// don't alter this height especially if we are restricted to one level
|
// don't alter this height especially if we are restricted to one level
|
||||||
nscoord result = NS_AUTOHEIGHT;
|
nscoord result = NS_AUTOHEIGHT;
|
||||||
|
|
||||||
const ReflowInput* rs = aCBReflowState;
|
const ReflowInput* rs = aCBReflowInput;
|
||||||
for (; rs; rs = rs->mParentReflowState) {
|
for (; rs; rs = rs->mParentReflowInput) {
|
||||||
nsIAtom* frameType = rs->mFrame->GetType();
|
nsIAtom* frameType = rs->mFrame->GetType();
|
||||||
// if the ancestor is auto height then skip it and continue up if it
|
// if the ancestor is auto height then skip it and continue up if it
|
||||||
// is the first block frame and possibly the body/html
|
// is the first block frame and possibly the body/html
|
||||||
@@ -1958,9 +1958,9 @@ CalcQuirkContainingBlockHeight(const ReflowInput* aCBReflowState)
|
|||||||
}
|
}
|
||||||
// if we got to the html frame (a block child of the canvas) ...
|
// if we got to the html frame (a block child of the canvas) ...
|
||||||
else if (nsGkAtoms::blockFrame == frameType &&
|
else if (nsGkAtoms::blockFrame == frameType &&
|
||||||
rs->mParentReflowState &&
|
rs->mParentReflowInput &&
|
||||||
nsGkAtoms::canvasFrame ==
|
nsGkAtoms::canvasFrame ==
|
||||||
rs->mParentReflowState->mFrame->GetType()) {
|
rs->mParentReflowInput->mFrame->GetType()) {
|
||||||
// ... then subtract out margin/border/padding for the BODY element
|
// ... then subtract out margin/border/padding for the BODY element
|
||||||
result -= GetBlockMarginBorderPadding(secondAncestorRS);
|
result -= GetBlockMarginBorderPadding(secondAncestorRS);
|
||||||
}
|
}
|
||||||
@@ -2099,7 +2099,7 @@ ReflowInput::InitConstraints(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// If this is a reflow root, then set the computed width and
|
// If this is a reflow root, then set the computed width and
|
||||||
// height equal to the available space
|
// height equal to the available space
|
||||||
if (nullptr == mParentReflowState || mFlags.mDummyParentReflowState) {
|
if (nullptr == mParentReflowInput || mFlags.mDummyParentReflowInput) {
|
||||||
// XXXldb This doesn't mean what it used to!
|
// XXXldb This doesn't mean what it used to!
|
||||||
InitOffsets(wm, OffsetPercentBasis(mFrame, wm, aContainingBlockSize),
|
InitOffsets(wm, OffsetPercentBasis(mFrame, wm, aContainingBlockSize),
|
||||||
aFrameType, mFlags, aBorder, aPadding);
|
aFrameType, mFlags, aBorder, aPadding);
|
||||||
@@ -2127,7 +2127,7 @@ ReflowInput::InitConstraints(nsPresContext* aPresContext,
|
|||||||
ComputedMaxWidth() = ComputedMaxHeight() = NS_UNCONSTRAINEDSIZE;
|
ComputedMaxWidth() = ComputedMaxHeight() = NS_UNCONSTRAINEDSIZE;
|
||||||
} else {
|
} else {
|
||||||
// Get the containing block reflow state
|
// Get the containing block reflow state
|
||||||
const ReflowInput* cbrs = mCBReflowState;
|
const ReflowInput* cbrs = mCBReflowInput;
|
||||||
NS_ASSERTION(nullptr != cbrs, "no containing block");
|
NS_ASSERTION(nullptr != cbrs, "no containing block");
|
||||||
|
|
||||||
// If we weren't given a containing block width and height, then
|
// If we weren't given a containing block width and height, then
|
||||||
@@ -2143,7 +2143,7 @@ ReflowInput::InitConstraints(nsPresContext* aPresContext,
|
|||||||
// See if the containing block is a cell frame which needs
|
// See if the containing block is a cell frame which needs
|
||||||
// to use the mComputedHeight of the cell instead of what the cell block passed in.
|
// to use the mComputedHeight of the cell instead of what the cell block passed in.
|
||||||
// XXX It seems like this could lead to bugs with min-height and friends
|
// XXX It seems like this could lead to bugs with min-height and friends
|
||||||
if (cbrs->mParentReflowState) {
|
if (cbrs->mParentReflowInput) {
|
||||||
fType = cbrs->mFrame->GetType();
|
fType = cbrs->mFrame->GetType();
|
||||||
if (IS_TABLE_CELL(fType)) {
|
if (IS_TABLE_CELL(fType)) {
|
||||||
// use the cell's computed block size
|
// use the cell's computed block size
|
||||||
@@ -2336,8 +2336,8 @@ ReflowInput::InitConstraints(nsPresContext* aPresContext,
|
|||||||
mFrame->StyleContext()->GetPseudo() != nsCSSAnonBoxes::scrolledContent) ||
|
mFrame->StyleContext()->GetPseudo() != nsCSSAnonBoxes::scrolledContent) ||
|
||||||
(aFrameType == nsGkAtoms::scrollFrame &&
|
(aFrameType == nsGkAtoms::scrollFrame &&
|
||||||
mFrame->GetContentInsertionFrame()->GetType() == nsGkAtoms::legendFrame) ||
|
mFrame->GetContentInsertionFrame()->GetType() == nsGkAtoms::legendFrame) ||
|
||||||
(mCBReflowState &&
|
(mCBReflowInput &&
|
||||||
mCBReflowState->GetWritingMode().IsOrthogonalTo(mWritingMode)))) {
|
mCBReflowInput->GetWritingMode().IsOrthogonalTo(mWritingMode)))) {
|
||||||
computeSizeFlags =
|
computeSizeFlags =
|
||||||
ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eShrinkWrap);
|
ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eShrinkWrap);
|
||||||
}
|
}
|
||||||
@@ -2414,7 +2414,7 @@ void
|
|||||||
SizeComputationInput::InitOffsets(WritingMode aWM,
|
SizeComputationInput::InitOffsets(WritingMode aWM,
|
||||||
const LogicalSize& aPercentBasis,
|
const LogicalSize& aPercentBasis,
|
||||||
nsIAtom* aFrameType,
|
nsIAtom* aFrameType,
|
||||||
ReflowStateFlags aFlags,
|
ReflowInputFlags aFlags,
|
||||||
const nsMargin* aBorder,
|
const nsMargin* aBorder,
|
||||||
const nsMargin* aPadding)
|
const nsMargin* aPadding)
|
||||||
{
|
{
|
||||||
@@ -2567,7 +2567,7 @@ ReflowInput::CalculateBlockSideMargins(nsIAtom* aFrameType)
|
|||||||
// the BStart/BEnd margins; those are the "sides" of the block from its
|
// the BStart/BEnd margins; those are the "sides" of the block from its
|
||||||
// container's point of view.
|
// container's point of view.
|
||||||
WritingMode cbWM =
|
WritingMode cbWM =
|
||||||
mCBReflowState ? mCBReflowState->GetWritingMode(): GetWritingMode();
|
mCBReflowInput ? mCBReflowInput->GetWritingMode(): GetWritingMode();
|
||||||
|
|
||||||
nscoord availISizeCBWM = AvailableSize(cbWM).ISize(cbWM);
|
nscoord availISizeCBWM = AvailableSize(cbWM).ISize(cbWM);
|
||||||
nscoord computedISizeCBWM = ComputedSize(cbWM).ISize(cbWM);
|
nscoord computedISizeCBWM = ComputedSize(cbWM).ISize(cbWM);
|
||||||
@@ -2618,13 +2618,13 @@ ReflowInput::CalculateBlockSideMargins(nsIAtom* aFrameType)
|
|||||||
// 'direction' property of the parent to tell which margin to
|
// 'direction' property of the parent to tell which margin to
|
||||||
// ignore
|
// ignore
|
||||||
// First check if there is an HTML alignment that we should honor
|
// First check if there is an HTML alignment that we should honor
|
||||||
const ReflowInput* prs = mParentReflowState;
|
const ReflowInput* prs = mParentReflowInput;
|
||||||
if (aFrameType == nsGkAtoms::tableFrame) {
|
if (aFrameType == nsGkAtoms::tableFrame) {
|
||||||
NS_ASSERTION(prs->mFrame->GetType() == nsGkAtoms::tableWrapperFrame,
|
NS_ASSERTION(prs->mFrame->GetType() == nsGkAtoms::tableWrapperFrame,
|
||||||
"table not inside table wrapper");
|
"table not inside table wrapper");
|
||||||
// Center the table within the table wrapper based on the alignment
|
// Center the table within the table wrapper based on the alignment
|
||||||
// of the table wrapper's parent.
|
// of the table wrapper's parent.
|
||||||
prs = prs->mParentReflowState;
|
prs = prs->mParentReflowInput;
|
||||||
}
|
}
|
||||||
if (prs &&
|
if (prs &&
|
||||||
(prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_LEFT ||
|
(prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_LEFT ||
|
||||||
@@ -2748,7 +2748,7 @@ ReflowInput::CalcLineHeight() const
|
|||||||
{
|
{
|
||||||
nscoord blockBSize =
|
nscoord blockBSize =
|
||||||
nsLayoutUtils::IsNonWrapperBlock(mFrame) ? ComputedBSize() :
|
nsLayoutUtils::IsNonWrapperBlock(mFrame) ? ComputedBSize() :
|
||||||
(mCBReflowState ? mCBReflowState->ComputedBSize() : NS_AUTOHEIGHT);
|
(mCBReflowInput ? mCBReflowInput->ComputedBSize() : NS_AUTOHEIGHT);
|
||||||
|
|
||||||
return CalcLineHeight(mFrame->GetContent(), mFrame->StyleContext(), blockBSize,
|
return CalcLineHeight(mFrame->GetContent(), mFrame->StyleContext(), blockBSize,
|
||||||
nsLayoutUtils::FontSizeInflationFor(mFrame));
|
nsLayoutUtils::FontSizeInflationFor(mFrame));
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ public:
|
|||||||
mozilla::WritingMode aContainingBlockWritingMode,
|
mozilla::WritingMode aContainingBlockWritingMode,
|
||||||
nscoord aContainingBlockISize);
|
nscoord aContainingBlockISize);
|
||||||
|
|
||||||
struct ReflowStateFlags {
|
struct ReflowInputFlags {
|
||||||
ReflowStateFlags() { memset(this, 0, sizeof(*this)); }
|
ReflowInputFlags() { memset(this, 0, sizeof(*this)); }
|
||||||
uint16_t mSpecialBSizeReflow:1; // used by tables to communicate special reflow (in process) to handle
|
uint16_t mSpecialBSizeReflow:1; // used by tables to communicate special reflow (in process) to handle
|
||||||
// percent bsize frames inside cells which may not have computed bsizes
|
// percent bsize frames inside cells which may not have computed bsizes
|
||||||
uint16_t mNextInFlowUntouched:1; // nothing in the frame's next-in-flow (or its descendants)
|
uint16_t mNextInFlowUntouched:1; // nothing in the frame's next-in-flow (or its descendants)
|
||||||
@@ -206,7 +206,7 @@ public:
|
|||||||
uint16_t mIsFlexContainerMeasuringHeight:1; // nsFlexContainerFrame is
|
uint16_t mIsFlexContainerMeasuringHeight:1; // nsFlexContainerFrame is
|
||||||
// reflowing this child to
|
// reflowing this child to
|
||||||
// measure its intrinsic height.
|
// measure its intrinsic height.
|
||||||
uint16_t mDummyParentReflowState:1; // a "fake" reflow state made
|
uint16_t mDummyParentReflowInput:1; // a "fake" reflow state made
|
||||||
// in order to be the parent
|
// in order to be the parent
|
||||||
// of a real one
|
// of a real one
|
||||||
uint16_t mMustReflowPlaceholders:1; // Should this frame reflow its place-
|
uint16_t mMustReflowPlaceholders:1; // Should this frame reflow its place-
|
||||||
@@ -281,7 +281,7 @@ protected:
|
|||||||
void InitOffsets(mozilla::WritingMode aWM,
|
void InitOffsets(mozilla::WritingMode aWM,
|
||||||
const mozilla::LogicalSize& aPercentBasis,
|
const mozilla::LogicalSize& aPercentBasis,
|
||||||
nsIAtom* aFrameType,
|
nsIAtom* aFrameType,
|
||||||
ReflowStateFlags aFlags,
|
ReflowInputFlags aFlags,
|
||||||
const nsMargin* aBorder = nullptr,
|
const nsMargin* aBorder = nullptr,
|
||||||
const nsMargin* aPadding = nullptr);
|
const nsMargin* aPadding = nullptr);
|
||||||
|
|
||||||
@@ -317,7 +317,7 @@ protected:
|
|||||||
struct ReflowInput : public SizeComputationInput {
|
struct ReflowInput : public SizeComputationInput {
|
||||||
// the reflow states are linked together. this is the pointer to the
|
// the reflow states are linked together. this is the pointer to the
|
||||||
// parent's reflow state
|
// parent's reflow state
|
||||||
const ReflowInput* mParentReflowState;
|
const ReflowInput* mParentReflowInput;
|
||||||
|
|
||||||
// pointer to the float manager associated with this area
|
// pointer to the float manager associated with this area
|
||||||
nsFloatManager* mFloatManager;
|
nsFloatManager* mFloatManager;
|
||||||
@@ -327,7 +327,7 @@ struct ReflowInput : public SizeComputationInput {
|
|||||||
|
|
||||||
// The appropriate reflow state for the containing block (for
|
// The appropriate reflow state for the containing block (for
|
||||||
// percentage widths, etc.) of this reflow state's frame.
|
// percentage widths, etc.) of this reflow state's frame.
|
||||||
const ReflowInput *mCBReflowState;
|
const ReflowInput *mCBReflowInput;
|
||||||
|
|
||||||
// The type of frame, from css's perspective. This value is
|
// The type of frame, from css's perspective. This value is
|
||||||
// initialized by the Init method below.
|
// initialized by the Init method below.
|
||||||
@@ -344,7 +344,7 @@ struct ReflowInput : public SizeComputationInput {
|
|||||||
nscoord mBlockDelta;
|
nscoord mBlockDelta;
|
||||||
|
|
||||||
// If an ReflowInput finds itself initialized with an unconstrained
|
// If an ReflowInput finds itself initialized with an unconstrained
|
||||||
// inline-size, it will look up its parentReflowState chain for a state
|
// inline-size, it will look up its parentReflowInput chain for a state
|
||||||
// with an orthogonal writing mode and a non-NS_UNCONSTRAINEDSIZE value for
|
// with an orthogonal writing mode and a non-NS_UNCONSTRAINEDSIZE value for
|
||||||
// orthogonal limit; when it finds such a reflow-state, it will use its
|
// orthogonal limit; when it finds such a reflow-state, it will use its
|
||||||
// orthogonal-limit value to constrain inline-size.
|
// orthogonal-limit value to constrain inline-size.
|
||||||
@@ -591,7 +591,7 @@ public:
|
|||||||
// This value keeps track of how deeply nested a given reflow state
|
// This value keeps track of how deeply nested a given reflow state
|
||||||
// is from the top of the frame tree.
|
// is from the top of the frame tree.
|
||||||
int16_t mReflowDepth;
|
int16_t mReflowDepth;
|
||||||
ReflowStateFlags mFlags;
|
ReflowInputFlags mFlags;
|
||||||
|
|
||||||
// Logical and physical accessors for the resize flags. All users should go
|
// Logical and physical accessors for the resize flags. All users should go
|
||||||
// via these accessors, so that in due course we can change the storage from
|
// via these accessors, so that in due course we can change the storage from
|
||||||
@@ -659,7 +659,7 @@ public:
|
|||||||
* state are copied from the parent's reflow state. The remainder is computed.
|
* state are copied from the parent's reflow state. The remainder is computed.
|
||||||
*
|
*
|
||||||
* @param aPresContext Must be equal to aFrame->PresContext().
|
* @param aPresContext Must be equal to aFrame->PresContext().
|
||||||
* @param aParentReflowState A reference to an ReflowInput object that
|
* @param aParentReflowInput A reference to an ReflowInput object that
|
||||||
* is to be the parent of this object.
|
* is to be the parent of this object.
|
||||||
* @param aFrame The frame for whose reflow state is being constructed.
|
* @param aFrame The frame for whose reflow state is being constructed.
|
||||||
* @param aAvailableSpace See comments for availableHeight and availableWidth
|
* @param aAvailableSpace See comments for availableHeight and availableWidth
|
||||||
@@ -671,7 +671,7 @@ public:
|
|||||||
* below).
|
* below).
|
||||||
*/
|
*/
|
||||||
ReflowInput(nsPresContext* aPresContext,
|
ReflowInput(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aParentReflowState,
|
const ReflowInput& aParentReflowInput,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
const mozilla::LogicalSize& aAvailableSpace,
|
const mozilla::LogicalSize& aAvailableSpace,
|
||||||
const mozilla::LogicalSize* aContainingBlockSize = nullptr,
|
const mozilla::LogicalSize* aContainingBlockSize = nullptr,
|
||||||
@@ -680,7 +680,7 @@ public:
|
|||||||
// Values for |aFlags| passed to constructor
|
// Values for |aFlags| passed to constructor
|
||||||
enum {
|
enum {
|
||||||
// Indicates that the parent of this reflow state is "fake" (see
|
// Indicates that the parent of this reflow state is "fake" (see
|
||||||
// mDummyParentReflowState in mFlags).
|
// mDummyParentReflowInput in mFlags).
|
||||||
DUMMY_PARENT_REFLOW_STATE = (1<<0),
|
DUMMY_PARENT_REFLOW_STATE = (1<<0),
|
||||||
|
|
||||||
// Indicates that the calling function will initialize the reflow state, and
|
// Indicates that the calling function will initialize the reflow state, and
|
||||||
@@ -922,7 +922,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void InitFrameType(nsIAtom* aFrameType);
|
void InitFrameType(nsIAtom* aFrameType);
|
||||||
void InitCBReflowState();
|
void InitCBReflowInput();
|
||||||
void InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType);
|
void InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType);
|
||||||
|
|
||||||
void InitConstraints(nsPresContext* aPresContext,
|
void InitConstraints(nsPresContext* aPresContext,
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ nsAbsoluteContainingBlock::RemoveFrame(nsIFrame* aDelegatingFrame,
|
|||||||
void
|
void
|
||||||
nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aReflowStatus,
|
nsReflowStatus& aReflowStatus,
|
||||||
const nsRect& aContainingBlock,
|
const nsRect& aContainingBlock,
|
||||||
AbsPosReflowFlags aFlags,
|
AbsPosReflowFlags aFlags,
|
||||||
@@ -118,7 +118,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
|||||||
{
|
{
|
||||||
nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
const bool reflowAll = aReflowState.ShouldReflowAllKids();
|
const bool reflowAll = aReflowInput.ShouldReflowAllKids();
|
||||||
const bool isGrid = !!(aFlags & AbsPosReflowFlags::eIsGridContainerCB);
|
const bool isGrid = !!(aFlags & AbsPosReflowFlags::eIsGridContainerCB);
|
||||||
nsIFrame* kidFrame;
|
nsIFrame* kidFrame;
|
||||||
nsOverflowContinuationTracker tracker(aDelegatingFrame, true);
|
nsOverflowContinuationTracker tracker(aDelegatingFrame, true);
|
||||||
@@ -132,7 +132,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
|||||||
nsReflowStatus kidStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus kidStatus = NS_FRAME_COMPLETE;
|
||||||
const nsRect& cb = isGrid ? nsGridContainerFrame::GridItemCB(kidFrame)
|
const nsRect& cb = isGrid ? nsGridContainerFrame::GridItemCB(kidFrame)
|
||||||
: aContainingBlock;
|
: aContainingBlock;
|
||||||
ReflowAbsoluteFrame(aDelegatingFrame, aPresContext, aReflowState, cb,
|
ReflowAbsoluteFrame(aDelegatingFrame, aPresContext, aReflowInput, cb,
|
||||||
aFlags, kidFrame, kidStatus, aOverflowAreas);
|
aFlags, kidFrame, kidStatus, aOverflowAreas);
|
||||||
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
|
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
|
||||||
if (!NS_FRAME_IS_FULLY_COMPLETE(kidStatus) &&
|
if (!NS_FRAME_IS_FULLY_COMPLETE(kidStatus) &&
|
||||||
@@ -343,7 +343,7 @@ nsAbsoluteContainingBlock::DoMarkFramesDirty(bool aMarkAllDirty)
|
|||||||
void
|
void
|
||||||
nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame,
|
nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
const nsRect& aContainingBlock,
|
const nsRect& aContainingBlock,
|
||||||
AbsPosReflowFlags aFlags,
|
AbsPosReflowFlags aFlags,
|
||||||
nsIFrame* aKidFrame,
|
nsIFrame* aKidFrame,
|
||||||
@@ -360,11 +360,11 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||||||
|
|
||||||
char width[16];
|
char width[16];
|
||||||
char height[16];
|
char height[16];
|
||||||
PrettyUC(aReflowState.AvailableWidth(), width, 16);
|
PrettyUC(aReflowInput.AvailableWidth(), width, 16);
|
||||||
PrettyUC(aReflowState.AvailableHeight(), height, 16);
|
PrettyUC(aReflowInput.AvailableHeight(), height, 16);
|
||||||
printf(" a=%s,%s ", width, height);
|
printf(" a=%s,%s ", width, height);
|
||||||
PrettyUC(aReflowState.ComputedWidth(), width, 16);
|
PrettyUC(aReflowInput.ComputedWidth(), width, 16);
|
||||||
PrettyUC(aReflowState.ComputedHeight(), height, 16);
|
PrettyUC(aReflowInput.ComputedHeight(), height, 16);
|
||||||
printf("c=%s,%s \n", width, height);
|
printf("c=%s,%s \n", width, height);
|
||||||
}
|
}
|
||||||
AutoNoisyIndenter indent(nsBlockFrame::gNoisy);
|
AutoNoisyIndenter indent(nsBlockFrame::gNoisy);
|
||||||
@@ -374,11 +374,11 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||||||
LogicalSize logicalCBSize(wm, aContainingBlock.Size());
|
LogicalSize logicalCBSize(wm, aContainingBlock.Size());
|
||||||
nscoord availISize = logicalCBSize.ISize(wm);
|
nscoord availISize = logicalCBSize.ISize(wm);
|
||||||
if (availISize == -1) {
|
if (availISize == -1) {
|
||||||
NS_ASSERTION(aReflowState.ComputedSize(wm).ISize(wm) !=
|
NS_ASSERTION(aReflowInput.ComputedSize(wm).ISize(wm) !=
|
||||||
NS_UNCONSTRAINEDSIZE,
|
NS_UNCONSTRAINEDSIZE,
|
||||||
"Must have a useful inline-size _somewhere_");
|
"Must have a useful inline-size _somewhere_");
|
||||||
availISize =
|
availISize =
|
||||||
aReflowState.ComputedSizeWithPadding(wm).ISize(wm);
|
aReflowInput.ComputedSizeWithPadding(wm).ISize(wm);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t rsFlags = 0;
|
uint32_t rsFlags = 0;
|
||||||
@@ -392,45 +392,45 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||||||
rsFlags |= ReflowInput::STATIC_POS_IS_CB_ORIGIN;
|
rsFlags |= ReflowInput::STATIC_POS_IS_CB_ORIGIN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ReflowInput kidReflowState(aPresContext, aReflowState, aKidFrame,
|
ReflowInput kidReflowInput(aPresContext, aReflowInput, aKidFrame,
|
||||||
LogicalSize(wm, availISize,
|
LogicalSize(wm, availISize,
|
||||||
NS_UNCONSTRAINEDSIZE),
|
NS_UNCONSTRAINEDSIZE),
|
||||||
&logicalCBSize, rsFlags);
|
&logicalCBSize, rsFlags);
|
||||||
|
|
||||||
// Get the border values
|
// Get the border values
|
||||||
WritingMode outerWM = aReflowState.GetWritingMode();
|
WritingMode outerWM = aReflowInput.GetWritingMode();
|
||||||
const LogicalMargin border(outerWM,
|
const LogicalMargin border(outerWM,
|
||||||
aReflowState.mStyleBorder->GetComputedBorder());
|
aReflowInput.mStyleBorder->GetComputedBorder());
|
||||||
const LogicalMargin margin =
|
const LogicalMargin margin =
|
||||||
kidReflowState.ComputedLogicalMargin().ConvertTo(outerWM, wm);
|
kidReflowInput.ComputedLogicalMargin().ConvertTo(outerWM, wm);
|
||||||
bool constrainBSize = (aReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE)
|
bool constrainBSize = (aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE)
|
||||||
&& (aFlags & AbsPosReflowFlags::eConstrainHeight)
|
&& (aFlags & AbsPosReflowFlags::eConstrainHeight)
|
||||||
// Don't split if told not to (e.g. for fixed frames)
|
// Don't split if told not to (e.g. for fixed frames)
|
||||||
&& (aDelegatingFrame->GetType() != nsGkAtoms::inlineFrame)
|
&& (aDelegatingFrame->GetType() != nsGkAtoms::inlineFrame)
|
||||||
//XXX we don't handle splitting frames for inline absolute containing blocks yet
|
//XXX we don't handle splitting frames for inline absolute containing blocks yet
|
||||||
&& (aKidFrame->GetLogicalRect(aContainingBlock.Size()).BStart(wm) <=
|
&& (aKidFrame->GetLogicalRect(aContainingBlock.Size()).BStart(wm) <=
|
||||||
aReflowState.AvailableBSize());
|
aReflowInput.AvailableBSize());
|
||||||
// Don't split things below the fold. (Ideally we shouldn't *have*
|
// Don't split things below the fold. (Ideally we shouldn't *have*
|
||||||
// anything totally below the fold, but we can't position frames
|
// anything totally below the fold, but we can't position frames
|
||||||
// across next-in-flow breaks yet.
|
// across next-in-flow breaks yet.
|
||||||
if (constrainBSize) {
|
if (constrainBSize) {
|
||||||
kidReflowState.AvailableBSize() =
|
kidReflowInput.AvailableBSize() =
|
||||||
aReflowState.AvailableBSize() - border.ConvertTo(wm, outerWM).BStart(wm) -
|
aReflowInput.AvailableBSize() - border.ConvertTo(wm, outerWM).BStart(wm) -
|
||||||
kidReflowState.ComputedLogicalMargin().BStart(wm);
|
kidReflowInput.ComputedLogicalMargin().BStart(wm);
|
||||||
if (NS_AUTOOFFSET != kidReflowState.ComputedLogicalOffsets().BStart(wm)) {
|
if (NS_AUTOOFFSET != kidReflowInput.ComputedLogicalOffsets().BStart(wm)) {
|
||||||
kidReflowState.AvailableBSize() -=
|
kidReflowInput.AvailableBSize() -=
|
||||||
kidReflowState.ComputedLogicalOffsets().BStart(wm);
|
kidReflowInput.ComputedLogicalOffsets().BStart(wm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do the reflow
|
// Do the reflow
|
||||||
ReflowOutput kidDesiredSize(kidReflowState);
|
ReflowOutput kidDesiredSize(kidReflowInput);
|
||||||
aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
|
aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowInput, aStatus);
|
||||||
|
|
||||||
const LogicalSize kidSize = kidDesiredSize.Size(wm).ConvertTo(outerWM, wm);
|
const LogicalSize kidSize = kidDesiredSize.Size(wm).ConvertTo(outerWM, wm);
|
||||||
|
|
||||||
LogicalMargin offsets =
|
LogicalMargin offsets =
|
||||||
kidReflowState.ComputedLogicalOffsets().ConvertTo(outerWM, wm);
|
kidReflowInput.ComputedLogicalOffsets().ConvertTo(outerWM, wm);
|
||||||
|
|
||||||
// If we're solving for start in either inline or block direction,
|
// If we're solving for start in either inline or block direction,
|
||||||
// then compute it now that we know the dimensions.
|
// then compute it now that we know the dimensions.
|
||||||
@@ -439,8 +439,8 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||||||
if (-1 == logicalCBSize.ISize(wm)) {
|
if (-1 == logicalCBSize.ISize(wm)) {
|
||||||
// Get the containing block width/height
|
// Get the containing block width/height
|
||||||
logicalCBSize =
|
logicalCBSize =
|
||||||
kidReflowState.ComputeContainingBlockRectangle(aPresContext,
|
kidReflowInput.ComputeContainingBlockRectangle(aPresContext,
|
||||||
&aReflowState);
|
&aReflowInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NS_AUTOOFFSET == offsets.IStart(outerWM)) {
|
if (NS_AUTOOFFSET == offsets.IStart(outerWM)) {
|
||||||
@@ -457,7 +457,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||||||
offsets.BEnd(outerWM) - margin.BStartEnd(outerWM) -
|
offsets.BEnd(outerWM) - margin.BStartEnd(outerWM) -
|
||||||
kidSize.BSize(outerWM);
|
kidSize.BSize(outerWM);
|
||||||
}
|
}
|
||||||
kidReflowState.SetComputedLogicalOffsets(offsets.ConvertTo(wm, outerWM));
|
kidReflowInput.SetComputedLogicalOffsets(offsets.ConvertTo(wm, outerWM));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Position the child relative to our padding edge
|
// Position the child relative to our padding edge
|
||||||
@@ -476,7 +476,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||||||
// positioned based on its containing block and we don't need to offset
|
// positioned based on its containing block and we don't need to offset
|
||||||
// (unless the caller demands it (the STATIC_POS_IS_CB_ORIGIN case)).
|
// (unless the caller demands it (the STATIC_POS_IS_CB_ORIGIN case)).
|
||||||
if (aContainingBlock.TopLeft() != nsPoint(0, 0)) {
|
if (aContainingBlock.TopLeft() != nsPoint(0, 0)) {
|
||||||
const nsStyleSides& offsets = kidReflowState.mStylePosition->mOffset;
|
const nsStyleSides& offsets = kidReflowInput.mStylePosition->mOffset;
|
||||||
if (!(offsets.GetLeftUnit() == eStyleUnit_Auto &&
|
if (!(offsets.GetLeftUnit() == eStyleUnit_Auto &&
|
||||||
offsets.GetRightUnit() == eStyleUnit_Auto) ||
|
offsets.GetRightUnit() == eStyleUnit_Auto) ||
|
||||||
(rsFlags & ReflowInput::STATIC_POS_IS_CB_ORIGIN)) {
|
(rsFlags & ReflowInput::STATIC_POS_IS_CB_ORIGIN)) {
|
||||||
@@ -501,7 +501,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||||||
nsContainerFrame::PositionChildViews(aKidFrame);
|
nsContainerFrame::PositionChildViews(aKidFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
aKidFrame->DidReflow(aPresContext, &kidReflowState,
|
aKidFrame->DidReflow(aPresContext, &kidReflowInput,
|
||||||
nsDidReflowStatus::FINISHED);
|
nsDidReflowStatus::FINISHED);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void Reflow(nsContainerFrame* aDelegatingFrame,
|
void Reflow(nsContainerFrame* aDelegatingFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aReflowStatus,
|
nsReflowStatus& aReflowStatus,
|
||||||
const nsRect& aContainingBlock,
|
const nsRect& aContainingBlock,
|
||||||
AbsPosReflowFlags aFlags,
|
AbsPosReflowFlags aFlags,
|
||||||
@@ -129,7 +129,7 @@ protected:
|
|||||||
|
|
||||||
void ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame,
|
void ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
const nsRect& aContainingBlockRect,
|
const nsRect& aContainingBlockRect,
|
||||||
AbsPosReflowFlags aFlags,
|
AbsPosReflowFlags aFlags,
|
||||||
nsIFrame* aKidFrame,
|
nsIFrame* aKidFrame,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
|
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
|
||||||
InlineMinISizeData *aData) override;
|
InlineMinISizeData *aData) override;
|
||||||
@@ -81,13 +81,13 @@ BRFrame::~BRFrame()
|
|||||||
void
|
void
|
||||||
BRFrame::Reflow(nsPresContext* aPresContext,
|
BRFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("BRFrame");
|
DO_GLOBAL_REFLOW_COUNT("BRFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
LogicalSize finalSize(wm);
|
LogicalSize finalSize(wm);
|
||||||
finalSize.BSize(wm) = 0; // BR frames with block size 0 are ignored in quirks
|
finalSize.BSize(wm) = 0; // BR frames with block size 0 are ignored in quirks
|
||||||
// mode by nsLineLayout::VerticalAlignFrames .
|
// mode by nsLineLayout::VerticalAlignFrames .
|
||||||
@@ -101,7 +101,7 @@ BRFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// on the *parent's* ShouldSuppressLineBreak() method, instead of our
|
// on the *parent's* ShouldSuppressLineBreak() method, instead of our
|
||||||
// own, because we may have custom "display" value that makes our
|
// own, because we may have custom "display" value that makes our
|
||||||
// ShouldSuppressLineBreak() return false.
|
// ShouldSuppressLineBreak() return false.
|
||||||
nsLineLayout* ll = aReflowState.mLineLayout;
|
nsLineLayout* ll = aReflowInput.mLineLayout;
|
||||||
if (ll && !GetParent()->StyleContext()->ShouldSuppressLineBreak()) {
|
if (ll && !GetParent()->StyleContext()->ShouldSuppressLineBreak()) {
|
||||||
// Note that the compatibility mode check excludes AlmostStandards
|
// Note that the compatibility mode check excludes AlmostStandards
|
||||||
// mode, since this is the inline box model. See bug 161691.
|
// mode, since this is the inline box model. See bug 161691.
|
||||||
@@ -124,7 +124,7 @@ BRFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
RefPtr<nsFontMetrics> fm =
|
RefPtr<nsFontMetrics> fm =
|
||||||
nsLayoutUtils::GetInflatedFontMetricsForFrame(this);
|
nsLayoutUtils::GetInflatedFontMetricsForFrame(this);
|
||||||
if (fm) {
|
if (fm) {
|
||||||
nscoord logicalHeight = aReflowState.CalcLineHeight();
|
nscoord logicalHeight = aReflowInput.CalcLineHeight();
|
||||||
finalSize.BSize(wm) = logicalHeight;
|
finalSize.BSize(wm) = logicalHeight;
|
||||||
aMetrics.SetBlockStartAscent(nsLayoutUtils::GetCenteredFontBaseline(
|
aMetrics.SetBlockStartAscent(nsLayoutUtils::GetCenteredFontBaseline(
|
||||||
fm, logicalHeight, wm.IsLineInverted()));
|
fm, logicalHeight, wm.IsLineInverted()));
|
||||||
@@ -144,7 +144,7 @@ BRFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return our reflow status
|
// Return our reflow status
|
||||||
uint32_t breakType = aReflowState.mStyleDisplay->PhysicalBreakType(wm);
|
uint32_t breakType = aReflowInput.mStyleDisplay->PhysicalBreakType(wm);
|
||||||
if (NS_STYLE_CLEAR_NONE == breakType) {
|
if (NS_STYLE_CLEAR_NONE == breakType) {
|
||||||
breakType = NS_STYLE_CLEAR_LINE;
|
breakType = NS_STYLE_CLEAR_LINE;
|
||||||
}
|
}
|
||||||
@@ -162,7 +162,7 @@ BRFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
mAscent = aMetrics.BlockStartAscent();
|
mAscent = aMetrics.BlockStartAscent();
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
|
|||||||
@@ -87,18 +87,18 @@ nsBackdropFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
|||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
nsBackdropFrame::Reflow(nsPresContext* aPresContext,
|
nsBackdropFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsBackdropFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsBackdropFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
// Note that this frame is a child of the viewport frame.
|
// Note that this frame is a child of the viewport frame.
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
LogicalMargin borderPadding = aReflowState.ComputedLogicalBorderPadding();
|
LogicalMargin borderPadding = aReflowInput.ComputedLogicalBorderPadding();
|
||||||
nscoord isize = aReflowState.ComputedISize() + borderPadding.IStartEnd(wm);
|
nscoord isize = aReflowInput.ComputedISize() + borderPadding.IStartEnd(wm);
|
||||||
nscoord bsize = aReflowState.ComputedBSize() + borderPadding.BStartEnd(wm);
|
nscoord bsize = aReflowInput.ComputedBSize() + borderPadding.BStartEnd(wm);
|
||||||
aDesiredSize.SetSize(wm, LogicalSize(wm, isize, bsize));
|
aDesiredSize.SetSize(wm, LogicalSize(wm, isize, bsize));
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
bool aShrinkWrap) override;
|
bool aShrinkWrap) override;
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -937,20 +937,20 @@ AvailableSpaceShrunk(WritingMode aWM,
|
|||||||
|
|
||||||
static LogicalSize
|
static LogicalSize
|
||||||
CalculateContainingBlockSizeForAbsolutes(WritingMode aWM,
|
CalculateContainingBlockSizeForAbsolutes(WritingMode aWM,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
LogicalSize aFrameSize)
|
LogicalSize aFrameSize)
|
||||||
{
|
{
|
||||||
// The issue here is that for a 'height' of 'auto' the reflow state
|
// The issue here is that for a 'height' of 'auto' the reflow state
|
||||||
// code won't know how to calculate the containing block height
|
// code won't know how to calculate the containing block height
|
||||||
// because it's calculated bottom up. So we use our own computed
|
// because it's calculated bottom up. So we use our own computed
|
||||||
// size as the dimensions.
|
// size as the dimensions.
|
||||||
nsIFrame* frame = aReflowState.mFrame;
|
nsIFrame* frame = aReflowInput.mFrame;
|
||||||
|
|
||||||
LogicalSize cbSize(aFrameSize);
|
LogicalSize cbSize(aFrameSize);
|
||||||
// Containing block is relative to the padding edge
|
// Containing block is relative to the padding edge
|
||||||
const LogicalMargin& border =
|
const LogicalMargin& border =
|
||||||
LogicalMargin(aWM, aReflowState.ComputedPhysicalBorderPadding() -
|
LogicalMargin(aWM, aReflowInput.ComputedPhysicalBorderPadding() -
|
||||||
aReflowState.ComputedPhysicalPadding());
|
aReflowInput.ComputedPhysicalPadding());
|
||||||
cbSize.ISize(aWM) -= border.IStartEnd(aWM);
|
cbSize.ISize(aWM) -= border.IStartEnd(aWM);
|
||||||
cbSize.BSize(aWM) -= border.BStartEnd(aWM);
|
cbSize.BSize(aWM) -= border.BStartEnd(aWM);
|
||||||
|
|
||||||
@@ -968,15 +968,15 @@ CalculateContainingBlockSizeForAbsolutes(WritingMode aWM,
|
|||||||
// First, find the reflow state for the outermost frame for this
|
// First, find the reflow state for the outermost frame for this
|
||||||
// content, except for fieldsets where the inner anonymous frame has
|
// content, except for fieldsets where the inner anonymous frame has
|
||||||
// the correct padding area with the legend taken into account.
|
// the correct padding area with the legend taken into account.
|
||||||
const ReflowInput* aLastRS = &aReflowState;
|
const ReflowInput* aLastRS = &aReflowInput;
|
||||||
const ReflowInput* lastButOneRS = &aReflowState;
|
const ReflowInput* lastButOneRS = &aReflowInput;
|
||||||
while (aLastRS->mParentReflowState &&
|
while (aLastRS->mParentReflowInput &&
|
||||||
aLastRS->mParentReflowState->mFrame->GetContent() == frame->GetContent() &&
|
aLastRS->mParentReflowInput->mFrame->GetContent() == frame->GetContent() &&
|
||||||
aLastRS->mParentReflowState->mFrame->GetType() != nsGkAtoms::fieldSetFrame) {
|
aLastRS->mParentReflowInput->mFrame->GetType() != nsGkAtoms::fieldSetFrame) {
|
||||||
lastButOneRS = aLastRS;
|
lastButOneRS = aLastRS;
|
||||||
aLastRS = aLastRS->mParentReflowState;
|
aLastRS = aLastRS->mParentReflowInput;
|
||||||
}
|
}
|
||||||
if (aLastRS != &aReflowState) {
|
if (aLastRS != &aReflowInput) {
|
||||||
// Scrollbars need to be specifically excluded, if present, because they are outside the
|
// Scrollbars need to be specifically excluded, if present, because they are outside the
|
||||||
// padding-edge. We need better APIs for getting the various boxes from a frame.
|
// padding-edge. We need better APIs for getting the various boxes from a frame.
|
||||||
nsIScrollableFrame* scrollFrame = do_QueryFrame(aLastRS->mFrame);
|
nsIScrollableFrame* scrollFrame = do_QueryFrame(aLastRS->mFrame);
|
||||||
@@ -1021,19 +1021,19 @@ CalculateContainingBlockSizeForAbsolutes(WritingMode aWM,
|
|||||||
void
|
void
|
||||||
nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsBlockFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsBlockFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (gNoisyReflow) {
|
if (gNoisyReflow) {
|
||||||
IndentBy(stdout, gNoiseIndent);
|
IndentBy(stdout, gNoiseIndent);
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
printf(": begin reflow availSize=%d,%d computedSize=%d,%d\n",
|
printf(": begin reflow availSize=%d,%d computedSize=%d,%d\n",
|
||||||
aReflowState.AvailableISize(), aReflowState.AvailableBSize(),
|
aReflowInput.AvailableISize(), aReflowInput.AvailableBSize(),
|
||||||
aReflowState.ComputedISize(), aReflowState.ComputedBSize());
|
aReflowInput.ComputedISize(), aReflowInput.ComputedBSize());
|
||||||
}
|
}
|
||||||
AutoNoisyIndenter indent(gNoisy);
|
AutoNoisyIndenter indent(gNoisy);
|
||||||
PRTime start = 0; // Initialize these variablies to silence the compiler.
|
PRTime start = 0; // Initialize these variablies to silence the compiler.
|
||||||
@@ -1044,32 +1044,32 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const ReflowInput *reflowState = &aReflowState;
|
const ReflowInput *reflowInput = &aReflowInput;
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
nscoord consumedBSize = GetConsumedBSize();
|
nscoord consumedBSize = GetConsumedBSize();
|
||||||
nscoord effectiveComputedBSize = GetEffectiveComputedBSize(aReflowState,
|
nscoord effectiveComputedBSize = GetEffectiveComputedBSize(aReflowInput,
|
||||||
consumedBSize);
|
consumedBSize);
|
||||||
Maybe<ReflowInput> mutableReflowState;
|
Maybe<ReflowInput> mutableReflowInput;
|
||||||
// If we have non-auto block size, we're clipping our kids and we fit,
|
// If we have non-auto block size, we're clipping our kids and we fit,
|
||||||
// make sure our kids fit too.
|
// make sure our kids fit too.
|
||||||
if (aReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
|
if (aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
|
||||||
aReflowState.ComputedBSize() != NS_AUTOHEIGHT &&
|
aReflowInput.ComputedBSize() != NS_AUTOHEIGHT &&
|
||||||
ShouldApplyOverflowClipping(this, aReflowState.mStyleDisplay)) {
|
ShouldApplyOverflowClipping(this, aReflowInput.mStyleDisplay)) {
|
||||||
LogicalMargin blockDirExtras = aReflowState.ComputedLogicalBorderPadding();
|
LogicalMargin blockDirExtras = aReflowInput.ComputedLogicalBorderPadding();
|
||||||
if (GetLogicalSkipSides().BStart()) {
|
if (GetLogicalSkipSides().BStart()) {
|
||||||
blockDirExtras.BStart(wm) = 0;
|
blockDirExtras.BStart(wm) = 0;
|
||||||
} else {
|
} else {
|
||||||
// Block-end margin never causes us to create continuations, so we
|
// Block-end margin never causes us to create continuations, so we
|
||||||
// don't need to worry about whether it fits in its entirety.
|
// don't need to worry about whether it fits in its entirety.
|
||||||
blockDirExtras.BStart(wm) +=
|
blockDirExtras.BStart(wm) +=
|
||||||
aReflowState.ComputedLogicalMargin().BStart(wm);
|
aReflowInput.ComputedLogicalMargin().BStart(wm);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (effectiveComputedBSize + blockDirExtras.BStartEnd(wm) <=
|
if (effectiveComputedBSize + blockDirExtras.BStartEnd(wm) <=
|
||||||
aReflowState.AvailableBSize()) {
|
aReflowInput.AvailableBSize()) {
|
||||||
mutableReflowState.emplace(aReflowState);
|
mutableReflowInput.emplace(aReflowInput);
|
||||||
mutableReflowState->AvailableBSize() = NS_UNCONSTRAINEDSIZE;
|
mutableReflowInput->AvailableBSize() = NS_UNCONSTRAINEDSIZE;
|
||||||
reflowState = mutableReflowState.ptr();
|
reflowInput = mutableReflowInput.ptr();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1078,7 +1078,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsSize oldSize = GetSize();
|
nsSize oldSize = GetSize();
|
||||||
|
|
||||||
// Should we create a float manager?
|
// Should we create a float manager?
|
||||||
nsAutoFloatManager autoFloatManager(const_cast<ReflowInput&>(*reflowState));
|
nsAutoFloatManager autoFloatManager(const_cast<ReflowInput&>(*reflowInput));
|
||||||
|
|
||||||
// XXXldb If we start storing the float manager in the frame rather
|
// XXXldb If we start storing the float manager in the frame rather
|
||||||
// than keeping it around only during reflow then we should create it
|
// than keeping it around only during reflow then we should create it
|
||||||
@@ -1094,7 +1094,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// delete the line with the line cursor.
|
// delete the line with the line cursor.
|
||||||
ClearLineCursor();
|
ClearLineCursor();
|
||||||
|
|
||||||
if (IsFrameTreeTooDeep(*reflowState, aMetrics, aStatus)) {
|
if (IsFrameTreeTooDeep(*reflowInput, aMetrics, aStatus)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1103,7 +1103,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Cache the consumed height in the block reflow state so that we don't have
|
// Cache the consumed height in the block reflow state so that we don't have
|
||||||
// to continually recompute it.
|
// to continually recompute it.
|
||||||
BlockReflowInput state(*reflowState, aPresContext, this,
|
BlockReflowInput state(*reflowInput, aPresContext, this,
|
||||||
blockStartMarginRoot, blockEndMarginRoot,
|
blockStartMarginRoot, blockEndMarginRoot,
|
||||||
needFloatManager, consumedBSize);
|
needFloatManager, consumedBSize);
|
||||||
|
|
||||||
@@ -1132,7 +1132,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsOverflowAreas ocBounds;
|
nsOverflowAreas ocBounds;
|
||||||
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
||||||
if (GetPrevInFlow()) {
|
if (GetPrevInFlow()) {
|
||||||
ReflowOverflowContainerChildren(aPresContext, *reflowState, ocBounds, 0,
|
ReflowOverflowContainerChildren(aPresContext, *reflowInput, ocBounds, 0,
|
||||||
ocStatus);
|
ocStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1150,16 +1150,16 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// If we're not dirty (which means we'll mark everything dirty later)
|
// If we're not dirty (which means we'll mark everything dirty later)
|
||||||
// and our inline-size has changed, mark the lines dirty that we need to
|
// and our inline-size has changed, mark the lines dirty that we need to
|
||||||
// mark dirty for a resize reflow.
|
// mark dirty for a resize reflow.
|
||||||
if (!(GetStateBits() & NS_FRAME_IS_DIRTY) && reflowState->IsIResize()) {
|
if (!(GetStateBits() & NS_FRAME_IS_DIRTY) && reflowInput->IsIResize()) {
|
||||||
PrepareResizeReflow(state);
|
PrepareResizeReflow(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The same for percentage text-indent, except conditioned on the
|
// The same for percentage text-indent, except conditioned on the
|
||||||
// parent resizing.
|
// parent resizing.
|
||||||
if (!(GetStateBits() & NS_FRAME_IS_DIRTY) &&
|
if (!(GetStateBits() & NS_FRAME_IS_DIRTY) &&
|
||||||
reflowState->mCBReflowState &&
|
reflowInput->mCBReflowInput &&
|
||||||
reflowState->mCBReflowState->IsIResize() &&
|
reflowInput->mCBReflowInput->IsIResize() &&
|
||||||
reflowState->mStyleText->mTextIndent.HasPercent() &&
|
reflowInput->mStyleText->mTextIndent.HasPercent() &&
|
||||||
!mLines.empty()) {
|
!mLines.empty()) {
|
||||||
mLines.front()->MarkDirty();
|
mLines.front()->MarkDirty();
|
||||||
}
|
}
|
||||||
@@ -1201,7 +1201,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// If we end in a BR with clear and affected floats continue,
|
// If we end in a BR with clear and affected floats continue,
|
||||||
// we need to continue, too.
|
// we need to continue, too.
|
||||||
if (NS_UNCONSTRAINEDSIZE != reflowState->AvailableBSize() &&
|
if (NS_UNCONSTRAINEDSIZE != reflowInput->AvailableBSize() &&
|
||||||
NS_FRAME_IS_COMPLETE(state.mReflowStatus) &&
|
NS_FRAME_IS_COMPLETE(state.mReflowStatus) &&
|
||||||
state.mFloatManager->ClearContinues(FindTrailingClear())) {
|
state.mFloatManager->ClearContinues(FindTrailingClear())) {
|
||||||
NS_FRAME_SET_INCOMPLETE(state.mReflowStatus);
|
NS_FRAME_SET_INCOMPLETE(state.mReflowStatus);
|
||||||
@@ -1235,15 +1235,15 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
mLines.front() != mLines.back() &&
|
mLines.front() != mLines.back() &&
|
||||||
mLines.begin().next()->IsBlock()))) {
|
mLines.begin().next()->IsBlock()))) {
|
||||||
// Reflow the bullet
|
// Reflow the bullet
|
||||||
ReflowOutput metrics(aReflowState);
|
ReflowOutput metrics(aReflowInput);
|
||||||
// XXX Use the entire line when we fix bug 25888.
|
// XXX Use the entire line when we fix bug 25888.
|
||||||
nsLayoutUtils::LinePosition position;
|
nsLayoutUtils::LinePosition position;
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
bool havePosition = nsLayoutUtils::GetFirstLinePosition(wm, this,
|
bool havePosition = nsLayoutUtils::GetFirstLinePosition(wm, this,
|
||||||
&position);
|
&position);
|
||||||
nscoord lineBStart = havePosition ?
|
nscoord lineBStart = havePosition ?
|
||||||
position.mBStart :
|
position.mBStart :
|
||||||
reflowState->ComputedLogicalBorderPadding().BStart(wm);
|
reflowInput->ComputedLogicalBorderPadding().BStart(wm);
|
||||||
nsIFrame* bullet = GetOutsideBullet();
|
nsIFrame* bullet = GetOutsideBullet();
|
||||||
ReflowBullet(bullet, state, metrics, lineBStart);
|
ReflowBullet(bullet, state, metrics, lineBStart);
|
||||||
NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
|
NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
|
||||||
@@ -1268,7 +1268,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Compute our final size
|
// Compute our final size
|
||||||
nscoord blockEndEdgeOfChildren;
|
nscoord blockEndEdgeOfChildren;
|
||||||
ComputeFinalSize(*reflowState, state, aMetrics, &blockEndEdgeOfChildren);
|
ComputeFinalSize(*reflowInput, state, aMetrics, &blockEndEdgeOfChildren);
|
||||||
|
|
||||||
// If the block direction is right-to-left, we need to update the bounds of
|
// If the block direction is right-to-left, we need to update the bounds of
|
||||||
// lines that were placed relative to mContainerSize during reflow, as
|
// lines that were placed relative to mContainerSize during reflow, as
|
||||||
@@ -1305,7 +1305,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsRect areaBounds = nsRect(0, 0, aMetrics.Width(), aMetrics.Height());
|
nsRect areaBounds = nsRect(0, 0, aMetrics.Width(), aMetrics.Height());
|
||||||
ComputeOverflowAreas(areaBounds, reflowState->mStyleDisplay,
|
ComputeOverflowAreas(areaBounds, reflowInput->mStyleDisplay,
|
||||||
blockEndEdgeOfChildren, aMetrics.mOverflowAreas);
|
blockEndEdgeOfChildren, aMetrics.mOverflowAreas);
|
||||||
// Factor overflow container child bounds into the overflow area
|
// Factor overflow container child bounds into the overflow area
|
||||||
aMetrics.mOverflowAreas.UnionWith(ocBounds);
|
aMetrics.mOverflowAreas.UnionWith(ocBounds);
|
||||||
@@ -1333,7 +1333,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
if (HasAbsolutelyPositionedChildren()) {
|
if (HasAbsolutelyPositionedChildren()) {
|
||||||
nsAbsoluteContainingBlock* absoluteContainer = GetAbsoluteContainingBlock();
|
nsAbsoluteContainingBlock* absoluteContainer = GetAbsoluteContainingBlock();
|
||||||
bool haveInterrupt = aPresContext->HasPendingInterrupt();
|
bool haveInterrupt = aPresContext->HasPendingInterrupt();
|
||||||
if (reflowState->WillReflowAgainForClearance() ||
|
if (reflowInput->WillReflowAgainForClearance() ||
|
||||||
haveInterrupt) {
|
haveInterrupt) {
|
||||||
// Make sure that when we reflow again we'll actually reflow all the abs
|
// Make sure that when we reflow again we'll actually reflow all the abs
|
||||||
// pos frames that might conceivably depend on our size (or all of them,
|
// pos frames that might conceivably depend on our size (or all of them,
|
||||||
@@ -1348,7 +1348,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LogicalSize containingBlockSize =
|
LogicalSize containingBlockSize =
|
||||||
CalculateContainingBlockSizeForAbsolutes(parentWM, *reflowState,
|
CalculateContainingBlockSizeForAbsolutes(parentWM, *reflowInput,
|
||||||
aMetrics.Size(parentWM));
|
aMetrics.Size(parentWM));
|
||||||
|
|
||||||
// Mark frames that depend on changes we just made to this frame as dirty:
|
// Mark frames that depend on changes we just made to this frame as dirty:
|
||||||
@@ -1367,7 +1367,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// viewport height, which can't change during incremental
|
// viewport height, which can't change during incremental
|
||||||
// reflow.
|
// reflow.
|
||||||
bool cbHeightChanged =
|
bool cbHeightChanged =
|
||||||
!(isRoot && NS_UNCONSTRAINEDSIZE == reflowState->ComputedHeight()) &&
|
!(isRoot && NS_UNCONSTRAINEDSIZE == reflowInput->ComputedHeight()) &&
|
||||||
aMetrics.Height() != oldSize.height;
|
aMetrics.Height() != oldSize.height;
|
||||||
|
|
||||||
nsRect containingBlock(nsPoint(0, 0),
|
nsRect containingBlock(nsPoint(0, 0),
|
||||||
@@ -1384,7 +1384,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// frames. The line cursor is immediately cleared afterward to
|
// frames. The line cursor is immediately cleared afterward to
|
||||||
// avoid affecting the display list generation.
|
// avoid affecting the display list generation.
|
||||||
SetupLineCursor();
|
SetupLineCursor();
|
||||||
absoluteContainer->Reflow(this, aPresContext, *reflowState,
|
absoluteContainer->Reflow(this, aPresContext, *reflowInput,
|
||||||
state.mReflowStatus,
|
state.mReflowStatus,
|
||||||
containingBlock, flags,
|
containingBlock, flags,
|
||||||
&aMetrics.mOverflowAreas);
|
&aMetrics.mOverflowAreas);
|
||||||
@@ -1452,7 +1452,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, (*reflowState), aMetrics);
|
NS_FRAME_SET_TRUNCATION(aStatus, (*reflowInput), aMetrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@@ -1477,12 +1477,12 @@ nsBlockFrame::CheckForCollapsedBEndMarginFromClearanceLine()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowState,
|
nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput,
|
||||||
BlockReflowInput& aState,
|
BlockReflowInput& aState,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
nscoord* aBEndEdgeOfChildren)
|
nscoord* aBEndEdgeOfChildren)
|
||||||
{
|
{
|
||||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
WritingMode wm = aState.mReflowInput.GetWritingMode();
|
||||||
const LogicalMargin& borderPadding = aState.BorderPadding();
|
const LogicalMargin& borderPadding = aState.BorderPadding();
|
||||||
#ifdef NOISY_FINAL_SIZE
|
#ifdef NOISY_FINAL_SIZE
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
@@ -1496,7 +1496,7 @@ nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowState,
|
|||||||
LogicalSize finalSize(wm);
|
LogicalSize finalSize(wm);
|
||||||
finalSize.ISize(wm) =
|
finalSize.ISize(wm) =
|
||||||
NSCoordSaturatingAdd(NSCoordSaturatingAdd(borderPadding.IStart(wm),
|
NSCoordSaturatingAdd(NSCoordSaturatingAdd(borderPadding.IStart(wm),
|
||||||
aReflowState.ComputedISize()),
|
aReflowInput.ComputedISize()),
|
||||||
borderPadding.IEnd(wm));
|
borderPadding.IEnd(wm));
|
||||||
|
|
||||||
// Return block-end margin information
|
// Return block-end margin information
|
||||||
@@ -1525,19 +1525,19 @@ nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowState,
|
|||||||
nscoord blockEndEdgeOfChildren = aState.mBCoord + nonCarriedOutBDirMargin;
|
nscoord blockEndEdgeOfChildren = aState.mBCoord + nonCarriedOutBDirMargin;
|
||||||
// Shrink wrap our height around our contents.
|
// Shrink wrap our height around our contents.
|
||||||
if (aState.GetFlag(BRS_ISBENDMARGINROOT) ||
|
if (aState.GetFlag(BRS_ISBENDMARGINROOT) ||
|
||||||
NS_UNCONSTRAINEDSIZE != aReflowState.ComputedBSize()) {
|
NS_UNCONSTRAINEDSIZE != aReflowInput.ComputedBSize()) {
|
||||||
// When we are a block-end-margin root make sure that our last
|
// When we are a block-end-margin root make sure that our last
|
||||||
// childs block-end margin is fully applied. We also do this when
|
// childs block-end margin is fully applied. We also do this when
|
||||||
// we have a computed height, since in that case the carried out
|
// we have a computed height, since in that case the carried out
|
||||||
// margin is not going to be applied anywhere, so we should note it
|
// margin is not going to be applied anywhere, so we should note it
|
||||||
// here to be included in the overflow area.
|
// here to be included in the overflow area.
|
||||||
// Apply the margin only if there's space for it.
|
// Apply the margin only if there's space for it.
|
||||||
if (blockEndEdgeOfChildren < aState.mReflowState.AvailableBSize())
|
if (blockEndEdgeOfChildren < aState.mReflowInput.AvailableBSize())
|
||||||
{
|
{
|
||||||
// Truncate block-end margin if it doesn't fit to our available BSize.
|
// Truncate block-end margin if it doesn't fit to our available BSize.
|
||||||
blockEndEdgeOfChildren =
|
blockEndEdgeOfChildren =
|
||||||
std::min(blockEndEdgeOfChildren + aState.mPrevBEndMargin.get(),
|
std::min(blockEndEdgeOfChildren + aState.mPrevBEndMargin.get(),
|
||||||
aState.mReflowState.AvailableBSize());
|
aState.mReflowInput.AvailableBSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (aState.GetFlag(BRS_FLOAT_MGR)) {
|
if (aState.GetFlag(BRS_FLOAT_MGR)) {
|
||||||
@@ -1549,10 +1549,10 @@ nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowState,
|
|||||||
blockEndEdgeOfChildren = std::max(blockEndEdgeOfChildren, floatHeight);
|
blockEndEdgeOfChildren = std::max(blockEndEdgeOfChildren, floatHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NS_UNCONSTRAINEDSIZE != aReflowState.ComputedBSize()
|
if (NS_UNCONSTRAINEDSIZE != aReflowInput.ComputedBSize()
|
||||||
&& (GetParent()->GetType() != nsGkAtoms::columnSetFrame ||
|
&& (GetParent()->GetType() != nsGkAtoms::columnSetFrame ||
|
||||||
aReflowState.mParentReflowState->AvailableBSize() == NS_UNCONSTRAINEDSIZE)) {
|
aReflowInput.mParentReflowInput->AvailableBSize() == NS_UNCONSTRAINEDSIZE)) {
|
||||||
ComputeFinalBSize(aReflowState, &aState.mReflowStatus,
|
ComputeFinalBSize(aReflowInput, &aState.mReflowStatus,
|
||||||
aState.mBCoord + nonCarriedOutBDirMargin,
|
aState.mBCoord + nonCarriedOutBDirMargin,
|
||||||
borderPadding, finalSize, aState.mConsumedBSize);
|
borderPadding, finalSize, aState.mConsumedBSize);
|
||||||
if (!NS_FRAME_IS_COMPLETE(aState.mReflowStatus)) {
|
if (!NS_FRAME_IS_COMPLETE(aState.mReflowStatus)) {
|
||||||
@@ -1560,11 +1560,11 @@ nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowState,
|
|||||||
// Do extend the height to at least consume the available
|
// Do extend the height to at least consume the available
|
||||||
// height, otherwise our left/right borders (for example) won't
|
// height, otherwise our left/right borders (for example) won't
|
||||||
// extend all the way to the break.
|
// extend all the way to the break.
|
||||||
finalSize.BSize(wm) = std::max(aReflowState.AvailableBSize(),
|
finalSize.BSize(wm) = std::max(aReflowInput.AvailableBSize(),
|
||||||
aState.mBCoord + nonCarriedOutBDirMargin);
|
aState.mBCoord + nonCarriedOutBDirMargin);
|
||||||
// ... but don't take up more block size than is available
|
// ... but don't take up more block size than is available
|
||||||
nscoord effectiveComputedBSize =
|
nscoord effectiveComputedBSize =
|
||||||
GetEffectiveComputedBSize(aReflowState, aState.GetConsumedBSize());
|
GetEffectiveComputedBSize(aReflowInput, aState.GetConsumedBSize());
|
||||||
finalSize.BSize(wm) =
|
finalSize.BSize(wm) =
|
||||||
std::min(finalSize.BSize(wm),
|
std::min(finalSize.BSize(wm),
|
||||||
borderPadding.BStart(wm) + effectiveComputedBSize);
|
borderPadding.BStart(wm) + effectiveComputedBSize);
|
||||||
@@ -1579,7 +1579,7 @@ nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowState,
|
|||||||
}
|
}
|
||||||
else if (NS_FRAME_IS_COMPLETE(aState.mReflowStatus)) {
|
else if (NS_FRAME_IS_COMPLETE(aState.mReflowStatus)) {
|
||||||
nscoord contentBSize = blockEndEdgeOfChildren - borderPadding.BStart(wm);
|
nscoord contentBSize = blockEndEdgeOfChildren - borderPadding.BStart(wm);
|
||||||
nscoord autoBSize = aReflowState.ApplyMinMaxBSize(contentBSize);
|
nscoord autoBSize = aReflowInput.ApplyMinMaxBSize(contentBSize);
|
||||||
if (autoBSize != contentBSize) {
|
if (autoBSize != contentBSize) {
|
||||||
// Our min- or max-bsize value made our bsize change. Don't carry out
|
// Our min- or max-bsize value made our bsize change. Don't carry out
|
||||||
// our kids' block-end margins.
|
// our kids' block-end margins.
|
||||||
@@ -1589,11 +1589,11 @@ nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowState,
|
|||||||
finalSize.BSize(wm) = autoBSize;
|
finalSize.BSize(wm) = autoBSize;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NS_ASSERTION(aReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
|
NS_ASSERTION(aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
|
||||||
"Shouldn't be incomplete if availableBSize is UNCONSTRAINED.");
|
"Shouldn't be incomplete if availableBSize is UNCONSTRAINED.");
|
||||||
finalSize.BSize(wm) = std::max(aState.mBCoord,
|
finalSize.BSize(wm) = std::max(aState.mBCoord,
|
||||||
aReflowState.AvailableBSize());
|
aReflowInput.AvailableBSize());
|
||||||
if (aReflowState.AvailableBSize() == NS_UNCONSTRAINEDSIZE) {
|
if (aReflowInput.AvailableBSize() == NS_UNCONSTRAINEDSIZE) {
|
||||||
// This should never happen, but it does. See bug 414255
|
// This should never happen, but it does. See bug 414255
|
||||||
finalSize.BSize(wm) = aState.mBCoord;
|
finalSize.BSize(wm) = aState.mBCoord;
|
||||||
}
|
}
|
||||||
@@ -1607,7 +1607,7 @@ nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowState,
|
|||||||
"overflow containers must be zero-block-size");
|
"overflow containers must be zero-block-size");
|
||||||
NS_FRAME_SET_OVERFLOW_INCOMPLETE(aState.mReflowStatus);
|
NS_FRAME_SET_OVERFLOW_INCOMPLETE(aState.mReflowStatus);
|
||||||
}
|
}
|
||||||
} else if (aReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
|
} else if (aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
|
||||||
!NS_INLINE_IS_BREAK_BEFORE(aState.mReflowStatus) &&
|
!NS_INLINE_IS_BREAK_BEFORE(aState.mReflowStatus) &&
|
||||||
NS_FRAME_IS_COMPLETE(aState.mReflowStatus)) {
|
NS_FRAME_IS_COMPLETE(aState.mReflowStatus)) {
|
||||||
// Currently only used for grid items, but could be used in other contexts.
|
// Currently only used for grid items, but could be used in other contexts.
|
||||||
@@ -1866,18 +1866,18 @@ nsBlockFrame::PrepareResizeReflow(BlockReflowInput& aState)
|
|||||||
IndentBy(stdout, gNoiseIndent);
|
IndentBy(stdout, gNoiseIndent);
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
printf(": marking all lines dirty: availISize=%d\n",
|
printf(": marking all lines dirty: availISize=%d\n",
|
||||||
aState.mReflowState.AvailableISize());
|
aState.mReflowInput.AvailableISize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (tryAndSkipLines) {
|
if (tryAndSkipLines) {
|
||||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
WritingMode wm = aState.mReflowInput.GetWritingMode();
|
||||||
nscoord newAvailISize =
|
nscoord newAvailISize =
|
||||||
aState.mReflowState.ComputedLogicalBorderPadding().IStart(wm) +
|
aState.mReflowInput.ComputedLogicalBorderPadding().IStart(wm) +
|
||||||
aState.mReflowState.ComputedISize();
|
aState.mReflowInput.ComputedISize();
|
||||||
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != aState.mReflowState.ComputedLogicalBorderPadding().IStart(wm) &&
|
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != aState.mReflowInput.ComputedLogicalBorderPadding().IStart(wm) &&
|
||||||
NS_UNCONSTRAINEDSIZE != aState.mReflowState.ComputedISize(),
|
NS_UNCONSTRAINEDSIZE != aState.mReflowInput.ComputedISize(),
|
||||||
"math on NS_UNCONSTRAINEDSIZE");
|
"math on NS_UNCONSTRAINEDSIZE");
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@@ -1956,10 +1956,10 @@ nsBlockFrame::PropagateFloatDamage(BlockReflowInput& aState,
|
|||||||
nsLineBox* aLine,
|
nsLineBox* aLine,
|
||||||
nscoord aDeltaBCoord)
|
nscoord aDeltaBCoord)
|
||||||
{
|
{
|
||||||
nsFloatManager *floatManager = aState.mReflowState.mFloatManager;
|
nsFloatManager *floatManager = aState.mReflowInput.mFloatManager;
|
||||||
NS_ASSERTION((aState.mReflowState.mParentReflowState &&
|
NS_ASSERTION((aState.mReflowInput.mParentReflowInput &&
|
||||||
aState.mReflowState.mParentReflowState->mFloatManager == floatManager) ||
|
aState.mReflowInput.mParentReflowInput->mFloatManager == floatManager) ||
|
||||||
aState.mReflowState.mBlockDelta == 0, "Bad block delta passed in");
|
aState.mReflowInput.mBlockDelta == 0, "Bad block delta passed in");
|
||||||
|
|
||||||
// Check to see if there are any floats; if there aren't, there can't
|
// Check to see if there are any floats; if there aren't, there can't
|
||||||
// be any float damage
|
// be any float damage
|
||||||
@@ -1974,7 +1974,7 @@ nsBlockFrame::PropagateFloatDamage(BlockReflowInput& aState,
|
|||||||
nscoord lineBCoordAfter = lineBCoordBefore + aLine->BSize();
|
nscoord lineBCoordAfter = lineBCoordBefore + aLine->BSize();
|
||||||
// Scrollable overflow should be sufficient for things that affect
|
// Scrollable overflow should be sufficient for things that affect
|
||||||
// layout.
|
// layout.
|
||||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
WritingMode wm = aState.mReflowInput.GetWritingMode();
|
||||||
nsSize containerSize = aState.ContainerSize();
|
nsSize containerSize = aState.ContainerSize();
|
||||||
LogicalRect overflow = aLine->GetOverflowArea(eScrollableOverflow, wm,
|
LogicalRect overflow = aLine->GetOverflowArea(eScrollableOverflow, wm,
|
||||||
containerSize);
|
containerSize);
|
||||||
@@ -1993,7 +1993,7 @@ nsBlockFrame::PropagateFloatDamage(BlockReflowInput& aState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if the line is moving relative to the float manager
|
// Check if the line is moving relative to the float manager
|
||||||
if (aDeltaBCoord + aState.mReflowState.mBlockDelta != 0) {
|
if (aDeltaBCoord + aState.mReflowInput.mBlockDelta != 0) {
|
||||||
if (aLine->IsBlock()) {
|
if (aLine->IsBlock()) {
|
||||||
// Unconditionally reflow sliding blocks; we only really need to reflow
|
// Unconditionally reflow sliding blocks; we only really need to reflow
|
||||||
// if there's a float impacting this block, but the current float manager
|
// if there's a float impacting this block, but the current float manager
|
||||||
@@ -2083,20 +2083,20 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
|||||||
IndentBy(stdout, gNoiseIndent);
|
IndentBy(stdout, gNoiseIndent);
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
printf(": reflowing dirty lines");
|
printf(": reflowing dirty lines");
|
||||||
printf(" computedISize=%d\n", aState.mReflowState.ComputedISize());
|
printf(" computedISize=%d\n", aState.mReflowInput.ComputedISize());
|
||||||
}
|
}
|
||||||
AutoNoisyIndenter indent(gNoisyReflow);
|
AutoNoisyIndenter indent(gNoisyReflow);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool selfDirty = (GetStateBits() & NS_FRAME_IS_DIRTY) ||
|
bool selfDirty = (GetStateBits() & NS_FRAME_IS_DIRTY) ||
|
||||||
(aState.mReflowState.IsBResize() &&
|
(aState.mReflowInput.IsBResize() &&
|
||||||
(GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE));
|
(GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE));
|
||||||
|
|
||||||
// Reflow our last line if our availableBSize has increased
|
// Reflow our last line if our availableBSize has increased
|
||||||
// so that we (and our last child) pull up content as necessary
|
// so that we (and our last child) pull up content as necessary
|
||||||
if (aState.mReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE
|
if (aState.mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE
|
||||||
&& GetNextInFlow() && aState.mReflowState.AvailableBSize() >
|
&& GetNextInFlow() && aState.mReflowInput.AvailableBSize() >
|
||||||
GetLogicalSize().BSize(aState.mReflowState.GetWritingMode())) {
|
GetLogicalSize().BSize(aState.mReflowInput.GetWritingMode())) {
|
||||||
line_iterator lastLine = end_lines();
|
line_iterator lastLine = end_lines();
|
||||||
if (lastLine != begin_lines()) {
|
if (lastLine != begin_lines()) {
|
||||||
--lastLine;
|
--lastLine;
|
||||||
@@ -2207,9 +2207,9 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
|||||||
// FIXME: What about a deltaBCoord or block-size change that forces us to
|
// FIXME: What about a deltaBCoord or block-size change that forces us to
|
||||||
// push lines? Why does that work?
|
// push lines? Why does that work?
|
||||||
if (!line->IsDirty() &&
|
if (!line->IsDirty() &&
|
||||||
aState.mReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
|
aState.mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
|
||||||
(deltaBCoord != 0 || aState.mReflowState.IsBResize() ||
|
(deltaBCoord != 0 || aState.mReflowInput.IsBResize() ||
|
||||||
aState.mReflowState.mFlags.mMustReflowPlaceholders) &&
|
aState.mReflowInput.mFlags.mMustReflowPlaceholders) &&
|
||||||
(line->IsBlock() || line->HasFloats() || line->HadFloatPushed())) {
|
(line->IsBlock() || line->HasFloats() || line->HadFloatPushed())) {
|
||||||
line->MarkDirty();
|
line->MarkDirty();
|
||||||
}
|
}
|
||||||
@@ -2235,7 +2235,7 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
|||||||
if (line->mWritingMode.IsVertical() ||
|
if (line->mWritingMode.IsVertical() ||
|
||||||
!line->mWritingMode.IsBidiLTR() ||
|
!line->mWritingMode.IsBidiLTR() ||
|
||||||
!IsAlignedLeft(align,
|
!IsAlignedLeft(align,
|
||||||
aState.mReflowState.mStyleVisibility->mDirection,
|
aState.mReflowInput.mStyleVisibility->mDirection,
|
||||||
StyleTextReset()->mUnicodeBidi, this)) {
|
StyleTextReset()->mUnicodeBidi, this)) {
|
||||||
line->MarkDirty();
|
line->MarkDirty();
|
||||||
}
|
}
|
||||||
@@ -2269,7 +2269,7 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
|||||||
// dangling frame pointers! Ugh! This reflow of the line may be
|
// dangling frame pointers! Ugh! This reflow of the line may be
|
||||||
// incorrect because we skipped reflowing previous lines (e.g., floats
|
// incorrect because we skipped reflowing previous lines (e.g., floats
|
||||||
// may be placed incorrectly), but that's OK because we'll mark the
|
// may be placed incorrectly), but that's OK because we'll mark the
|
||||||
// line dirty below under "if (aState.mReflowState.mDiscoveredClearance..."
|
// line dirty below under "if (aState.mReflowInput.mDiscoveredClearance..."
|
||||||
if (line->IsDirty() && (line->HasFloats() || !willReflowAgain)) {
|
if (line->IsDirty() && (line->HasFloats() || !willReflowAgain)) {
|
||||||
lastLineMovedUp = true;
|
lastLineMovedUp = true;
|
||||||
|
|
||||||
@@ -2290,7 +2290,7 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
|||||||
// it to invalidate the dirty area if necessary
|
// it to invalidate the dirty area if necessary
|
||||||
ReflowLine(aState, line, &keepGoing);
|
ReflowLine(aState, line, &keepGoing);
|
||||||
|
|
||||||
if (aState.mReflowState.WillReflowAgainForClearance()) {
|
if (aState.mReflowInput.WillReflowAgainForClearance()) {
|
||||||
line->MarkDirty();
|
line->MarkDirty();
|
||||||
willReflowAgain = true;
|
willReflowAgain = true;
|
||||||
// Note that once we've entered this state, every line that gets here
|
// Note that once we've entered this state, every line that gets here
|
||||||
@@ -2470,10 +2470,10 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
|||||||
// -- my chain of next-in-flows either has no first line, or its first
|
// -- my chain of next-in-flows either has no first line, or its first
|
||||||
// line isn't dirty.
|
// line isn't dirty.
|
||||||
bool heightConstrained =
|
bool heightConstrained =
|
||||||
aState.mReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE;
|
aState.mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE;
|
||||||
bool skipPull = willReflowAgain && heightConstrained;
|
bool skipPull = willReflowAgain && heightConstrained;
|
||||||
if (!skipPull && heightConstrained && aState.mNextInFlow &&
|
if (!skipPull && heightConstrained && aState.mNextInFlow &&
|
||||||
(aState.mReflowState.mFlags.mNextInFlowUntouched &&
|
(aState.mReflowInput.mFlags.mNextInFlowUntouched &&
|
||||||
!lastLineMovedUp &&
|
!lastLineMovedUp &&
|
||||||
!(GetStateBits() & NS_FRAME_IS_DIRTY) &&
|
!(GetStateBits() & NS_FRAME_IS_DIRTY) &&
|
||||||
!reflowedFloat)) {
|
!reflowedFloat)) {
|
||||||
@@ -2575,7 +2575,7 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
|||||||
while (line != end_lines()) {
|
while (line != end_lines()) {
|
||||||
ReflowLine(aState, line, &keepGoing);
|
ReflowLine(aState, line, &keepGoing);
|
||||||
|
|
||||||
if (aState.mReflowState.WillReflowAgainForClearance()) {
|
if (aState.mReflowInput.WillReflowAgainForClearance()) {
|
||||||
line->MarkDirty();
|
line->MarkDirty();
|
||||||
keepGoing = false;
|
keepGoing = false;
|
||||||
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
|
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
|
||||||
@@ -2613,11 +2613,11 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
|||||||
|
|
||||||
// Handle an odd-ball case: a list-item with no lines
|
// Handle an odd-ball case: a list-item with no lines
|
||||||
if (HasOutsideBullet() && mLines.empty()) {
|
if (HasOutsideBullet() && mLines.empty()) {
|
||||||
ReflowOutput metrics(aState.mReflowState);
|
ReflowOutput metrics(aState.mReflowInput);
|
||||||
nsIFrame* bullet = GetOutsideBullet();
|
nsIFrame* bullet = GetOutsideBullet();
|
||||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
WritingMode wm = aState.mReflowInput.GetWritingMode();
|
||||||
ReflowBullet(bullet, aState, metrics,
|
ReflowBullet(bullet, aState, metrics,
|
||||||
aState.mReflowState.ComputedPhysicalBorderPadding().top);
|
aState.mReflowInput.ComputedPhysicalBorderPadding().top);
|
||||||
NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
|
NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
|
||||||
"empty bullet took up space");
|
"empty bullet took up space");
|
||||||
|
|
||||||
@@ -2627,7 +2627,7 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
|||||||
|
|
||||||
if (metrics.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
|
if (metrics.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
|
||||||
nscoord ascent;
|
nscoord ascent;
|
||||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
WritingMode wm = aState.mReflowInput.GetWritingMode();
|
||||||
if (nsLayoutUtils::GetFirstLineBaseline(wm, bullet, &ascent)) {
|
if (nsLayoutUtils::GetFirstLineBaseline(wm, bullet, &ascent)) {
|
||||||
metrics.SetBlockStartAscent(ascent);
|
metrics.SetBlockStartAscent(ascent);
|
||||||
} else {
|
} else {
|
||||||
@@ -3129,10 +3129,10 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
|
|
||||||
// Prepare the block reflow engine
|
// Prepare the block reflow engine
|
||||||
const nsStyleDisplay* display = frame->StyleDisplay();
|
const nsStyleDisplay* display = frame->StyleDisplay();
|
||||||
nsBlockReflowContext brc(aState.mPresContext, aState.mReflowState);
|
nsBlockReflowContext brc(aState.mPresContext, aState.mReflowInput);
|
||||||
|
|
||||||
uint8_t breakType =
|
uint8_t breakType =
|
||||||
display->PhysicalBreakType(aState.mReflowState.GetWritingMode());
|
display->PhysicalBreakType(aState.mReflowInput.GetWritingMode());
|
||||||
if (NS_STYLE_CLEAR_NONE != aState.mFloatBreakType) {
|
if (NS_STYLE_CLEAR_NONE != aState.mFloatBreakType) {
|
||||||
breakType = nsLayoutUtils::CombineBreakType(breakType,
|
breakType = nsLayoutUtils::CombineBreakType(breakType,
|
||||||
aState.mFloatBreakType);
|
aState.mFloatBreakType);
|
||||||
@@ -3171,13 +3171,13 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
// frame DID NOT need clearance, then we need to check that
|
// frame DID NOT need clearance, then we need to check that
|
||||||
// assumption.
|
// assumption.
|
||||||
if (!treatWithClearance && !applyBStartMargin && mightClearFloats &&
|
if (!treatWithClearance && !applyBStartMargin && mightClearFloats &&
|
||||||
aState.mReflowState.mDiscoveredClearance) {
|
aState.mReflowInput.mDiscoveredClearance) {
|
||||||
nscoord curBCoord = aState.mBCoord + aState.mPrevBEndMargin.get();
|
nscoord curBCoord = aState.mBCoord + aState.mPrevBEndMargin.get();
|
||||||
nscoord clearBCoord = aState.ClearFloats(curBCoord, breakType, replacedBlock);
|
nscoord clearBCoord = aState.ClearFloats(curBCoord, breakType, replacedBlock);
|
||||||
if (clearBCoord != curBCoord) {
|
if (clearBCoord != curBCoord) {
|
||||||
// Only record the first frame that requires clearance
|
// Only record the first frame that requires clearance
|
||||||
if (!*aState.mReflowState.mDiscoveredClearance) {
|
if (!*aState.mReflowInput.mDiscoveredClearance) {
|
||||||
*aState.mReflowState.mDiscoveredClearance = frame;
|
*aState.mReflowInput.mDiscoveredClearance = frame;
|
||||||
}
|
}
|
||||||
aState.mPrevChild = frame;
|
aState.mPrevChild = frame;
|
||||||
// Exactly what we do now is flexible since we'll definitely be
|
// Exactly what we do now is flexible since we'll definitely be
|
||||||
@@ -3206,7 +3206,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
// correct available space (there might be a float that's
|
// correct available space (there might be a float that's
|
||||||
// already been placed below the aState.mPrevBEndMargin
|
// already been placed below the aState.mPrevBEndMargin
|
||||||
|
|
||||||
// Setup a reflowState to get the style computed block-start margin
|
// Setup a reflowInput to get the style computed block-start margin
|
||||||
// value. We'll use a reason of `resize' so that we don't fudge
|
// value. We'll use a reason of `resize' so that we don't fudge
|
||||||
// any incremental reflow state.
|
// any incremental reflow state.
|
||||||
|
|
||||||
@@ -3217,7 +3217,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
// margin seems like a waste. And we do this for almost every block!
|
// margin seems like a waste. And we do this for almost every block!
|
||||||
WritingMode wm = frame->GetWritingMode();
|
WritingMode wm = frame->GetWritingMode();
|
||||||
LogicalSize availSpace = aState.ContentSize(wm);
|
LogicalSize availSpace = aState.ContentSize(wm);
|
||||||
ReflowInput reflowState(aState.mPresContext, aState.mReflowState,
|
ReflowInput reflowInput(aState.mPresContext, aState.mReflowInput,
|
||||||
frame, availSpace);
|
frame, availSpace);
|
||||||
|
|
||||||
if (treatWithClearance) {
|
if (treatWithClearance) {
|
||||||
@@ -3228,7 +3228,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
// Now compute the collapsed margin-block-start value into
|
// Now compute the collapsed margin-block-start value into
|
||||||
// aState.mPrevBEndMargin, assuming that all child margins
|
// aState.mPrevBEndMargin, assuming that all child margins
|
||||||
// collapse down to clearanceFrame.
|
// collapse down to clearanceFrame.
|
||||||
brc.ComputeCollapsedBStartMargin(reflowState,
|
brc.ComputeCollapsedBStartMargin(reflowInput,
|
||||||
&aState.mPrevBEndMargin,
|
&aState.mPrevBEndMargin,
|
||||||
clearanceFrame,
|
clearanceFrame,
|
||||||
&mayNeedRetry);
|
&mayNeedRetry);
|
||||||
@@ -3264,7 +3264,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
|
|
||||||
// Compute the collapsed margin again, ignoring the incoming margin this time
|
// Compute the collapsed margin again, ignoring the incoming margin this time
|
||||||
mayNeedRetry = false;
|
mayNeedRetry = false;
|
||||||
brc.ComputeCollapsedBStartMargin(reflowState,
|
brc.ComputeCollapsedBStartMargin(reflowInput,
|
||||||
&aState.mPrevBEndMargin,
|
&aState.mPrevBEndMargin,
|
||||||
clearanceFrame,
|
clearanceFrame,
|
||||||
&mayNeedRetry);
|
&mayNeedRetry);
|
||||||
@@ -3311,17 +3311,17 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
// Here aState.mBCoord is the block-start border-edge of the block.
|
// Here aState.mBCoord is the block-start border-edge of the block.
|
||||||
// Compute the available space for the block
|
// Compute the available space for the block
|
||||||
nsFlowAreaRect floatAvailableSpace = aState.GetFloatAvailableSpace();
|
nsFlowAreaRect floatAvailableSpace = aState.GetFloatAvailableSpace();
|
||||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
WritingMode wm = aState.mReflowInput.GetWritingMode();
|
||||||
LogicalRect availSpace(wm);
|
LogicalRect availSpace(wm);
|
||||||
aState.ComputeBlockAvailSpace(frame, display, floatAvailableSpace,
|
aState.ComputeBlockAvailSpace(frame, display, floatAvailableSpace,
|
||||||
replacedBlock != nullptr, availSpace);
|
replacedBlock != nullptr, availSpace);
|
||||||
|
|
||||||
// The check for
|
// The check for
|
||||||
// (!aState.mReflowState.mFlags.mIsTopOfPage || clearedFloats)
|
// (!aState.mReflowInput.mFlags.mIsTopOfPage || clearedFloats)
|
||||||
// is to some degree out of paranoia: if we reliably eat up block-start
|
// is to some degree out of paranoia: if we reliably eat up block-start
|
||||||
// margins at the top of the page as we ought to, it wouldn't be
|
// margins at the top of the page as we ought to, it wouldn't be
|
||||||
// needed.
|
// needed.
|
||||||
if ((!aState.mReflowState.mFlags.mIsTopOfPage || clearedFloats) &&
|
if ((!aState.mReflowInput.mFlags.mIsTopOfPage || clearedFloats) &&
|
||||||
availSpace.BSize(wm) < 0) {
|
availSpace.BSize(wm) < 0) {
|
||||||
// We know already that this child block won't fit on this
|
// We know already that this child block won't fit on this
|
||||||
// page/column due to the block-start margin or the clearance. So we
|
// page/column due to the block-start margin or the clearance. So we
|
||||||
@@ -3336,7 +3336,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
aState.mBCoord = startingBCoord;
|
aState.mBCoord = startingBCoord;
|
||||||
aState.mPrevBEndMargin = incomingMargin;
|
aState.mPrevBEndMargin = incomingMargin;
|
||||||
*aKeepReflowGoing = false;
|
*aKeepReflowGoing = false;
|
||||||
if (ShouldAvoidBreakInside(aState.mReflowState)) {
|
if (ShouldAvoidBreakInside(aState.mReflowInput)) {
|
||||||
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
||||||
} else {
|
} else {
|
||||||
PushLines(aState, aLine.prev());
|
PushLines(aState, aLine.prev());
|
||||||
@@ -3357,7 +3357,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
// will initialize it.
|
// will initialize it.
|
||||||
Maybe<ReflowInput> blockHtmlRS;
|
Maybe<ReflowInput> blockHtmlRS;
|
||||||
blockHtmlRS.emplace(
|
blockHtmlRS.emplace(
|
||||||
aState.mPresContext, aState.mReflowState, frame,
|
aState.mPresContext, aState.mReflowInput, frame,
|
||||||
availSpace.Size(wm).ConvertTo(frame->GetWritingMode(), wm));
|
availSpace.Size(wm).ConvertTo(frame->GetWritingMode(), wm));
|
||||||
|
|
||||||
nsFloatManager::SavedState floatManagerState;
|
nsFloatManager::SavedState floatManagerState;
|
||||||
@@ -3374,8 +3374,8 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
// brc.ReflowBlock() below does, so we need to remember now
|
// brc.ReflowBlock() below does, so we need to remember now
|
||||||
// whether it's empty.
|
// whether it's empty.
|
||||||
const bool shouldStoreClearance =
|
const bool shouldStoreClearance =
|
||||||
aState.mReflowState.mDiscoveredClearance &&
|
aState.mReflowInput.mDiscoveredClearance &&
|
||||||
!*aState.mReflowState.mDiscoveredClearance;
|
!*aState.mReflowInput.mDiscoveredClearance;
|
||||||
|
|
||||||
// Reflow the block into the available space
|
// Reflow the block into the available space
|
||||||
if (mayNeedRetry || replacedBlock) {
|
if (mayNeedRetry || replacedBlock) {
|
||||||
@@ -3386,7 +3386,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
blockHtmlRS->mDiscoveredClearance = &clearanceFrame;
|
blockHtmlRS->mDiscoveredClearance = &clearanceFrame;
|
||||||
} else if (!applyBStartMargin) {
|
} else if (!applyBStartMargin) {
|
||||||
blockHtmlRS->mDiscoveredClearance =
|
blockHtmlRS->mDiscoveredClearance =
|
||||||
aState.mReflowState.mDiscoveredClearance;
|
aState.mReflowInput.mDiscoveredClearance;
|
||||||
}
|
}
|
||||||
|
|
||||||
frameReflowStatus = NS_FRAME_COMPLETE;
|
frameReflowStatus = NS_FRAME_COMPLETE;
|
||||||
@@ -3457,11 +3457,11 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
aState.mFloatManager->PopState(&floatManagerState);
|
aState.mFloatManager->PopState(&floatManagerState);
|
||||||
|
|
||||||
if (!treatWithClearance && !applyBStartMargin &&
|
if (!treatWithClearance && !applyBStartMargin &&
|
||||||
aState.mReflowState.mDiscoveredClearance) {
|
aState.mReflowInput.mDiscoveredClearance) {
|
||||||
// We set shouldStoreClearance above to record only the first
|
// We set shouldStoreClearance above to record only the first
|
||||||
// frame that requires clearance.
|
// frame that requires clearance.
|
||||||
if (shouldStoreClearance) {
|
if (shouldStoreClearance) {
|
||||||
*aState.mReflowState.mDiscoveredClearance = frame;
|
*aState.mReflowInput.mDiscoveredClearance = frame;
|
||||||
}
|
}
|
||||||
aState.mPrevChild = frame;
|
aState.mPrevChild = frame;
|
||||||
// Exactly what we do now is flexible since we'll definitely be
|
// Exactly what we do now is flexible since we'll definitely be
|
||||||
@@ -3481,7 +3481,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
|
|
||||||
blockHtmlRS.reset();
|
blockHtmlRS.reset();
|
||||||
blockHtmlRS.emplace(
|
blockHtmlRS.emplace(
|
||||||
aState.mPresContext, aState.mReflowState, frame,
|
aState.mPresContext, aState.mReflowInput, frame,
|
||||||
availSpace.Size(wm).ConvertTo(frame->GetWritingMode(), wm));
|
availSpace.Size(wm).ConvertTo(frame->GetWritingMode(), wm));
|
||||||
} while (true);
|
} while (true);
|
||||||
|
|
||||||
@@ -3512,7 +3512,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
if (NS_INLINE_IS_BREAK_BEFORE(frameReflowStatus)) {
|
if (NS_INLINE_IS_BREAK_BEFORE(frameReflowStatus)) {
|
||||||
// None of the child block fits.
|
// None of the child block fits.
|
||||||
*aKeepReflowGoing = false;
|
*aKeepReflowGoing = false;
|
||||||
if (ShouldAvoidBreakInside(aState.mReflowState)) {
|
if (ShouldAvoidBreakInside(aState.mReflowInput)) {
|
||||||
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
||||||
} else {
|
} else {
|
||||||
PushLines(aState, aLine.prev());
|
PushLines(aState, aLine.prev());
|
||||||
@@ -3537,7 +3537,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
overflowAreas,
|
overflowAreas,
|
||||||
frameReflowStatus);
|
frameReflowStatus);
|
||||||
if (!NS_FRAME_IS_FULLY_COMPLETE(frameReflowStatus) &&
|
if (!NS_FRAME_IS_FULLY_COMPLETE(frameReflowStatus) &&
|
||||||
ShouldAvoidBreakInside(aState.mReflowState)) {
|
ShouldAvoidBreakInside(aState.mReflowInput)) {
|
||||||
*aKeepReflowGoing = false;
|
*aKeepReflowGoing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3683,7 +3683,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
if ((aLine == mLines.front() && !GetPrevInFlow()) ||
|
if ((aLine == mLines.front() && !GetPrevInFlow()) ||
|
||||||
ShouldAvoidBreakInside(aState.mReflowState)) {
|
ShouldAvoidBreakInside(aState.mReflowInput)) {
|
||||||
// If it's our very first line *or* we're not at the top of the page
|
// If it's our very first line *or* we're not at the top of the page
|
||||||
// and we have page-break-inside:avoid, then we need to be pushed to
|
// and we have page-break-inside:avoid, then we need to be pushed to
|
||||||
// our parent's next-in-flow.
|
// our parent's next-in-flow.
|
||||||
@@ -3738,7 +3738,7 @@ nsBlockFrame::ReflowInlineFrames(BlockReflowInput& aState,
|
|||||||
gfxBreakPriority forceBreakPriority = gfxBreakPriority::eNoBreak;
|
gfxBreakPriority forceBreakPriority = gfxBreakPriority::eNoBreak;
|
||||||
do {
|
do {
|
||||||
nsFloatManager::SavedState floatManagerState;
|
nsFloatManager::SavedState floatManagerState;
|
||||||
aState.mReflowState.mFloatManager->PushState(&floatManagerState);
|
aState.mReflowInput.mFloatManager->PushState(&floatManagerState);
|
||||||
|
|
||||||
// Once upon a time we allocated the first 30 nsLineLayout objects
|
// Once upon a time we allocated the first 30 nsLineLayout objects
|
||||||
// on the stack, and then we switched to the heap. At that time
|
// on the stack, and then we switched to the heap. At that time
|
||||||
@@ -3748,8 +3748,8 @@ nsBlockFrame::ReflowInlineFrames(BlockReflowInput& aState,
|
|||||||
// smaller, the complexity of 2 different ways of allocating
|
// smaller, the complexity of 2 different ways of allocating
|
||||||
// no longer makes sense. Now we always allocate on the stack.
|
// no longer makes sense. Now we always allocate on the stack.
|
||||||
nsLineLayout lineLayout(aState.mPresContext,
|
nsLineLayout lineLayout(aState.mPresContext,
|
||||||
aState.mReflowState.mFloatManager,
|
aState.mReflowInput.mFloatManager,
|
||||||
&aState.mReflowState, &aLine, nullptr);
|
&aState.mReflowInput, &aLine, nullptr);
|
||||||
lineLayout.Init(&aState, aState.mMinLineHeight, aState.mLineNumber);
|
lineLayout.Init(&aState, aState.mMinLineHeight, aState.mLineNumber);
|
||||||
if (forceBreakInFrame) {
|
if (forceBreakInFrame) {
|
||||||
lineLayout.ForceBreakAtPosition(forceBreakInFrame, forceBreakOffset);
|
lineLayout.ForceBreakAtPosition(forceBreakInFrame, forceBreakOffset);
|
||||||
@@ -3774,7 +3774,7 @@ nsBlockFrame::ReflowInlineFrames(BlockReflowInput& aState,
|
|||||||
forceBreakInFrame = nullptr;
|
forceBreakInFrame = nullptr;
|
||||||
}
|
}
|
||||||
// restore the float manager state
|
// restore the float manager state
|
||||||
aState.mReflowState.mFloatManager->PopState(&floatManagerState);
|
aState.mReflowInput.mFloatManager->PopState(&floatManagerState);
|
||||||
// Clear out float lists
|
// Clear out float lists
|
||||||
aState.mCurrentLineFloats.DeleteAll();
|
aState.mCurrentLineFloats.DeleteAll();
|
||||||
aState.mBelowCurrentLineFloats.DeleteAll();
|
aState.mBelowCurrentLineFloats.DeleteAll();
|
||||||
@@ -3830,7 +3830,7 @@ nsBlockFrame::DoReflowInlineFrames(BlockReflowInput& aState,
|
|||||||
this, aFloatAvailableSpace.mHasFloats);
|
this, aFloatAvailableSpace.mHasFloats);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WritingMode outerWM = aState.mReflowState.GetWritingMode();
|
WritingMode outerWM = aState.mReflowInput.GetWritingMode();
|
||||||
WritingMode lineWM = GetWritingMode(aLine->mFirstChild);
|
WritingMode lineWM = GetWritingMode(aLine->mFirstChild);
|
||||||
LogicalRect lineRect =
|
LogicalRect lineRect =
|
||||||
aFloatAvailableSpace.mRect.ConvertTo(lineWM, outerWM,
|
aFloatAvailableSpace.mRect.ConvertTo(lineWM, outerWM,
|
||||||
@@ -3985,9 +3985,9 @@ nsBlockFrame::DoReflowInlineFrames(BlockReflowInput& aState,
|
|||||||
aState.mBCoord += aFloatAvailableSpace.mRect.BSize(outerWM);
|
aState.mBCoord += aFloatAvailableSpace.mRect.BSize(outerWM);
|
||||||
aFloatAvailableSpace = aState.GetFloatAvailableSpace();
|
aFloatAvailableSpace = aState.GetFloatAvailableSpace();
|
||||||
} else {
|
} else {
|
||||||
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != aState.mReflowState.AvailableBSize(),
|
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != aState.mReflowInput.AvailableBSize(),
|
||||||
"We shouldn't be running out of height here");
|
"We shouldn't be running out of height here");
|
||||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.AvailableBSize()) {
|
if (NS_UNCONSTRAINEDSIZE == aState.mReflowInput.AvailableBSize()) {
|
||||||
// just move it down a bit to try to get out of this mess
|
// just move it down a bit to try to get out of this mess
|
||||||
aState.mBCoord += 1;
|
aState.mBCoord += 1;
|
||||||
// We should never hit this case if we've placed floats on the
|
// We should never hit this case if we've placed floats on the
|
||||||
@@ -4254,7 +4254,7 @@ nsBlockFrame::SplitFloat(BlockReflowInput& aState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t floatStyle =
|
uint8_t floatStyle =
|
||||||
aFloat->StyleDisplay()->PhysicalFloats(aState.mReflowState.GetWritingMode());
|
aFloat->StyleDisplay()->PhysicalFloats(aState.mReflowInput.GetWritingMode());
|
||||||
if (floatStyle == NS_STYLE_FLOAT_LEFT) {
|
if (floatStyle == NS_STYLE_FLOAT_LEFT) {
|
||||||
aState.mFloatManager->SetSplitLeftFloatAcrossBreak();
|
aState.mFloatManager->SetSplitLeftFloatAcrossBreak();
|
||||||
} else {
|
} else {
|
||||||
@@ -4424,7 +4424,7 @@ nsBlockFrame::PlaceLine(BlockReflowInput& aState,
|
|||||||
// There are exactly two places a bullet can be placed: near the
|
// There are exactly two places a bullet can be placed: near the
|
||||||
// first or second line. It's only placed on the second line in a
|
// first or second line. It's only placed on the second line in a
|
||||||
// rare case: when the first line is empty.
|
// rare case: when the first line is empty.
|
||||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
WritingMode wm = aState.mReflowInput.GetWritingMode();
|
||||||
bool addedBullet = false;
|
bool addedBullet = false;
|
||||||
if (HasOutsideBullet() &&
|
if (HasOutsideBullet() &&
|
||||||
((aLine == mLines.front() &&
|
((aLine == mLines.front() &&
|
||||||
@@ -4432,7 +4432,7 @@ nsBlockFrame::PlaceLine(BlockReflowInput& aState,
|
|||||||
(mLines.front() != mLines.back() &&
|
(mLines.front() != mLines.back() &&
|
||||||
0 == mLines.front()->BSize() &&
|
0 == mLines.front()->BSize() &&
|
||||||
aLine == mLines.begin().next()))) {
|
aLine == mLines.begin().next()))) {
|
||||||
ReflowOutput metrics(aState.mReflowState);
|
ReflowOutput metrics(aState.mReflowInput);
|
||||||
nsIFrame* bullet = GetOutsideBullet();
|
nsIFrame* bullet = GetOutsideBullet();
|
||||||
ReflowBullet(bullet, aState, metrics, aState.mBCoord);
|
ReflowBullet(bullet, aState, metrics, aState.mBCoord);
|
||||||
NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
|
NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
|
||||||
@@ -4543,7 +4543,7 @@ nsBlockFrame::PlaceLine(BlockReflowInput& aState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!NS_FRAME_IS_FULLY_COMPLETE(aState.mReflowStatus) &&
|
if (!NS_FRAME_IS_FULLY_COMPLETE(aState.mReflowStatus) &&
|
||||||
ShouldAvoidBreakInside(aState.mReflowState)) {
|
ShouldAvoidBreakInside(aState.mReflowInput)) {
|
||||||
aLine->AppendFloats(aState.mCurrentLineFloats);
|
aLine->AppendFloats(aState.mCurrentLineFloats);
|
||||||
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
||||||
return true;
|
return true;
|
||||||
@@ -4554,7 +4554,7 @@ nsBlockFrame::PlaceLine(BlockReflowInput& aState,
|
|||||||
newBCoord > aState.mBEndEdge &&
|
newBCoord > aState.mBEndEdge &&
|
||||||
aState.mBEndEdge != NS_UNCONSTRAINEDSIZE) {
|
aState.mBEndEdge != NS_UNCONSTRAINEDSIZE) {
|
||||||
NS_ASSERTION(aState.mCurrentLine == aLine, "oops");
|
NS_ASSERTION(aState.mCurrentLine == aLine, "oops");
|
||||||
if (ShouldAvoidBreakInside(aState.mReflowState)) {
|
if (ShouldAvoidBreakInside(aState.mReflowInput)) {
|
||||||
// All our content doesn't fit, start on the next page.
|
// All our content doesn't fit, start on the next page.
|
||||||
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
||||||
} else {
|
} else {
|
||||||
@@ -6051,7 +6051,7 @@ nsBlockFrame::AdjustFloatAvailableSpace(BlockReflowInput& aState,
|
|||||||
// size of the containing block.
|
// size of the containing block.
|
||||||
nscoord availISize;
|
nscoord availISize;
|
||||||
const nsStyleDisplay* floatDisplay = aFloatFrame->StyleDisplay();
|
const nsStyleDisplay* floatDisplay = aFloatFrame->StyleDisplay();
|
||||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
WritingMode wm = aState.mReflowInput.GetWritingMode();
|
||||||
|
|
||||||
if (NS_STYLE_DISPLAY_TABLE != floatDisplay->mDisplay ||
|
if (NS_STYLE_DISPLAY_TABLE != floatDisplay->mDisplay ||
|
||||||
eCompatibility_NavQuirks != aState.mPresContext->CompatibilityMode() ) {
|
eCompatibility_NavQuirks != aState.mPresContext->CompatibilityMode() ) {
|
||||||
@@ -6095,10 +6095,10 @@ nsBlockFrame::ComputeFloatISize(BlockReflowInput& aState,
|
|||||||
aFloatAvailableSpace,
|
aFloatAvailableSpace,
|
||||||
aFloat);
|
aFloat);
|
||||||
|
|
||||||
WritingMode blockWM = aState.mReflowState.GetWritingMode();
|
WritingMode blockWM = aState.mReflowInput.GetWritingMode();
|
||||||
WritingMode floatWM = aFloat->GetWritingMode();
|
WritingMode floatWM = aFloat->GetWritingMode();
|
||||||
ReflowInput
|
ReflowInput
|
||||||
floatRS(aState.mPresContext, aState.mReflowState, aFloat,
|
floatRS(aState.mPresContext, aState.mReflowInput, aFloat,
|
||||||
availSpace.Size(blockWM).ConvertTo(floatWM, blockWM));
|
availSpace.Size(blockWM).ConvertTo(floatWM, blockWM));
|
||||||
|
|
||||||
return floatRS.ComputedSizeWithMarginBorderPadding(blockWM).ISize(blockWM);
|
return floatRS.ComputedSizeWithMarginBorderPadding(blockWM).ISize(blockWM);
|
||||||
@@ -6118,7 +6118,7 @@ nsBlockFrame::ReflowFloat(BlockReflowInput& aState,
|
|||||||
// Reflow the float.
|
// Reflow the float.
|
||||||
aReflowStatus = NS_FRAME_COMPLETE;
|
aReflowStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
WritingMode wm = aState.mReflowInput.GetWritingMode();
|
||||||
#ifdef NOISY_FLOAT
|
#ifdef NOISY_FLOAT
|
||||||
printf("Reflow Float %p in parent %p, availSpace(%d,%d,%d,%d)\n",
|
printf("Reflow Float %p in parent %p, availSpace(%d,%d,%d,%d)\n",
|
||||||
aFloat, this,
|
aFloat, this,
|
||||||
@@ -6128,7 +6128,7 @@ nsBlockFrame::ReflowFloat(BlockReflowInput& aState,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
ReflowInput
|
ReflowInput
|
||||||
floatRS(aState.mPresContext, aState.mReflowState, aFloat,
|
floatRS(aState.mPresContext, aState.mReflowInput, aFloat,
|
||||||
aAdjustedAvailableSpace.Size(wm).ConvertTo(aFloat->GetWritingMode(),
|
aAdjustedAvailableSpace.Size(wm).ConvertTo(aFloat->GetWritingMode(),
|
||||||
wm));
|
wm));
|
||||||
|
|
||||||
@@ -6147,7 +6147,7 @@ nsBlockFrame::ReflowFloat(BlockReflowInput& aState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setup a block reflow context to reflow the float.
|
// Setup a block reflow context to reflow the float.
|
||||||
nsBlockReflowContext brc(aState.mPresContext, aState.mReflowState);
|
nsBlockReflowContext brc(aState.mPresContext, aState.mReflowInput);
|
||||||
|
|
||||||
// Reflow the float
|
// Reflow the float
|
||||||
bool isAdjacentWithTop = aState.IsAdjacentWithTop();
|
bool isAdjacentWithTop = aState.IsAdjacentWithTop();
|
||||||
@@ -7177,7 +7177,7 @@ nsBlockFrame::ReflowBullet(nsIFrame* aBulletFrame,
|
|||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
nscoord aLineTop)
|
nscoord aLineTop)
|
||||||
{
|
{
|
||||||
const ReflowInput &rs = aState.mReflowState;
|
const ReflowInput &rs = aState.mReflowInput;
|
||||||
|
|
||||||
// Reflow the bullet now
|
// Reflow the bullet now
|
||||||
WritingMode bulletWM = aBulletFrame->GetWritingMode();
|
WritingMode bulletWM = aBulletFrame->GetWritingMode();
|
||||||
@@ -7189,10 +7189,10 @@ nsBlockFrame::ReflowBullet(nsIFrame* aBulletFrame,
|
|||||||
// Get the reason right.
|
// Get the reason right.
|
||||||
// XXXwaterson Should this look just like the logic in
|
// XXXwaterson Should this look just like the logic in
|
||||||
// nsBlockReflowContext::ReflowBlock and nsLineLayout::ReflowFrame?
|
// nsBlockReflowContext::ReflowBlock and nsLineLayout::ReflowFrame?
|
||||||
ReflowInput reflowState(aState.mPresContext, rs,
|
ReflowInput reflowInput(aState.mPresContext, rs,
|
||||||
aBulletFrame, availSize);
|
aBulletFrame, availSize);
|
||||||
nsReflowStatus status;
|
nsReflowStatus status;
|
||||||
aBulletFrame->Reflow(aState.mPresContext, aMetrics, reflowState, status);
|
aBulletFrame->Reflow(aState.mPresContext, aMetrics, reflowInput, status);
|
||||||
|
|
||||||
// Get the float available space using our saved state from before we
|
// Get the float available space using our saved state from before we
|
||||||
// started reflowing the block, so that we ignore any floats inside
|
// started reflowing the block, so that we ignore any floats inside
|
||||||
@@ -7222,7 +7222,7 @@ nsBlockFrame::ReflowBullet(nsIFrame* aBulletFrame,
|
|||||||
// Get the bullet's margin, converted to our writing mode so that we can
|
// Get the bullet's margin, converted to our writing mode so that we can
|
||||||
// combine it with other logical values here.
|
// combine it with other logical values here.
|
||||||
LogicalMargin bulletMargin =
|
LogicalMargin bulletMargin =
|
||||||
reflowState.ComputedLogicalMargin().ConvertTo(wm, bulletWM);
|
reflowInput.ComputedLogicalMargin().ConvertTo(wm, bulletWM);
|
||||||
nscoord iStart = floatAvailSpace.IStart(wm) -
|
nscoord iStart = floatAvailSpace.IStart(wm) -
|
||||||
rs.ComputedLogicalBorderPadding().IStart(wm) -
|
rs.ComputedLogicalBorderPadding().IStart(wm) -
|
||||||
bulletMargin.IEnd(wm) -
|
bulletMargin.IEnd(wm) -
|
||||||
@@ -7236,7 +7236,7 @@ nsBlockFrame::ReflowBullet(nsIFrame* aBulletFrame,
|
|||||||
aMetrics.ISize(wm),
|
aMetrics.ISize(wm),
|
||||||
aMetrics.BSize(wm)),
|
aMetrics.BSize(wm)),
|
||||||
aState.ContainerSize());
|
aState.ContainerSize());
|
||||||
aBulletFrame->DidReflow(aState.mPresContext, &aState.mReflowState,
|
aBulletFrame->DidReflow(aState.mPresContext, &aState.mReflowInput,
|
||||||
nsDidReflowStatus::FINISHED);
|
nsDidReflowStatus::FINISHED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7398,8 +7398,8 @@ nsBlockFrame::ISizeToClearPastFloats(const BlockReflowInput& aState,
|
|||||||
nsIFrame* aFrame)
|
nsIFrame* aFrame)
|
||||||
{
|
{
|
||||||
nscoord inlineStartOffset, inlineEndOffset;
|
nscoord inlineStartOffset, inlineEndOffset;
|
||||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
WritingMode wm = aState.mReflowInput.GetWritingMode();
|
||||||
SizeComputationInput offsetState(aFrame, aState.mReflowState.mRenderingContext,
|
SizeComputationInput offsetState(aFrame, aState.mReflowInput.mRenderingContext,
|
||||||
wm, aState.mContentArea.ISize(wm));
|
wm, aState.mContentArea.ISize(wm));
|
||||||
|
|
||||||
ReplacedElementISizeToClear result;
|
ReplacedElementISizeToClear result;
|
||||||
@@ -7418,11 +7418,11 @@ nsBlockFrame::ISizeToClearPastFloats(const BlockReflowInput& aState,
|
|||||||
WritingMode frWM = aFrame->GetWritingMode();
|
WritingMode frWM = aFrame->GetWritingMode();
|
||||||
LogicalSize availSpace = LogicalSize(wm, availISize, NS_UNCONSTRAINEDSIZE).
|
LogicalSize availSpace = LogicalSize(wm, availISize, NS_UNCONSTRAINEDSIZE).
|
||||||
ConvertTo(frWM, wm);
|
ConvertTo(frWM, wm);
|
||||||
ReflowInput reflowState(aState.mPresContext, aState.mReflowState,
|
ReflowInput reflowInput(aState.mPresContext, aState.mReflowInput,
|
||||||
aFrame, availSpace);
|
aFrame, availSpace);
|
||||||
result.borderBoxISize =
|
result.borderBoxISize =
|
||||||
reflowState.ComputedSizeWithBorderPadding().ConvertTo(wm, frWM).ISize(wm);
|
reflowInput.ComputedSizeWithBorderPadding().ConvertTo(wm, frWM).ISize(wm);
|
||||||
// Use the margins from offsetState rather than reflowState so that
|
// Use the margins from offsetState rather than reflowInput so that
|
||||||
// they aren't reduced by ignoring margins in overconstrained cases.
|
// they aren't reduced by ignoring margins in overconstrained cases.
|
||||||
LogicalMargin computedMargin =
|
LogicalMargin computedMargin =
|
||||||
offsetState.ComputedLogicalMargin().ConvertTo(wm, frWM);
|
offsetState.ComputedLogicalMargin().ConvertTo(wm, frWM);
|
||||||
@@ -7449,17 +7449,17 @@ nsBlockFrame::GetNearestAncestorBlock(nsIFrame* aCandidate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowState,
|
nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus* aStatus,
|
nsReflowStatus* aStatus,
|
||||||
nscoord aContentBSize,
|
nscoord aContentBSize,
|
||||||
const LogicalMargin& aBorderPadding,
|
const LogicalMargin& aBorderPadding,
|
||||||
LogicalSize& aFinalSize,
|
LogicalSize& aFinalSize,
|
||||||
nscoord aConsumed)
|
nscoord aConsumed)
|
||||||
{
|
{
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
// Figure out how much of the computed height should be
|
// Figure out how much of the computed height should be
|
||||||
// applied to this frame.
|
// applied to this frame.
|
||||||
nscoord computedBSizeLeftOver = GetEffectiveComputedBSize(aReflowState,
|
nscoord computedBSizeLeftOver = GetEffectiveComputedBSize(aReflowInput,
|
||||||
aConsumed);
|
aConsumed);
|
||||||
NS_ASSERTION(!( IS_TRUE_OVERFLOW_CONTAINER(this)
|
NS_ASSERTION(!( IS_TRUE_OVERFLOW_CONTAINER(this)
|
||||||
&& computedBSizeLeftOver ),
|
&& computedBSizeLeftOver ),
|
||||||
@@ -7471,7 +7471,7 @@ nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowState,
|
|||||||
aBorderPadding.BEnd(wm));
|
aBorderPadding.BEnd(wm));
|
||||||
|
|
||||||
if (NS_FRAME_IS_NOT_COMPLETE(*aStatus) &&
|
if (NS_FRAME_IS_NOT_COMPLETE(*aStatus) &&
|
||||||
aFinalSize.BSize(wm) < aReflowState.AvailableBSize()) {
|
aFinalSize.BSize(wm) < aReflowInput.AvailableBSize()) {
|
||||||
// We fit in the available space - change status to OVERFLOW_INCOMPLETE.
|
// We fit in the available space - change status to OVERFLOW_INCOMPLETE.
|
||||||
// XXXmats why didn't Reflow report OVERFLOW_INCOMPLETE in the first place?
|
// XXXmats why didn't Reflow report OVERFLOW_INCOMPLETE in the first place?
|
||||||
// XXXmats and why exclude the case when our size == AvailableBSize?
|
// XXXmats and why exclude the case when our size == AvailableBSize?
|
||||||
@@ -7480,9 +7480,9 @@ nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowState,
|
|||||||
|
|
||||||
if (NS_FRAME_IS_COMPLETE(*aStatus)) {
|
if (NS_FRAME_IS_COMPLETE(*aStatus)) {
|
||||||
if (computedBSizeLeftOver > 0 &&
|
if (computedBSizeLeftOver > 0 &&
|
||||||
NS_UNCONSTRAINEDSIZE != aReflowState.AvailableBSize() &&
|
NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableBSize() &&
|
||||||
aFinalSize.BSize(wm) > aReflowState.AvailableBSize()) {
|
aFinalSize.BSize(wm) > aReflowInput.AvailableBSize()) {
|
||||||
if (ShouldAvoidBreakInside(aReflowState)) {
|
if (ShouldAvoidBreakInside(aReflowInput)) {
|
||||||
*aStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
*aStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -7491,7 +7491,7 @@ nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowState,
|
|||||||
// break. If our bottom border/padding straddles the break
|
// break. If our bottom border/padding straddles the break
|
||||||
// point, then this will increase our height and push the
|
// point, then this will increase our height and push the
|
||||||
// border/padding to the next page/column.
|
// border/padding to the next page/column.
|
||||||
aFinalSize.BSize(wm) = std::max(aReflowState.AvailableBSize(),
|
aFinalSize.BSize(wm) = std::max(aReflowInput.AvailableBSize(),
|
||||||
aContentBSize);
|
aContentBSize);
|
||||||
NS_FRAME_SET_INCOMPLETE(*aStatus);
|
NS_FRAME_SET_INCOMPLETE(*aStatus);
|
||||||
if (!GetNextInFlow())
|
if (!GetNextInFlow())
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Compute the final block size of this frame.
|
* Compute the final block size of this frame.
|
||||||
*
|
*
|
||||||
* @param aReflowState Data structure passed from parent during reflow.
|
* @param aReflowInput Data structure passed from parent during reflow.
|
||||||
* @param aReflowStatus A pointer to the reflow status for when we're finished
|
* @param aReflowStatus A pointer to the reflow status for when we're finished
|
||||||
* doing reflow. this will get set appropriately if the block-size
|
* doing reflow. this will get set appropriately if the block-size
|
||||||
* causes us to exceed the current available (page) block-size.
|
* causes us to exceed the current available (page) block-size.
|
||||||
@@ -255,7 +255,7 @@ public:
|
|||||||
* @param aFinalSize Out parameter for final block-size.
|
* @param aFinalSize Out parameter for final block-size.
|
||||||
* @param aConsumed The block-size already consumed by our previous-in-flows.
|
* @param aConsumed The block-size already consumed by our previous-in-flows.
|
||||||
*/
|
*/
|
||||||
void ComputeFinalBSize(const ReflowInput& aReflowState,
|
void ComputeFinalBSize(const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus* aStatus,
|
nsReflowStatus* aStatus,
|
||||||
nscoord aContentBSize,
|
nscoord aContentBSize,
|
||||||
const mozilla::LogicalMargin& aBorderPadding,
|
const mozilla::LogicalMargin& aBorderPadding,
|
||||||
@@ -264,7 +264,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
||||||
@@ -414,7 +414,7 @@ protected:
|
|||||||
// helper for SlideLine and UpdateLineContainerSize
|
// helper for SlideLine and UpdateLineContainerSize
|
||||||
void MoveChildFramesOfLine(nsLineBox* aLine, nscoord aDeltaBCoord);
|
void MoveChildFramesOfLine(nsLineBox* aLine, nscoord aDeltaBCoord);
|
||||||
|
|
||||||
void ComputeFinalSize(const ReflowInput& aReflowState,
|
void ComputeFinalSize(const ReflowInput& aReflowInput,
|
||||||
BlockReflowInput& aState,
|
BlockReflowInput& aState,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
nscoord* aBottomEdgeOfChildren);
|
nscoord* aBottomEdgeOfChildren);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ using namespace mozilla;
|
|||||||
nsBlockReflowContext::nsBlockReflowContext(nsPresContext* aPresContext,
|
nsBlockReflowContext::nsBlockReflowContext(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aParentRS)
|
const ReflowInput& aParentRS)
|
||||||
: mPresContext(aPresContext),
|
: mPresContext(aPresContext),
|
||||||
mOuterReflowState(aParentRS),
|
mOuterReflowInput(aParentRS),
|
||||||
mSpace(aParentRS.GetWritingMode()),
|
mSpace(aParentRS.GetWritingMode()),
|
||||||
mMetrics(aParentRS)
|
mMetrics(aParentRS)
|
||||||
{
|
{
|
||||||
@@ -152,19 +152,19 @@ nsBlockReflowContext::ComputeCollapsedBStartMargin(const ReflowInput& aRS,
|
|||||||
// we drilled down through a block wrapper. At the moment
|
// we drilled down through a block wrapper. At the moment
|
||||||
// we can only drill down one level so we only have to support
|
// we can only drill down one level so we only have to support
|
||||||
// one extra reflow state.
|
// one extra reflow state.
|
||||||
const ReflowInput* outerReflowState = &aRS;
|
const ReflowInput* outerReflowInput = &aRS;
|
||||||
if (frame != aRS.mFrame) {
|
if (frame != aRS.mFrame) {
|
||||||
NS_ASSERTION(frame->GetParent() == aRS.mFrame,
|
NS_ASSERTION(frame->GetParent() == aRS.mFrame,
|
||||||
"Can only drill through one level of block wrapper");
|
"Can only drill through one level of block wrapper");
|
||||||
LogicalSize availSpace = aRS.ComputedSize(frame->GetWritingMode());
|
LogicalSize availSpace = aRS.ComputedSize(frame->GetWritingMode());
|
||||||
outerReflowState = new ReflowInput(prescontext,
|
outerReflowInput = new ReflowInput(prescontext,
|
||||||
aRS, frame, availSpace);
|
aRS, frame, availSpace);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
LogicalSize availSpace =
|
LogicalSize availSpace =
|
||||||
outerReflowState->ComputedSize(kid->GetWritingMode());
|
outerReflowInput->ComputedSize(kid->GetWritingMode());
|
||||||
ReflowInput innerReflowState(prescontext,
|
ReflowInput innerReflowInput(prescontext,
|
||||||
*outerReflowState, kid,
|
*outerReflowInput, kid,
|
||||||
availSpace);
|
availSpace);
|
||||||
// Record that we're being optimistic by assuming the kid
|
// Record that we're being optimistic by assuming the kid
|
||||||
// has no clearance
|
// has no clearance
|
||||||
@@ -172,21 +172,21 @@ nsBlockReflowContext::ComputeCollapsedBStartMargin(const ReflowInput& aRS,
|
|||||||
!nsBlockFrame::BlockCanIntersectFloats(kid)) {
|
!nsBlockFrame::BlockCanIntersectFloats(kid)) {
|
||||||
*aMayNeedRetry = true;
|
*aMayNeedRetry = true;
|
||||||
}
|
}
|
||||||
if (ComputeCollapsedBStartMargin(innerReflowState, aMargin,
|
if (ComputeCollapsedBStartMargin(innerReflowInput, aMargin,
|
||||||
aClearanceFrame, aMayNeedRetry,
|
aClearanceFrame, aMayNeedRetry,
|
||||||
&isEmpty)) {
|
&isEmpty)) {
|
||||||
line->MarkDirty();
|
line->MarkDirty();
|
||||||
dirtiedLine = true;
|
dirtiedLine = true;
|
||||||
}
|
}
|
||||||
if (isEmpty) {
|
if (isEmpty) {
|
||||||
WritingMode innerWM = innerReflowState.GetWritingMode();
|
WritingMode innerWM = innerReflowInput.GetWritingMode();
|
||||||
LogicalMargin innerMargin =
|
LogicalMargin innerMargin =
|
||||||
innerReflowState.ComputedLogicalMargin().ConvertTo(parentWM, innerWM);
|
innerReflowInput.ComputedLogicalMargin().ConvertTo(parentWM, innerWM);
|
||||||
aMargin->Include(innerMargin.BEnd(parentWM));
|
aMargin->Include(innerMargin.BEnd(parentWM));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (outerReflowState != &aRS) {
|
if (outerReflowInput != &aRS) {
|
||||||
delete const_cast<ReflowInput*>(outerReflowState);
|
delete const_cast<ReflowInput*>(outerReflowInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isEmpty) {
|
if (!isEmpty) {
|
||||||
@@ -232,7 +232,7 @@ nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
|||||||
BlockReflowInput& aState)
|
BlockReflowInput& aState)
|
||||||
{
|
{
|
||||||
mFrame = aFrameRS.mFrame;
|
mFrame = aFrameRS.mFrame;
|
||||||
mWritingMode = aState.mReflowState.GetWritingMode();
|
mWritingMode = aState.mReflowInput.GetWritingMode();
|
||||||
mContainerSize = aState.ContainerSize();
|
mContainerSize = aState.ContainerSize();
|
||||||
mSpace = aSpace;
|
mSpace = aSpace;
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
|||||||
mBStartMargin = aPrevMargin;
|
mBStartMargin = aPrevMargin;
|
||||||
|
|
||||||
#ifdef NOISY_BLOCKDIR_MARGINS
|
#ifdef NOISY_BLOCKDIR_MARGINS
|
||||||
nsFrame::ListTag(stdout, mOuterReflowState.mFrame);
|
nsFrame::ListTag(stdout, mOuterReflowInput.mFrame);
|
||||||
printf(": reflowing ");
|
printf(": reflowing ");
|
||||||
nsFrame::ListTag(stdout, mFrame);
|
nsFrame::ListTag(stdout, mFrame);
|
||||||
printf(" margin => %d, clearance => %d\n", mBStartMargin.get(), aClearance);
|
printf(" margin => %d, clearance => %d\n", mBStartMargin.get(), aClearance);
|
||||||
@@ -294,7 +294,7 @@ nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
|||||||
|
|
||||||
if ((mFrame->GetStateBits() & NS_BLOCK_FLOAT_MGR) == 0)
|
if ((mFrame->GetStateBits() & NS_BLOCK_FLOAT_MGR) == 0)
|
||||||
aFrameRS.mBlockDelta =
|
aFrameRS.mBlockDelta =
|
||||||
mOuterReflowState.mBlockDelta + mBCoord - aLine->BStart();
|
mOuterReflowInput.mBlockDelta + mBCoord - aLine->BStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@@ -302,9 +302,9 @@ nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
|||||||
mMetrics.BSize(mWritingMode) = nscoord(0xdeadbeef);
|
mMetrics.BSize(mWritingMode) = nscoord(0xdeadbeef);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mOuterReflowState.mFloatManager->Translate(tI, tB);
|
mOuterReflowInput.mFloatManager->Translate(tI, tB);
|
||||||
mFrame->Reflow(mPresContext, mMetrics, aFrameRS, aFrameReflowStatus);
|
mFrame->Reflow(mPresContext, mMetrics, aFrameRS, aFrameReflowStatus);
|
||||||
mOuterReflowState.mFloatManager->Translate(-tI, -tB);
|
mOuterReflowInput.mFloatManager->Translate(-tI, -tB);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (!NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) {
|
if (!NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) {
|
||||||
@@ -357,7 +357,7 @@ nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
|||||||
* collapse margins (CSS2 8.3.1). Also apply relative positioning.
|
* collapse margins (CSS2 8.3.1). Also apply relative positioning.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowState,
|
nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowInput,
|
||||||
bool aForceFit,
|
bool aForceFit,
|
||||||
nsLineBox* aLine,
|
nsLineBox* aLine,
|
||||||
nsCollapsingMargin& aBEndMarginResult,
|
nsCollapsingMargin& aBEndMarginResult,
|
||||||
@@ -365,11 +365,11 @@ nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowState,
|
|||||||
nsReflowStatus aReflowStatus)
|
nsReflowStatus aReflowStatus)
|
||||||
{
|
{
|
||||||
// Compute collapsed block-end margin value.
|
// Compute collapsed block-end margin value.
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
WritingMode parentWM = mMetrics.GetWritingMode();
|
WritingMode parentWM = mMetrics.GetWritingMode();
|
||||||
if (NS_FRAME_IS_COMPLETE(aReflowStatus)) {
|
if (NS_FRAME_IS_COMPLETE(aReflowStatus)) {
|
||||||
aBEndMarginResult = mMetrics.mCarriedOutBEndMargin;
|
aBEndMarginResult = mMetrics.mCarriedOutBEndMargin;
|
||||||
aBEndMarginResult.Include(aReflowState.ComputedLogicalMargin().
|
aBEndMarginResult.Include(aReflowInput.ComputedLogicalMargin().
|
||||||
ConvertTo(parentWM, wm).BEnd(parentWM));
|
ConvertTo(parentWM, wm).BEnd(parentWM));
|
||||||
} else {
|
} else {
|
||||||
// The used block-end-margin is set to zero before a break.
|
// The used block-end-margin is set to zero before a break.
|
||||||
@@ -395,7 +395,7 @@ nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowState,
|
|||||||
|
|
||||||
#ifdef NOISY_BLOCKDIR_MARGINS
|
#ifdef NOISY_BLOCKDIR_MARGINS
|
||||||
printf(" ");
|
printf(" ");
|
||||||
nsFrame::ListTag(stdout, mOuterReflowState.mFrame);
|
nsFrame::ListTag(stdout, mOuterReflowInput.mFrame);
|
||||||
printf(": ");
|
printf(": ");
|
||||||
nsFrame::ListTag(stdout, mFrame);
|
nsFrame::ListTag(stdout, mFrame);
|
||||||
printf(" -- collapsing block start & end margin together; BStart=%d spaceBStart=%d\n",
|
printf(" -- collapsing block start & end margin together; BStart=%d spaceBStart=%d\n",
|
||||||
@@ -431,7 +431,7 @@ nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowState,
|
|||||||
backupContainingBlockAdvance + mMetrics.BSize(mWritingMode);
|
backupContainingBlockAdvance + mMetrics.BSize(mWritingMode);
|
||||||
if (bEnd > mSpace.BEnd(mWritingMode)) {
|
if (bEnd > mSpace.BEnd(mWritingMode)) {
|
||||||
// didn't fit, we must acquit.
|
// didn't fit, we must acquit.
|
||||||
mFrame->DidReflow(mPresContext, &aReflowState,
|
mFrame->DidReflow(mPresContext, &aReflowInput,
|
||||||
nsDidReflowStatus::FINISHED);
|
nsDidReflowStatus::FINISHED);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -451,11 +451,11 @@ nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowState,
|
|||||||
// ApplyRelativePositioning in right-to-left writing modes needs to
|
// ApplyRelativePositioning in right-to-left writing modes needs to
|
||||||
// know the updated frame width
|
// know the updated frame width
|
||||||
mFrame->SetSize(mWritingMode, mMetrics.Size(mWritingMode));
|
mFrame->SetSize(mWritingMode, mMetrics.Size(mWritingMode));
|
||||||
aReflowState.ApplyRelativePositioning(&logPos, mContainerSize);
|
aReflowInput.ApplyRelativePositioning(&logPos, mContainerSize);
|
||||||
|
|
||||||
// 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,
|
||||||
&aReflowState, frameWM, logPos,
|
&aReflowInput, frameWM, logPos,
|
||||||
mContainerSize, 0);
|
mContainerSize, 0);
|
||||||
|
|
||||||
aOverflowAreas = mMetrics.mOverflowAreas + mFrame->GetPosition();
|
aOverflowAreas = mMetrics.mOverflowAreas + mFrame->GetPosition();
|
||||||
|
|||||||
@@ -37,11 +37,11 @@ public:
|
|||||||
nscoord aClearance,
|
nscoord aClearance,
|
||||||
bool aIsAdjacentWithBStart,
|
bool aIsAdjacentWithBStart,
|
||||||
nsLineBox* aLine,
|
nsLineBox* aLine,
|
||||||
ReflowInput& aReflowState,
|
ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aReflowStatus,
|
nsReflowStatus& aReflowStatus,
|
||||||
BlockReflowInput& aState);
|
BlockReflowInput& aState);
|
||||||
|
|
||||||
bool PlaceBlock(const ReflowInput& aReflowState,
|
bool PlaceBlock(const ReflowInput& aReflowInput,
|
||||||
bool aForceFit,
|
bool aForceFit,
|
||||||
nsLineBox* aLine,
|
nsLineBox* aLine,
|
||||||
nsCollapsingMargin& aBEndMarginResult /* out */,
|
nsCollapsingMargin& aBEndMarginResult /* out */,
|
||||||
@@ -83,7 +83,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsPresContext* mPresContext;
|
nsPresContext* mPresContext;
|
||||||
const ReflowInput& mOuterReflowState;
|
const ReflowInput& mOuterReflowInput;
|
||||||
|
|
||||||
nsIFrame* mFrame;
|
nsIFrame* mFrame;
|
||||||
mozilla::LogicalRect mSpace;
|
mozilla::LogicalRect mSpace;
|
||||||
|
|||||||
@@ -631,24 +631,24 @@ nsBulletFrame::GetDesiredSize(nsPresContext* aCX,
|
|||||||
void
|
void
|
||||||
nsBulletFrame::Reflow(nsPresContext* aPresContext,
|
nsBulletFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsBulletFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsBulletFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
|
||||||
|
|
||||||
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
|
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
|
||||||
SetFontSizeInflation(inflation);
|
SetFontSizeInflation(inflation);
|
||||||
|
|
||||||
// Get the base size
|
// Get the base size
|
||||||
GetDesiredSize(aPresContext, aReflowState.mRenderingContext, aMetrics, inflation,
|
GetDesiredSize(aPresContext, aReflowInput.mRenderingContext, aMetrics, inflation,
|
||||||
&mPadding);
|
&mPadding);
|
||||||
|
|
||||||
// Add in the border and padding; split the top/bottom between the
|
// Add in the border and padding; split the top/bottom between the
|
||||||
// ascent and descent to make things look nice
|
// ascent and descent to make things look nice
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
const LogicalMargin& bp = aReflowState.ComputedLogicalBorderPadding();
|
const LogicalMargin& bp = aReflowInput.ComputedLogicalBorderPadding();
|
||||||
mPadding.BStart(wm) += NSToCoordRound(bp.BStart(wm) * inflation);
|
mPadding.BStart(wm) += NSToCoordRound(bp.BStart(wm) * inflation);
|
||||||
mPadding.IEnd(wm) += NSToCoordRound(bp.IEnd(wm) * inflation);
|
mPadding.IEnd(wm) += NSToCoordRound(bp.IEnd(wm) * inflation);
|
||||||
mPadding.BEnd(wm) += NSToCoordRound(bp.BEnd(wm) * inflation);
|
mPadding.BEnd(wm) += NSToCoordRound(bp.BEnd(wm) * inflation);
|
||||||
@@ -668,7 +668,7 @@ nsBulletFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
aMetrics.SetOverflowAreasToDesiredBounds();
|
aMetrics.SetOverflowAreasToDesiredBounds();
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */ nscoord
|
/* virtual */ nscoord
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
|
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
|
||||||
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
|
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
|
||||||
|
|||||||
@@ -573,12 +573,12 @@ nsCanvasFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
|
|||||||
void
|
void
|
||||||
nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsCanvasFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsCanvasFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
NS_FRAME_TRACE_REFLOW_IN("nsCanvasFrame::Reflow");
|
NS_FRAME_TRACE_REFLOW_IN("nsCanvasFrame::Reflow");
|
||||||
|
|
||||||
// Initialize OUT parameter
|
// Initialize OUT parameter
|
||||||
@@ -603,7 +603,7 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// Set our size up front, since some parts of reflow depend on it
|
// Set our size up front, since some parts of reflow depend on it
|
||||||
// being already set. Note that the computed height may be
|
// being already set. Note that the computed height may be
|
||||||
// unconstrained; that's ok. Consumers should watch out for that.
|
// unconstrained; that's ok. Consumers should watch out for that.
|
||||||
SetSize(nsSize(aReflowState.ComputedWidth(), aReflowState.ComputedHeight()));
|
SetSize(nsSize(aReflowInput.ComputedWidth(), aReflowInput.ComputedHeight()));
|
||||||
|
|
||||||
// Reflow our one and only normal child frame. It's either the root
|
// Reflow our one and only normal child frame. It's either the root
|
||||||
// element's frame or a placeholder for that frame, if the root element
|
// element's frame or a placeholder for that frame, if the root element
|
||||||
@@ -612,7 +612,7 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// don't need to be reflowed. The normal child is always comes before
|
// don't need to be reflowed. The normal child is always comes before
|
||||||
// the fixed-pos placeholders, because we insert it at the start
|
// the fixed-pos placeholders, because we insert it at the start
|
||||||
// of the child list, above.
|
// of the child list, above.
|
||||||
ReflowOutput kidDesiredSize(aReflowState);
|
ReflowOutput kidDesiredSize(aReflowInput);
|
||||||
if (mFrames.IsEmpty()) {
|
if (mFrames.IsEmpty()) {
|
||||||
// We have no child frame, so return an empty size
|
// We have no child frame, so return an empty size
|
||||||
aDesiredSize.Width() = aDesiredSize.Height() = 0;
|
aDesiredSize.Width() = aDesiredSize.Height() = 0;
|
||||||
@@ -621,31 +621,31 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
bool kidDirty = (kidFrame->GetStateBits() & NS_FRAME_IS_DIRTY) != 0;
|
bool kidDirty = (kidFrame->GetStateBits() & NS_FRAME_IS_DIRTY) != 0;
|
||||||
|
|
||||||
ReflowInput
|
ReflowInput
|
||||||
kidReflowState(aPresContext, aReflowState, kidFrame,
|
kidReflowInput(aPresContext, aReflowInput, kidFrame,
|
||||||
aReflowState.AvailableSize(kidFrame->GetWritingMode()));
|
aReflowInput.AvailableSize(kidFrame->GetWritingMode()));
|
||||||
|
|
||||||
if (aReflowState.IsBResizeForWM(kidReflowState.GetWritingMode()) &&
|
if (aReflowInput.IsBResizeForWM(kidReflowInput.GetWritingMode()) &&
|
||||||
(kidFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
|
(kidFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
|
||||||
// Tell our kid it's being block-dir resized too. Bit of a
|
// Tell our kid it's being block-dir resized too. Bit of a
|
||||||
// hack for framesets.
|
// hack for framesets.
|
||||||
kidReflowState.SetBResize(true);
|
kidReflowInput.SetBResize(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
WritingMode kidWM = kidReflowState.GetWritingMode();
|
WritingMode kidWM = kidReflowInput.GetWritingMode();
|
||||||
nsSize containerSize = aReflowState.ComputedPhysicalSize();
|
nsSize containerSize = aReflowInput.ComputedPhysicalSize();
|
||||||
|
|
||||||
LogicalMargin margin = kidReflowState.ComputedLogicalMargin();
|
LogicalMargin margin = kidReflowInput.ComputedLogicalMargin();
|
||||||
LogicalPoint kidPt(kidWM, margin.IStart(kidWM), margin.BStart(kidWM));
|
LogicalPoint kidPt(kidWM, margin.IStart(kidWM), margin.BStart(kidWM));
|
||||||
|
|
||||||
kidReflowState.ApplyRelativePositioning(&kidPt, containerSize);
|
kidReflowInput.ApplyRelativePositioning(&kidPt, containerSize);
|
||||||
|
|
||||||
// Reflow the frame
|
// Reflow the frame
|
||||||
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState,
|
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput,
|
||||||
kidWM, kidPt, containerSize, 0, aStatus);
|
kidWM, kidPt, containerSize, 0, 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, &kidReflowState,
|
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, &kidReflowInput,
|
||||||
kidWM, kidPt, containerSize, 0);
|
kidWM, kidPt, containerSize, 0);
|
||||||
|
|
||||||
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
|
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
|
||||||
@@ -685,12 +685,12 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// sometimes we can be given an unconstrained height (when a window
|
// sometimes we can be given an unconstrained height (when a window
|
||||||
// is sizing-to-content), and we should compute our desired height.
|
// is sizing-to-content), and we should compute our desired height.
|
||||||
LogicalSize finalSize(wm);
|
LogicalSize finalSize(wm);
|
||||||
finalSize.ISize(wm) = aReflowState.ComputedISize();
|
finalSize.ISize(wm) = aReflowInput.ComputedISize();
|
||||||
if (aReflowState.ComputedBSize() == NS_UNCONSTRAINEDSIZE) {
|
if (aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE) {
|
||||||
finalSize.BSize(wm) = kidFrame->GetLogicalSize(wm).BSize(wm) +
|
finalSize.BSize(wm) = kidFrame->GetLogicalSize(wm).BSize(wm) +
|
||||||
kidReflowState.ComputedLogicalMargin().BStartEnd(wm);
|
kidReflowInput.ComputedLogicalMargin().BStartEnd(wm);
|
||||||
} else {
|
} else {
|
||||||
finalSize.BSize(wm) = aReflowState.ComputedBSize();
|
finalSize.BSize(wm) = aReflowInput.ComputedBSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
aDesiredSize.SetSize(wm, finalSize);
|
aDesiredSize.SetSize(wm, finalSize);
|
||||||
@@ -700,15 +700,15 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (prevCanvasFrame) {
|
if (prevCanvasFrame) {
|
||||||
ReflowOverflowContainerChildren(aPresContext, aReflowState,
|
ReflowOverflowContainerChildren(aPresContext, aReflowInput,
|
||||||
aDesiredSize.mOverflowAreas, 0,
|
aDesiredSize.mOverflowAreas, 0,
|
||||||
aStatus);
|
aStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus);
|
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
|
|
||||||
NS_FRAME_TRACE_REFLOW_OUT("nsCanvasFrame::Reflow", aStatus);
|
NS_FRAME_TRACE_REFLOW_OUT("nsCanvasFrame::Reflow", aStatus);
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIAtom*
|
nsIAtom*
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public:
|
|||||||
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
|
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override
|
virtual bool IsFrameOfType(uint32_t aFlags) const override
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -155,30 +155,30 @@ nsColumnSetFrame::PaintColumnRule(nsRenderingContext* aCtx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nscoord
|
static nscoord
|
||||||
GetAvailableContentISize(const ReflowInput& aReflowState)
|
GetAvailableContentISize(const ReflowInput& aReflowInput)
|
||||||
{
|
{
|
||||||
if (aReflowState.AvailableISize() == NS_INTRINSICSIZE) {
|
if (aReflowInput.AvailableISize() == NS_INTRINSICSIZE) {
|
||||||
return NS_INTRINSICSIZE;
|
return NS_INTRINSICSIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
nscoord borderPaddingISize =
|
nscoord borderPaddingISize =
|
||||||
aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm);
|
aReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm);
|
||||||
return std::max(0, aReflowState.AvailableISize() - borderPaddingISize);
|
return std::max(0, aReflowInput.AvailableISize() - borderPaddingISize);
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
nsColumnSetFrame::GetAvailableContentBSize(const ReflowInput& aReflowState)
|
nsColumnSetFrame::GetAvailableContentBSize(const ReflowInput& aReflowInput)
|
||||||
{
|
{
|
||||||
if (aReflowState.AvailableBSize() == NS_INTRINSICSIZE) {
|
if (aReflowInput.AvailableBSize() == NS_INTRINSICSIZE) {
|
||||||
return NS_INTRINSICSIZE;
|
return NS_INTRINSICSIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
LogicalMargin bp = aReflowState.ComputedLogicalBorderPadding();
|
LogicalMargin bp = aReflowInput.ComputedLogicalBorderPadding();
|
||||||
bp.ApplySkipSides(GetLogicalSkipSides(&aReflowState));
|
bp.ApplySkipSides(GetLogicalSkipSides(&aReflowInput));
|
||||||
bp.BEnd(wm) = aReflowState.ComputedLogicalBorderPadding().BEnd(wm);
|
bp.BEnd(wm) = aReflowInput.ComputedLogicalBorderPadding().BEnd(wm);
|
||||||
return std::max(0, aReflowState.AvailableBSize() - bp.BStartEnd(wm));
|
return std::max(0, aReflowInput.AvailableBSize() - bp.BStartEnd(wm));
|
||||||
}
|
}
|
||||||
|
|
||||||
static nscoord
|
static nscoord
|
||||||
@@ -198,7 +198,7 @@ GetColumnGap(nsColumnSetFrame* aFrame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsColumnSetFrame::ReflowConfig
|
nsColumnSetFrame::ReflowConfig
|
||||||
nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowState,
|
nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowInput,
|
||||||
bool aForceAuto = false,
|
bool aForceAuto = false,
|
||||||
nscoord aFeasibleBSize = NS_INTRINSICSIZE,
|
nscoord aFeasibleBSize = NS_INTRINSICSIZE,
|
||||||
nscoord aInfeasibleBSize = 0)
|
nscoord aInfeasibleBSize = 0)
|
||||||
@@ -207,9 +207,9 @@ nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowState,
|
|||||||
nscoord knownInfeasibleBSize = aInfeasibleBSize;
|
nscoord knownInfeasibleBSize = aInfeasibleBSize;
|
||||||
|
|
||||||
const nsStyleColumn* colStyle = StyleColumn();
|
const nsStyleColumn* colStyle = StyleColumn();
|
||||||
nscoord availContentISize = GetAvailableContentISize(aReflowState);
|
nscoord availContentISize = GetAvailableContentISize(aReflowInput);
|
||||||
if (aReflowState.ComputedISize() != NS_INTRINSICSIZE) {
|
if (aReflowInput.ComputedISize() != NS_INTRINSICSIZE) {
|
||||||
availContentISize = aReflowState.ComputedISize();
|
availContentISize = aReflowInput.ComputedISize();
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord consumedBSize = GetConsumedBSize();
|
nscoord consumedBSize = GetConsumedBSize();
|
||||||
@@ -217,14 +217,14 @@ nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowState,
|
|||||||
// The effective computed height is the height of the current continuation
|
// The effective computed height is the height of the current continuation
|
||||||
// of the column set frame. This should be the same as the computed height
|
// of the column set frame. This should be the same as the computed height
|
||||||
// if we have an unconstrained available height.
|
// if we have an unconstrained available height.
|
||||||
nscoord computedBSize = GetEffectiveComputedBSize(aReflowState,
|
nscoord computedBSize = GetEffectiveComputedBSize(aReflowInput,
|
||||||
consumedBSize);
|
consumedBSize);
|
||||||
nscoord colBSize = GetAvailableContentBSize(aReflowState);
|
nscoord colBSize = GetAvailableContentBSize(aReflowInput);
|
||||||
|
|
||||||
if (aReflowState.ComputedBSize() != NS_INTRINSICSIZE) {
|
if (aReflowInput.ComputedBSize() != NS_INTRINSICSIZE) {
|
||||||
colBSize = aReflowState.ComputedBSize();
|
colBSize = aReflowInput.ComputedBSize();
|
||||||
} else if (aReflowState.ComputedMaxBSize() != NS_INTRINSICSIZE) {
|
} else if (aReflowInput.ComputedMaxBSize() != NS_INTRINSICSIZE) {
|
||||||
colBSize = std::min(colBSize, aReflowState.ComputedMaxBSize());
|
colBSize = std::min(colBSize, aReflowInput.ComputedMaxBSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord colGap = GetColumnGap(this, colStyle);
|
nscoord colGap = GetColumnGap(this, colStyle);
|
||||||
@@ -236,8 +236,8 @@ nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowState,
|
|||||||
if (isBalancing) {
|
if (isBalancing) {
|
||||||
const uint32_t MAX_NESTED_COLUMN_BALANCING = 2;
|
const uint32_t MAX_NESTED_COLUMN_BALANCING = 2;
|
||||||
uint32_t cnt = 0;
|
uint32_t cnt = 0;
|
||||||
for (const ReflowInput* rs = aReflowState.mParentReflowState;
|
for (const ReflowInput* rs = aReflowInput.mParentReflowInput;
|
||||||
rs && cnt < MAX_NESTED_COLUMN_BALANCING; rs = rs->mParentReflowState) {
|
rs && cnt < MAX_NESTED_COLUMN_BALANCING; rs = rs->mParentReflowInput) {
|
||||||
if (rs->mFlags.mIsColumnBalancing) {
|
if (rs->mFlags.mIsColumnBalancing) {
|
||||||
++cnt;
|
++cnt;
|
||||||
}
|
}
|
||||||
@@ -343,24 +343,24 @@ nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowState,
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
nsColumnSetFrame::ReflowColumns(ReflowOutput& aDesiredSize,
|
nsColumnSetFrame::ReflowColumns(ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aReflowStatus,
|
nsReflowStatus& aReflowStatus,
|
||||||
ReflowConfig& aConfig,
|
ReflowConfig& aConfig,
|
||||||
bool aLastColumnUnbounded,
|
bool aLastColumnUnbounded,
|
||||||
nsCollapsingMargin* aCarriedOutBEndMargin,
|
nsCollapsingMargin* aCarriedOutBEndMargin,
|
||||||
ColumnBalanceData& aColData)
|
ColumnBalanceData& aColData)
|
||||||
{
|
{
|
||||||
bool feasible = ReflowChildren(aDesiredSize, aReflowState,
|
bool feasible = ReflowChildren(aDesiredSize, aReflowInput,
|
||||||
aReflowStatus, aConfig, aLastColumnUnbounded,
|
aReflowStatus, aConfig, aLastColumnUnbounded,
|
||||||
aCarriedOutBEndMargin, aColData);
|
aCarriedOutBEndMargin, aColData);
|
||||||
|
|
||||||
if (aColData.mHasExcessBSize) {
|
if (aColData.mHasExcessBSize) {
|
||||||
aConfig = ChooseColumnStrategy(aReflowState, true);
|
aConfig = ChooseColumnStrategy(aReflowInput, true);
|
||||||
|
|
||||||
// We need to reflow our children again one last time, otherwise we might
|
// We need to reflow our children again one last time, otherwise we might
|
||||||
// end up with a stale column height for some of our columns, since we
|
// end up with a stale column height for some of our columns, since we
|
||||||
// bailed out of balancing.
|
// bailed out of balancing.
|
||||||
feasible = ReflowChildren(aDesiredSize, aReflowState, aReflowStatus,
|
feasible = ReflowChildren(aDesiredSize, aReflowInput, aReflowStatus,
|
||||||
aConfig, aLastColumnUnbounded,
|
aConfig, aLastColumnUnbounded,
|
||||||
aCarriedOutBEndMargin, aColData);
|
aCarriedOutBEndMargin, aColData);
|
||||||
}
|
}
|
||||||
@@ -450,7 +450,7 @@ nsColumnSetFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
const ReflowConfig& aConfig,
|
const ReflowConfig& aConfig,
|
||||||
bool aUnboundedLastColumn,
|
bool aUnboundedLastColumn,
|
||||||
@@ -488,8 +488,8 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get our border and padding
|
// get our border and padding
|
||||||
LogicalMargin borderPadding = aReflowState.ComputedLogicalBorderPadding();
|
LogicalMargin borderPadding = aReflowInput.ComputedLogicalBorderPadding();
|
||||||
borderPadding.ApplySkipSides(GetLogicalSkipSides(&aReflowState));
|
borderPadding.ApplySkipSides(GetLogicalSkipSides(&aReflowInput));
|
||||||
|
|
||||||
nsRect contentRect(0, 0, 0, 0);
|
nsRect contentRect(0, 0, 0, 0);
|
||||||
nsOverflowAreas overflowRects;
|
nsOverflowAreas overflowRects;
|
||||||
@@ -498,10 +498,10 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||||||
LogicalPoint childOrigin(wm, borderPadding.IStart(wm),
|
LogicalPoint childOrigin(wm, borderPadding.IStart(wm),
|
||||||
borderPadding.BStart(wm));
|
borderPadding.BStart(wm));
|
||||||
// In vertical-rl mode, columns will not be correctly placed if the
|
// In vertical-rl mode, columns will not be correctly placed if the
|
||||||
// reflowState's ComputedWidth() is UNCONSTRAINED (in which case we'll get
|
// reflowInput's ComputedWidth() is UNCONSTRAINED (in which case we'll get
|
||||||
// a containerSize.width of zero here). In that case, the column positions
|
// a containerSize.width of zero here). In that case, the column positions
|
||||||
// will be adjusted later, after our correct contentSize is known.
|
// will be adjusted later, after our correct contentSize is known.
|
||||||
nsSize containerSize = aReflowState.ComputedSizeAsContainerIfConstrained();
|
nsSize containerSize = aReflowInput.ComputedSizeAsContainerIfConstrained();
|
||||||
|
|
||||||
// For RTL, since the columns might not fill the frame exactly, we
|
// For RTL, since the columns might not fill the frame exactly, we
|
||||||
// need to account for the slop. Otherwise we'll waste time moving the
|
// need to account for the slop. Otherwise we'll waste time moving the
|
||||||
@@ -511,9 +511,9 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||||||
// probably won't need to do this hack any more. For now, we
|
// probably won't need to do this hack any more. For now, we
|
||||||
// confine it to the legacy horizontal-rl case
|
// confine it to the legacy horizontal-rl case
|
||||||
if (!isVertical && isRTL) {
|
if (!isVertical && isRTL) {
|
||||||
nscoord availISize = aReflowState.AvailableISize();
|
nscoord availISize = aReflowInput.AvailableISize();
|
||||||
if (aReflowState.ComputedISize() != NS_INTRINSICSIZE) {
|
if (aReflowInput.ComputedISize() != NS_INTRINSICSIZE) {
|
||||||
availISize = aReflowState.ComputedISize();
|
availISize = aReflowInput.ComputedISize();
|
||||||
}
|
}
|
||||||
if (availISize != NS_INTRINSICSIZE) {
|
if (availISize != NS_INTRINSICSIZE) {
|
||||||
childOrigin.I(wm) = containerSize.width - borderPadding.Left(wm) -
|
childOrigin.I(wm) = containerSize.width - borderPadding.Left(wm) -
|
||||||
@@ -539,7 +539,7 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||||||
// content from its next sibling. (Note that it might be the last
|
// content from its next sibling. (Note that it might be the last
|
||||||
// column, but not be the last child because the desired number of columns
|
// column, but not be the last child because the desired number of columns
|
||||||
// has changed.)
|
// has changed.)
|
||||||
bool skipIncremental = !aReflowState.ShouldReflowAllKids()
|
bool skipIncremental = !aReflowInput.ShouldReflowAllKids()
|
||||||
&& !NS_SUBTREE_DIRTY(child)
|
&& !NS_SUBTREE_DIRTY(child)
|
||||||
&& child->GetNextSibling()
|
&& child->GetNextSibling()
|
||||||
&& !(aUnboundedLastColumn && columnCount == aConfig.mBalanceColCount - 1)
|
&& !(aUnboundedLastColumn && columnCount == aConfig.mBalanceColCount - 1)
|
||||||
@@ -597,24 +597,24 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||||||
} else {
|
} else {
|
||||||
LogicalSize availSize(wm, aConfig.mColISize, aConfig.mColMaxBSize);
|
LogicalSize availSize(wm, aConfig.mColISize, aConfig.mColMaxBSize);
|
||||||
if (aUnboundedLastColumn && columnCount == aConfig.mBalanceColCount - 1) {
|
if (aUnboundedLastColumn && columnCount == aConfig.mBalanceColCount - 1) {
|
||||||
availSize.BSize(wm) = GetAvailableContentBSize(aReflowState);
|
availSize.BSize(wm) = GetAvailableContentBSize(aReflowInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalSize computedSize = aReflowState.ComputedSize(wm);
|
LogicalSize computedSize = aReflowInput.ComputedSize(wm);
|
||||||
|
|
||||||
if (reflowNext)
|
if (reflowNext)
|
||||||
child->AddStateBits(NS_FRAME_IS_DIRTY);
|
child->AddStateBits(NS_FRAME_IS_DIRTY);
|
||||||
|
|
||||||
LogicalSize kidCBSize(wm, availSize.ISize(wm), computedSize.BSize(wm));
|
LogicalSize kidCBSize(wm, availSize.ISize(wm), computedSize.BSize(wm));
|
||||||
ReflowInput kidReflowState(PresContext(), aReflowState, child,
|
ReflowInput kidReflowInput(PresContext(), aReflowInput, child,
|
||||||
availSize, &kidCBSize);
|
availSize, &kidCBSize);
|
||||||
kidReflowState.mFlags.mIsTopOfPage = true;
|
kidReflowInput.mFlags.mIsTopOfPage = true;
|
||||||
kidReflowState.mFlags.mTableIsSplittable = false;
|
kidReflowInput.mFlags.mTableIsSplittable = false;
|
||||||
kidReflowState.mFlags.mIsColumnBalancing = aConfig.mBalanceColCount < INT32_MAX;
|
kidReflowInput.mFlags.mIsColumnBalancing = aConfig.mBalanceColCount < INT32_MAX;
|
||||||
|
|
||||||
// We need to reflow any float placeholders, even if our column height
|
// We need to reflow any float placeholders, even if our column height
|
||||||
// hasn't changed.
|
// hasn't changed.
|
||||||
kidReflowState.mFlags.mMustReflowPlaceholders = !colBSizeChanged;
|
kidReflowInput.mFlags.mMustReflowPlaceholders = !colBSizeChanged;
|
||||||
|
|
||||||
#ifdef DEBUG_roc
|
#ifdef DEBUG_roc
|
||||||
printf("*** Reflowing child #%d %p: availHeight=%d\n",
|
printf("*** Reflowing child #%d %p: availHeight=%d\n",
|
||||||
@@ -626,7 +626,7 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||||||
if (child->GetNextSibling() &&
|
if (child->GetNextSibling() &&
|
||||||
!(GetStateBits() & NS_FRAME_IS_DIRTY) &&
|
!(GetStateBits() & NS_FRAME_IS_DIRTY) &&
|
||||||
!(child->GetNextSibling()->GetStateBits() & NS_FRAME_IS_DIRTY)) {
|
!(child->GetNextSibling()->GetStateBits() & NS_FRAME_IS_DIRTY)) {
|
||||||
kidReflowState.mFlags.mNextInFlowUntouched = true;
|
kidReflowInput.mFlags.mNextInFlowUntouched = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReflowOutput kidDesiredSize(wm, aDesiredSize.mFlags);
|
ReflowOutput kidDesiredSize(wm, aDesiredSize.mFlags);
|
||||||
@@ -641,10 +641,10 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||||||
// Reflow the frame
|
// Reflow the frame
|
||||||
LogicalPoint origin(wm,
|
LogicalPoint origin(wm,
|
||||||
childOrigin.I(wm) +
|
childOrigin.I(wm) +
|
||||||
kidReflowState.ComputedLogicalMargin().IStart(wm),
|
kidReflowInput.ComputedLogicalMargin().IStart(wm),
|
||||||
childOrigin.B(wm) +
|
childOrigin.B(wm) +
|
||||||
kidReflowState.ComputedLogicalMargin().BStart(wm));
|
kidReflowInput.ComputedLogicalMargin().BStart(wm));
|
||||||
ReflowChild(child, PresContext(), kidDesiredSize, kidReflowState,
|
ReflowChild(child, PresContext(), kidDesiredSize, kidReflowInput,
|
||||||
wm, origin, containerSize, 0, aStatus);
|
wm, origin, containerSize, 0, aStatus);
|
||||||
|
|
||||||
reflowNext = (aStatus & NS_FRAME_REFLOW_NEXTINFLOW) != 0;
|
reflowNext = (aStatus & NS_FRAME_REFLOW_NEXTINFLOW) != 0;
|
||||||
@@ -660,7 +660,7 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||||||
*aCarriedOutBEndMargin = kidDesiredSize.mCarriedOutBEndMargin;
|
*aCarriedOutBEndMargin = kidDesiredSize.mCarriedOutBEndMargin;
|
||||||
|
|
||||||
FinishReflowChild(child, PresContext(), kidDesiredSize,
|
FinishReflowChild(child, PresContext(), kidDesiredSize,
|
||||||
&kidReflowState, wm, childOrigin, containerSize, 0);
|
&kidReflowInput, wm, childOrigin, containerSize, 0);
|
||||||
|
|
||||||
childContentBEnd = nsLayoutUtils::CalculateContentBEnd(wm, child);
|
childContentBEnd = nsLayoutUtils::CalculateContentBEnd(wm, child);
|
||||||
if (childContentBEnd > aConfig.mColMaxBSize) {
|
if (childContentBEnd > aConfig.mColMaxBSize) {
|
||||||
@@ -715,8 +715,8 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||||||
kidNextInFlow->RemoveStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);
|
kidNextInFlow->RemoveStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((contentBEnd > aReflowState.ComputedMaxBSize() ||
|
if ((contentBEnd > aReflowInput.ComputedMaxBSize() ||
|
||||||
contentBEnd > aReflowState.ComputedBSize()) &&
|
contentBEnd > aReflowInput.ComputedBSize()) &&
|
||||||
aConfig.mBalanceColCount < INT32_MAX) {
|
aConfig.mBalanceColCount < INT32_MAX) {
|
||||||
// We overflowed vertically, but have not exceeded the number of
|
// We overflowed vertically, but have not exceeded the number of
|
||||||
// columns. We're going to go into overflow columns now, so balancing
|
// columns. We're going to go into overflow columns now, so balancing
|
||||||
@@ -783,7 +783,7 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||||||
|
|
||||||
// Apply computed and min/max values
|
// Apply computed and min/max values
|
||||||
if (aConfig.mComputedBSize != NS_INTRINSICSIZE) {
|
if (aConfig.mComputedBSize != NS_INTRINSICSIZE) {
|
||||||
if (aReflowState.AvailableBSize() != NS_INTRINSICSIZE) {
|
if (aReflowInput.AvailableBSize() != NS_INTRINSICSIZE) {
|
||||||
contentSize.BSize(wm) = std::min(contentSize.BSize(wm),
|
contentSize.BSize(wm) = std::min(contentSize.BSize(wm),
|
||||||
aConfig.mComputedBSize);
|
aConfig.mComputedBSize);
|
||||||
} else {
|
} else {
|
||||||
@@ -796,14 +796,14 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
|
|||||||
// having a last continuation that is smaller than the min bSize. but which
|
// having a last continuation that is smaller than the min bSize. but which
|
||||||
// has prev-in-flows, trigger a larger bSize than actually required.
|
// has prev-in-flows, trigger a larger bSize than actually required.
|
||||||
contentSize.BSize(wm) =
|
contentSize.BSize(wm) =
|
||||||
aReflowState.ApplyMinMaxBSize(contentSize.BSize(wm),
|
aReflowInput.ApplyMinMaxBSize(contentSize.BSize(wm),
|
||||||
aConfig.mConsumedBSize);
|
aConfig.mConsumedBSize);
|
||||||
}
|
}
|
||||||
if (aReflowState.ComputedISize() != NS_INTRINSICSIZE) {
|
if (aReflowInput.ComputedISize() != NS_INTRINSICSIZE) {
|
||||||
contentSize.ISize(wm) = aReflowState.ComputedISize();
|
contentSize.ISize(wm) = aReflowInput.ComputedISize();
|
||||||
} else {
|
} else {
|
||||||
contentSize.ISize(wm) =
|
contentSize.ISize(wm) =
|
||||||
aReflowState.ApplyMinMaxISize(contentSize.ISize(wm));
|
aReflowInput.ApplyMinMaxISize(contentSize.ISize(wm));
|
||||||
}
|
}
|
||||||
|
|
||||||
contentSize.ISize(wm) += borderPadding.IStartEnd(wm);
|
contentSize.ISize(wm) += borderPadding.IStartEnd(wm);
|
||||||
@@ -861,7 +861,7 @@ nsColumnSetFrame::DrainOverflowColumns()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowState,
|
nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowInput,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
ReflowConfig& aConfig,
|
ReflowConfig& aConfig,
|
||||||
ColumnBalanceData& aColData,
|
ColumnBalanceData& aColData,
|
||||||
@@ -873,12 +873,12 @@ nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowState,
|
|||||||
{
|
{
|
||||||
bool feasible = aRunWasFeasible;
|
bool feasible = aRunWasFeasible;
|
||||||
|
|
||||||
nsMargin bp = aReflowState.ComputedPhysicalBorderPadding();
|
nsMargin bp = aReflowInput.ComputedPhysicalBorderPadding();
|
||||||
bp.ApplySkipSides(GetSkipSides());
|
bp.ApplySkipSides(GetSkipSides());
|
||||||
bp.bottom = aReflowState.ComputedPhysicalBorderPadding().bottom;
|
bp.bottom = aReflowInput.ComputedPhysicalBorderPadding().bottom;
|
||||||
|
|
||||||
nscoord availableContentBSize =
|
nscoord availableContentBSize =
|
||||||
GetAvailableContentBSize(aReflowState);
|
GetAvailableContentBSize(aReflowInput);
|
||||||
|
|
||||||
// Termination of the algorithm below is guaranteed because
|
// Termination of the algorithm below is guaranteed because
|
||||||
// aConfig.knownFeasibleBSize - aConfig.knownInfeasibleBSize decreases in every
|
// aConfig.knownFeasibleBSize - aConfig.knownInfeasibleBSize decreases in every
|
||||||
@@ -980,7 +980,7 @@ nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowState,
|
|||||||
|
|
||||||
aUnboundedLastColumn = false;
|
aUnboundedLastColumn = false;
|
||||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||||
feasible = ReflowColumns(aDesiredSize, aReflowState, aStatus, aConfig, false,
|
feasible = ReflowColumns(aDesiredSize, aReflowInput, aStatus, aConfig, false,
|
||||||
&aOutMargin, aColData);
|
&aOutMargin, aColData);
|
||||||
|
|
||||||
if (!aConfig.mIsBalancing) {
|
if (!aConfig.mIsBalancing) {
|
||||||
@@ -1009,7 +1009,7 @@ nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowState,
|
|||||||
// Otherwise we'd have to split, and it's not clear what we'd do with
|
// Otherwise we'd have to split, and it's not clear what we'd do with
|
||||||
// that.
|
// that.
|
||||||
AddStateBits(NS_FRAME_IS_DIRTY);
|
AddStateBits(NS_FRAME_IS_DIRTY);
|
||||||
feasible = ReflowColumns(aDesiredSize, aReflowState, aStatus, aConfig,
|
feasible = ReflowColumns(aDesiredSize, aReflowInput, aStatus, aConfig,
|
||||||
availableContentBSize == NS_UNCONSTRAINEDSIZE,
|
availableContentBSize == NS_UNCONSTRAINEDSIZE,
|
||||||
&aOutMargin, aColData);
|
&aOutMargin, aColData);
|
||||||
}
|
}
|
||||||
@@ -1021,7 +1021,7 @@ nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowState,
|
|||||||
void
|
void
|
||||||
nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
@@ -1029,13 +1029,13 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsPresContext::InterruptPreventer noInterrupts(aPresContext);
|
nsPresContext::InterruptPreventer noInterrupts(aPresContext);
|
||||||
|
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsColumnSetFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsColumnSetFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
// Initialize OUT parameter
|
// Initialize OUT parameter
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// Our children depend on our block-size if we have a fixed block-size.
|
// Our children depend on our block-size if we have a fixed block-size.
|
||||||
if (aReflowState.ComputedBSize() != NS_AUTOHEIGHT) {
|
if (aReflowInput.ComputedBSize() != NS_AUTOHEIGHT) {
|
||||||
AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
|
AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
|
||||||
} else {
|
} else {
|
||||||
RemoveStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
|
RemoveStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
|
||||||
@@ -1055,7 +1055,7 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsOverflowAreas ocBounds;
|
nsOverflowAreas ocBounds;
|
||||||
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
|
||||||
if (GetPrevInFlow()) {
|
if (GetPrevInFlow()) {
|
||||||
ReflowOverflowContainerChildren(aPresContext, aReflowState, ocBounds, 0,
|
ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0,
|
||||||
ocStatus);
|
ocStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1066,8 +1066,8 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// happens in orthogonal flows where the inline direction is the
|
// happens in orthogonal flows where the inline direction is the
|
||||||
// container's block direction).
|
// container's block direction).
|
||||||
ReflowConfig config =
|
ReflowConfig config =
|
||||||
ChooseColumnStrategy(aReflowState,
|
ChooseColumnStrategy(aReflowInput,
|
||||||
aReflowState.ComputedISize() == NS_UNCONSTRAINEDSIZE);
|
aReflowInput.ComputedISize() == NS_UNCONSTRAINEDSIZE);
|
||||||
|
|
||||||
// If balancing, then we allow the last column to grow to unbounded
|
// If balancing, then we allow the last column to grow to unbounded
|
||||||
// height during the first reflow. This gives us a way to estimate
|
// height during the first reflow. This gives us a way to estimate
|
||||||
@@ -1081,7 +1081,7 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
ColumnBalanceData colData;
|
ColumnBalanceData colData;
|
||||||
colData.mHasExcessBSize = false;
|
colData.mHasExcessBSize = false;
|
||||||
|
|
||||||
bool feasible = ReflowColumns(aDesiredSize, aReflowState, aStatus, config,
|
bool feasible = ReflowColumns(aDesiredSize, aReflowInput, aStatus, config,
|
||||||
unboundedLastColumn, &carriedOutBottomMargin,
|
unboundedLastColumn, &carriedOutBottomMargin,
|
||||||
colData);
|
colData);
|
||||||
|
|
||||||
@@ -1089,31 +1089,31 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// reflown all of our children, and there is no need for a binary search to
|
// reflown all of our children, and there is no need for a binary search to
|
||||||
// determine proper column height.
|
// determine proper column height.
|
||||||
if (config.mIsBalancing && !aPresContext->HasPendingInterrupt()) {
|
if (config.mIsBalancing && !aPresContext->HasPendingInterrupt()) {
|
||||||
FindBestBalanceBSize(aReflowState, aPresContext, config, colData,
|
FindBestBalanceBSize(aReflowInput, aPresContext, config, colData,
|
||||||
aDesiredSize, carriedOutBottomMargin,
|
aDesiredSize, carriedOutBottomMargin,
|
||||||
unboundedLastColumn, feasible, aStatus);
|
unboundedLastColumn, feasible, aStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aPresContext->HasPendingInterrupt() &&
|
if (aPresContext->HasPendingInterrupt() &&
|
||||||
aReflowState.AvailableBSize() == NS_UNCONSTRAINEDSIZE) {
|
aReflowInput.AvailableBSize() == NS_UNCONSTRAINEDSIZE) {
|
||||||
// In this situation, we might be lying about our reflow status, because
|
// In this situation, we might be lying about our reflow status, because
|
||||||
// our last kid (the one that got interrupted) was incomplete. Fix that.
|
// our last kid (the one that got interrupted) was incomplete. Fix that.
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_ASSERTION(NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
|
NS_ASSERTION(NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
|
||||||
aReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
|
aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
|
||||||
"Column set should be complete if the available block-size is unconstrained");
|
"Column set should be complete if the available block-size is unconstrained");
|
||||||
|
|
||||||
// Merge overflow container bounds and status.
|
// Merge overflow container bounds and status.
|
||||||
aDesiredSize.mOverflowAreas.UnionWith(ocBounds);
|
aDesiredSize.mOverflowAreas.UnionWith(ocBounds);
|
||||||
NS_MergeReflowStatusInto(&aStatus, ocStatus);
|
NS_MergeReflowStatusInto(&aStatus, ocStatus);
|
||||||
|
|
||||||
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus, false);
|
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus, false);
|
||||||
|
|
||||||
aDesiredSize.mCarriedOutBEndMargin = carriedOutBottomMargin;
|
aDesiredSize.mCarriedOutBEndMargin = carriedOutBottomMargin;
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
* Retrieve the available height for content of this frame. The available content
|
* Retrieve the available height for content of this frame. The available content
|
||||||
* height is the available height for the frame, minus borders and padding.
|
* height is the available height for the frame, minus borders and padding.
|
||||||
*/
|
*/
|
||||||
virtual nscoord GetAvailableContentBSize(const ReflowInput& aReflowState);
|
virtual nscoord GetAvailableContentBSize(const ReflowInput& aReflowInput);
|
||||||
|
|
||||||
virtual nsContainerFrame* GetContentInsertionFrame() override {
|
virtual nsContainerFrame* GetContentInsertionFrame() override {
|
||||||
nsIFrame* frame = PrincipalChildList().FirstChild();
|
nsIFrame* frame = PrincipalChildList().FirstChild();
|
||||||
@@ -162,7 +162,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool ReflowColumns(ReflowOutput& aDesiredSize,
|
bool ReflowColumns(ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aReflowStatus,
|
nsReflowStatus& aReflowStatus,
|
||||||
ReflowConfig& aConfig,
|
ReflowConfig& aConfig,
|
||||||
bool aLastColumnUnbounded,
|
bool aLastColumnUnbounded,
|
||||||
@@ -176,14 +176,14 @@ protected:
|
|||||||
* style. This function will also be responsible for implementing
|
* style. This function will also be responsible for implementing
|
||||||
* the state machine that controls column balancing.
|
* the state machine that controls column balancing.
|
||||||
*/
|
*/
|
||||||
ReflowConfig ChooseColumnStrategy(const ReflowInput& aReflowState,
|
ReflowConfig ChooseColumnStrategy(const ReflowInput& aReflowInput,
|
||||||
bool aForceAuto, nscoord aFeasibleBSize,
|
bool aForceAuto, nscoord aFeasibleBSize,
|
||||||
nscoord aInfeasibleBSize);
|
nscoord aInfeasibleBSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform the binary search for the best balance height for this column set.
|
* Perform the binary search for the best balance height for this column set.
|
||||||
*
|
*
|
||||||
* @param aReflowState The input parameters for the current reflow iteration.
|
* @param aReflowInput The input parameters for the current reflow iteration.
|
||||||
* @param aPresContext The presentation context in which the current reflow
|
* @param aPresContext The presentation context in which the current reflow
|
||||||
* iteration is occurring.
|
* iteration is occurring.
|
||||||
* @param aConfig The ReflowConfig object associated with this column set
|
* @param aConfig The ReflowConfig object associated with this column set
|
||||||
@@ -204,7 +204,7 @@ protected:
|
|||||||
* @param aStatus A final reflow status of the column set frame, passed in as
|
* @param aStatus A final reflow status of the column set frame, passed in as
|
||||||
* an output parameter.
|
* an output parameter.
|
||||||
*/
|
*/
|
||||||
void FindBestBalanceBSize(const ReflowInput& aReflowState,
|
void FindBestBalanceBSize(const ReflowInput& aReflowInput,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
ReflowConfig& aConfig,
|
ReflowConfig& aConfig,
|
||||||
ColumnBalanceData& aColData,
|
ColumnBalanceData& aColData,
|
||||||
@@ -218,7 +218,7 @@ protected:
|
|||||||
* fit into the mColMaxBSize.
|
* fit into the mColMaxBSize.
|
||||||
*/
|
*/
|
||||||
bool ReflowChildren(ReflowOutput& aDesiredSize,
|
bool ReflowChildren(ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
const ReflowConfig& aConfig,
|
const ReflowConfig& aConfig,
|
||||||
bool aLastColumnUnbounded,
|
bool aLastColumnUnbounded,
|
||||||
|
|||||||
@@ -995,7 +995,7 @@ void
|
|||||||
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
const WritingMode& aWM,
|
const WritingMode& aWM,
|
||||||
const LogicalPoint& aPos,
|
const LogicalPoint& aPos,
|
||||||
const nsSize& aContainerSize,
|
const nsSize& aContainerSize,
|
||||||
@@ -1003,7 +1003,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
|||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
nsOverflowContinuationTracker* aTracker)
|
nsOverflowContinuationTracker* aTracker)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(aReflowState.mFrame == aKidFrame, "bad reflow state");
|
NS_PRECONDITION(aReflowInput.mFrame == aKidFrame, "bad reflow state");
|
||||||
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,
|
||||||
"ReflowChild with unconstrained container width!");
|
"ReflowChild with unconstrained container width!");
|
||||||
@@ -1019,7 +1019,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reflow the child frame
|
// Reflow the child frame
|
||||||
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, 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 NO_DELETE_NEXT_IN_FLOW flag isn't set.
|
||||||
@@ -1043,14 +1043,14 @@ void
|
|||||||
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nscoord aX,
|
nscoord aX,
|
||||||
nscoord aY,
|
nscoord aY,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
nsOverflowContinuationTracker* aTracker)
|
nsOverflowContinuationTracker* aTracker)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(aReflowState.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 (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
|
||||||
@@ -1062,7 +1062,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reflow the child frame
|
// Reflow the child frame
|
||||||
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, 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 NO_DELETE_NEXT_IN_FLOW flag isn't set.
|
||||||
@@ -1136,7 +1136,7 @@ void
|
|||||||
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowOutput& aDesiredSize,
|
const ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
const WritingMode& aWM,
|
const WritingMode& aWM,
|
||||||
const LogicalPoint& aPos,
|
const LogicalPoint& aPos,
|
||||||
const nsSize& aContainerSize,
|
const nsSize& aContainerSize,
|
||||||
@@ -1176,7 +1176,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aKidFrame->DidReflow(aPresContext, aReflowState, nsDidReflowStatus::FINISHED);
|
aKidFrame->DidReflow(aPresContext, aReflowInput, nsDidReflowStatus::FINISHED);
|
||||||
}
|
}
|
||||||
|
|
||||||
//XXX temporary: hold on to a copy of the old physical version of
|
//XXX temporary: hold on to a copy of the old physical version of
|
||||||
@@ -1185,7 +1185,7 @@ void
|
|||||||
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowOutput& aDesiredSize,
|
const ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
nscoord aX,
|
nscoord aX,
|
||||||
nscoord aY,
|
nscoord aY,
|
||||||
uint32_t aFlags)
|
uint32_t aFlags)
|
||||||
@@ -1215,12 +1215,12 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aKidFrame->DidReflow(aPresContext, aReflowState, nsDidReflowStatus::FINISHED);
|
aKidFrame->DidReflow(aPresContext, aReflowInput, nsDidReflowStatus::FINISHED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPresContext,
|
nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsOverflowAreas& aOverflowRects,
|
nsOverflowAreas& aOverflowRects,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
@@ -1234,7 +1234,7 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsOverflowContinuationTracker tracker(this, false, false);
|
nsOverflowContinuationTracker tracker(this, false, false);
|
||||||
bool shouldReflowAllKids = aReflowState.ShouldReflowAllKids();
|
bool shouldReflowAllKids = aReflowInput.ShouldReflowAllKids();
|
||||||
|
|
||||||
for (nsIFrame* frame : *overflowContainers) {
|
for (nsIFrame* frame : *overflowContainers) {
|
||||||
if (frame->GetPrevInFlow()->GetParent() != GetPrevInFlow()) {
|
if (frame->GetPrevInFlow()->GetParent() != GetPrevInFlow()) {
|
||||||
@@ -1252,14 +1252,14 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
|||||||
NS_ASSERTION(frame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER,
|
NS_ASSERTION(frame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER,
|
||||||
"overflow container frame must have overflow container bit set");
|
"overflow container frame must have overflow container bit set");
|
||||||
WritingMode wm = frame->GetWritingMode();
|
WritingMode wm = frame->GetWritingMode();
|
||||||
nsSize containerSize = aReflowState.AvailableSize(wm).GetPhysicalSize(wm);
|
nsSize containerSize = aReflowInput.AvailableSize(wm).GetPhysicalSize(wm);
|
||||||
LogicalRect prevRect = prevInFlow->GetLogicalRect(wm, containerSize);
|
LogicalRect prevRect = prevInFlow->GetLogicalRect(wm, containerSize);
|
||||||
|
|
||||||
// Initialize reflow params
|
// Initialize reflow params
|
||||||
LogicalSize availSpace(wm, prevRect.ISize(wm),
|
LogicalSize availSpace(wm, prevRect.ISize(wm),
|
||||||
aReflowState.AvailableSize(wm).BSize(wm));
|
aReflowInput.AvailableSize(wm).BSize(wm));
|
||||||
ReflowOutput desiredSize(aReflowState);
|
ReflowOutput desiredSize(aReflowInput);
|
||||||
ReflowInput frameState(aPresContext, aReflowState,
|
ReflowInput frameState(aPresContext, aReflowInput,
|
||||||
frame, availSpace);
|
frame, availSpace);
|
||||||
nsReflowStatus frameStatus;
|
nsReflowStatus frameStatus;
|
||||||
|
|
||||||
@@ -1309,10 +1309,10 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tracker.Skip(frame, aStatus);
|
tracker.Skip(frame, aStatus);
|
||||||
if (aReflowState.mFloatManager) {
|
if (aReflowInput.mFloatManager) {
|
||||||
nsBlockFrame::RecoverFloatsFor(frame, *aReflowState.mFloatManager,
|
nsBlockFrame::RecoverFloatsFor(frame, *aReflowInput.mFloatManager,
|
||||||
aReflowState.GetWritingMode(),
|
aReflowInput.GetWritingMode(),
|
||||||
aReflowState.ComputedPhysicalSize());
|
aReflowInput.ComputedPhysicalSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ConsiderChildOverflow(aOverflowRects, frame);
|
ConsiderChildOverflow(aOverflowRects, frame);
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ public:
|
|||||||
void ReflowChild(nsIFrame* aChildFrame,
|
void ReflowChild(nsIFrame* aChildFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
const mozilla::WritingMode& aWM,
|
const mozilla::WritingMode& aWM,
|
||||||
const mozilla::LogicalPoint& aPos,
|
const mozilla::LogicalPoint& aPos,
|
||||||
const nsSize& aContainerSize,
|
const nsSize& aContainerSize,
|
||||||
@@ -285,7 +285,7 @@ public:
|
|||||||
static void FinishReflowChild(nsIFrame* aKidFrame,
|
static void FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowOutput& aDesiredSize,
|
const ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
const mozilla::WritingMode& aWM,
|
const mozilla::WritingMode& aWM,
|
||||||
const mozilla::LogicalPoint& aPos,
|
const mozilla::LogicalPoint& aPos,
|
||||||
const nsSize& aContainerSize,
|
const nsSize& aContainerSize,
|
||||||
@@ -297,7 +297,7 @@ public:
|
|||||||
void ReflowChild(nsIFrame* aKidFrame,
|
void ReflowChild(nsIFrame* aKidFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nscoord aX,
|
nscoord aX,
|
||||||
nscoord aY,
|
nscoord aY,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags,
|
||||||
@@ -307,7 +307,7 @@ public:
|
|||||||
static void FinishReflowChild(nsIFrame* aKidFrame,
|
static void FinishReflowChild(nsIFrame* aKidFrame,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowOutput& aDesiredSize,
|
const ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
nscoord aX,
|
nscoord aX,
|
||||||
nscoord aY,
|
nscoord aY,
|
||||||
uint32_t aFlags);
|
uint32_t aFlags);
|
||||||
@@ -388,7 +388,7 @@ public:
|
|||||||
* @param aMergeFunc is passed to DrainExcessOverflowContainersList
|
* @param aMergeFunc is passed to DrainExcessOverflowContainersList
|
||||||
*/
|
*/
|
||||||
void ReflowOverflowContainerChildren(nsPresContext* aPresContext,
|
void ReflowOverflowContainerChildren(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsOverflowAreas& aOverflowRects,
|
nsOverflowAreas& aOverflowRects,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
|
|||||||
@@ -164,12 +164,12 @@ nsFirstLetterFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
|||||||
void
|
void
|
||||||
nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aReflowStatus)
|
nsReflowStatus& aReflowStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsFirstLetterFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsFirstLetterFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aReflowStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aReflowStatus);
|
||||||
|
|
||||||
// Grab overflow list
|
// Grab overflow list
|
||||||
DrainOverflowFrames(aPresContext);
|
DrainOverflowFrames(aPresContext);
|
||||||
@@ -177,9 +177,9 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsIFrame* kid = mFrames.FirstChild();
|
nsIFrame* kid = mFrames.FirstChild();
|
||||||
|
|
||||||
// Setup reflow state for our child
|
// Setup reflow state for our child
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.AvailableSize();
|
LogicalSize availSize = aReflowInput.AvailableSize();
|
||||||
const LogicalMargin& bp = aReflowState.ComputedLogicalBorderPadding();
|
const LogicalMargin& bp = aReflowInput.ComputedLogicalBorderPadding();
|
||||||
NS_ASSERTION(availSize.ISize(wm) != NS_UNCONSTRAINEDSIZE,
|
NS_ASSERTION(availSize.ISize(wm) != NS_UNCONSTRAINEDSIZE,
|
||||||
"should no longer use unconstrained inline size");
|
"should no longer use unconstrained inline size");
|
||||||
availSize.ISize(wm) -= bp.IStartEnd(wm);
|
availSize.ISize(wm) -= bp.IStartEnd(wm);
|
||||||
@@ -191,20 +191,20 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
ReflowOutput kidMetrics(lineWM);
|
ReflowOutput kidMetrics(lineWM);
|
||||||
|
|
||||||
// Reflow the child
|
// Reflow the child
|
||||||
if (!aReflowState.mLineLayout) {
|
if (!aReflowInput.mLineLayout) {
|
||||||
// When there is no lineLayout provided, we provide our own. The
|
// When there is no lineLayout provided, we provide our own. The
|
||||||
// only time that the first-letter-frame is not reflowing in a
|
// only time that the first-letter-frame is not reflowing in a
|
||||||
// line context is when its floating.
|
// line context is when its floating.
|
||||||
WritingMode kidWritingMode = GetWritingMode(kid);
|
WritingMode kidWritingMode = GetWritingMode(kid);
|
||||||
LogicalSize kidAvailSize = availSize.ConvertTo(kidWritingMode, wm);
|
LogicalSize kidAvailSize = availSize.ConvertTo(kidWritingMode, wm);
|
||||||
ReflowInput rs(aPresContext, aReflowState, kid, kidAvailSize);
|
ReflowInput rs(aPresContext, aReflowInput, kid, kidAvailSize);
|
||||||
nsLineLayout ll(aPresContext, nullptr, &aReflowState, nullptr, nullptr);
|
nsLineLayout ll(aPresContext, nullptr, &aReflowInput, nullptr, nullptr);
|
||||||
|
|
||||||
ll.BeginLineReflow(bp.IStart(wm), bp.BStart(wm),
|
ll.BeginLineReflow(bp.IStart(wm), bp.BStart(wm),
|
||||||
availSize.ISize(wm), NS_UNCONSTRAINEDSIZE,
|
availSize.ISize(wm), NS_UNCONSTRAINEDSIZE,
|
||||||
false, true, kidWritingMode,
|
false, true, kidWritingMode,
|
||||||
nsSize(aReflowState.AvailableWidth(),
|
nsSize(aReflowInput.AvailableWidth(),
|
||||||
aReflowState.AvailableHeight()));
|
aReflowInput.AvailableHeight()));
|
||||||
rs.mLineLayout = ≪
|
rs.mLineLayout = ≪
|
||||||
ll.SetInFirstLetter(true);
|
ll.SetInFirstLetter(true);
|
||||||
ll.SetFirstLetterStyleOK(true);
|
ll.SetFirstLetterStyleOK(true);
|
||||||
@@ -242,12 +242,12 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Pretend we are a span and reflow the child frame
|
// Pretend we are a span and reflow the child frame
|
||||||
nsLineLayout* ll = aReflowState.mLineLayout;
|
nsLineLayout* ll = aReflowInput.mLineLayout;
|
||||||
bool pushedFrame;
|
bool pushedFrame;
|
||||||
|
|
||||||
ll->SetInFirstLetter(
|
ll->SetInFirstLetter(
|
||||||
mStyleContext->GetPseudo() == nsCSSPseudoElements::firstLetter);
|
mStyleContext->GetPseudo() == nsCSSPseudoElements::firstLetter);
|
||||||
ll->BeginSpan(this, &aReflowState, bp.IStart(wm),
|
ll->BeginSpan(this, &aReflowInput, bp.IStart(wm),
|
||||||
availSize.ISize(wm), &mBaseline);
|
availSize.ISize(wm), &mBaseline);
|
||||||
ll->ReflowFrame(kid, aReflowStatus, &kidMetrics, pushedFrame);
|
ll->ReflowFrame(kid, aReflowStatus, &kidMetrics, pushedFrame);
|
||||||
NS_ASSERTION(lineWM.IsVertical() == wm.IsVertical(),
|
NS_ASSERTION(lineWM.IsVertical() == wm.IsVertical(),
|
||||||
@@ -264,8 +264,8 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// Create a continuation or remove existing continuations based on
|
// Create a continuation or remove existing continuations based on
|
||||||
// the reflow completion status.
|
// the reflow completion status.
|
||||||
if (NS_FRAME_IS_COMPLETE(aReflowStatus)) {
|
if (NS_FRAME_IS_COMPLETE(aReflowStatus)) {
|
||||||
if (aReflowState.mLineLayout) {
|
if (aReflowInput.mLineLayout) {
|
||||||
aReflowState.mLineLayout->SetFirstLetterStyleOK(false);
|
aReflowInput.mLineLayout->SetFirstLetterStyleOK(false);
|
||||||
}
|
}
|
||||||
nsIFrame* kidNextInFlow = kid->GetNextInFlow();
|
nsIFrame* kidNextInFlow = kid->GetNextInFlow();
|
||||||
if (kidNextInFlow) {
|
if (kidNextInFlow) {
|
||||||
@@ -294,7 +294,7 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aReflowStatus, aReflowState, aMetrics);
|
NS_FRAME_SET_TRUNCATION(aReflowStatus, aReflowInput, aMetrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */ bool
|
/* virtual */ bool
|
||||||
@@ -398,7 +398,7 @@ nsFirstLetterFrame::GetLogicalBaseline(WritingMode aWritingMode) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
nsIFrame::LogicalSides
|
||||||
nsFirstLetterFrame::GetLogicalSkipSides(const ReflowInput* aReflowState) const
|
nsFirstLetterFrame::GetLogicalSkipSides(const ReflowInput* aReflowInput) const
|
||||||
{
|
{
|
||||||
if (GetPrevContinuation()) {
|
if (GetPrevContinuation()) {
|
||||||
// We shouldn't get calls to GetSkipSides for later continuations since
|
// We shouldn't get calls to GetSkipSides for later continuations since
|
||||||
|
|||||||
@@ -62,12 +62,12 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual bool CanContinueTextRun() const override;
|
virtual bool CanContinueTextRun() const override;
|
||||||
virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
|
virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
|
||||||
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowState = nullptr) const override;
|
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowInput = nullptr) const override;
|
||||||
|
|
||||||
//override of nsFrame method
|
//override of nsFrame method
|
||||||
virtual nsresult GetChildFrameContainingOffset(int32_t inContentOffset,
|
virtual nsresult GetChildFrameContainingOffset(int32_t inContentOffset,
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ class nsFlexContainerFrame::FlexItem : public LinkedListElement<FlexItem>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Normal constructor:
|
// Normal constructor:
|
||||||
FlexItem(ReflowInput& aFlexItemReflowState,
|
FlexItem(ReflowInput& aFlexItemReflowInput,
|
||||||
float aFlexGrow, float aFlexShrink, nscoord aMainBaseSize,
|
float aFlexGrow, float aFlexShrink, nscoord aMainBaseSize,
|
||||||
nscoord aMainMinSize, nscoord aMainMaxSize,
|
nscoord aMainMinSize, nscoord aMainMaxSize,
|
||||||
nscoord aTentativeCrossSize,
|
nscoord aTentativeCrossSize,
|
||||||
@@ -744,7 +744,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Helper called by the constructor, to set mNeedsMinSizeAutoResolution:
|
// Helper called by the constructor, to set mNeedsMinSizeAutoResolution:
|
||||||
void CheckForMinSizeAuto(const ReflowInput& aFlexItemReflowState,
|
void CheckForMinSizeAuto(const ReflowInput& aFlexItemReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker);
|
const FlexboxAxisTracker& aAxisTracker);
|
||||||
|
|
||||||
// Our frame:
|
// Our frame:
|
||||||
@@ -1181,20 +1181,20 @@ UniquePtr<FlexItem>
|
|||||||
nsFlexContainerFrame::GenerateFlexItemForChild(
|
nsFlexContainerFrame::GenerateFlexItemForChild(
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
nsIFrame* aChildFrame,
|
nsIFrame* aChildFrame,
|
||||||
const ReflowInput& aParentReflowState,
|
const ReflowInput& aParentReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker)
|
const FlexboxAxisTracker& aAxisTracker)
|
||||||
{
|
{
|
||||||
// Create temporary reflow state just for sizing -- to get hypothetical
|
// Create temporary reflow state just for sizing -- to get hypothetical
|
||||||
// main-size and the computed values of min / max main-size property.
|
// main-size and the computed values of min / max main-size property.
|
||||||
// (This reflow state will _not_ be used for reflow.)
|
// (This reflow state will _not_ be used for reflow.)
|
||||||
ReflowInput
|
ReflowInput
|
||||||
childRS(aPresContext, aParentReflowState, aChildFrame,
|
childRS(aPresContext, aParentReflowInput, aChildFrame,
|
||||||
aParentReflowState.ComputedSize(aChildFrame->GetWritingMode()));
|
aParentReflowInput.ComputedSize(aChildFrame->GetWritingMode()));
|
||||||
|
|
||||||
// FLEX GROW & SHRINK WEIGHTS
|
// FLEX GROW & SHRINK WEIGHTS
|
||||||
// --------------------------
|
// --------------------------
|
||||||
float flexGrow, flexShrink;
|
float flexGrow, flexShrink;
|
||||||
if (IsLegacyBox(aParentReflowState.mStyleDisplay, mStyleContext)) {
|
if (IsLegacyBox(aParentReflowInput.mStyleDisplay, mStyleContext)) {
|
||||||
flexGrow = flexShrink = aChildFrame->StyleXUL()->mBoxFlex;
|
flexGrow = flexShrink = aChildFrame->StyleXUL()->mBoxFlex;
|
||||||
} else {
|
} else {
|
||||||
const nsStylePosition* stylePos = aChildFrame->StylePosition();
|
const nsStylePosition* stylePos = aChildFrame->StylePosition();
|
||||||
@@ -1314,16 +1314,16 @@ nsFlexContainerFrame::GenerateFlexItemForChild(
|
|||||||
// The logic here should be similar to the logic for isAutoWidth/isAutoHeight
|
// The logic here should be similar to the logic for isAutoWidth/isAutoHeight
|
||||||
// in nsLayoutUtils::ComputeSizeWithIntrinsicDimensions().
|
// in nsLayoutUtils::ComputeSizeWithIntrinsicDimensions().
|
||||||
static bool
|
static bool
|
||||||
IsCrossSizeDefinite(const ReflowInput& aItemReflowState,
|
IsCrossSizeDefinite(const ReflowInput& aItemReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker)
|
const FlexboxAxisTracker& aAxisTracker)
|
||||||
{
|
{
|
||||||
const nsStylePosition* pos = aItemReflowState.mStylePosition;
|
const nsStylePosition* pos = aItemReflowInput.mStylePosition;
|
||||||
if (aAxisTracker.IsCrossAxisHorizontal()) {
|
if (aAxisTracker.IsCrossAxisHorizontal()) {
|
||||||
return pos->mWidth.GetUnit() != eStyleUnit_Auto;
|
return pos->mWidth.GetUnit() != eStyleUnit_Auto;
|
||||||
}
|
}
|
||||||
// else, vertical. (We need to use IsAutoHeight() to catch e.g. %-height
|
// else, vertical. (We need to use IsAutoHeight() to catch e.g. %-height
|
||||||
// applied to indefinite-height containing block, which counts as auto.)
|
// applied to indefinite-height containing block, which counts as auto.)
|
||||||
nscoord cbHeight = aItemReflowState.mCBReflowState->ComputedHeight();
|
nscoord cbHeight = aItemReflowInput.mCBReflowInput->ComputedHeight();
|
||||||
return !nsLayoutUtils::IsAutoHeight(pos->mHeight, cbHeight);
|
return !nsLayoutUtils::IsAutoHeight(pos->mHeight, cbHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1342,7 +1342,7 @@ IsCrossSizeDefinite(const ReflowInput& aItemReflowState,
|
|||||||
// If my understanding there ends up being wrong, we'll need to update this.
|
// If my understanding there ends up being wrong, we'll need to update this.
|
||||||
static nscoord
|
static nscoord
|
||||||
CrossSizeToUseWithRatio(const FlexItem& aFlexItem,
|
CrossSizeToUseWithRatio(const FlexItem& aFlexItem,
|
||||||
const ReflowInput& aItemReflowState,
|
const ReflowInput& aItemReflowInput,
|
||||||
bool aMinSizeFallback,
|
bool aMinSizeFallback,
|
||||||
const FlexboxAxisTracker& aAxisTracker)
|
const FlexboxAxisTracker& aAxisTracker)
|
||||||
{
|
{
|
||||||
@@ -1351,19 +1351,19 @@ CrossSizeToUseWithRatio(const FlexItem& aFlexItem,
|
|||||||
return aFlexItem.GetCrossSize();
|
return aFlexItem.GetCrossSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsCrossSizeDefinite(aItemReflowState, aAxisTracker)) {
|
if (IsCrossSizeDefinite(aItemReflowInput, aAxisTracker)) {
|
||||||
// Definite cross size.
|
// Definite cross size.
|
||||||
return GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
|
return GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
|
||||||
aItemReflowState.ComputedISize(),
|
aItemReflowInput.ComputedISize(),
|
||||||
aItemReflowState.ComputedBSize());
|
aItemReflowInput.ComputedBSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aMinSizeFallback) {
|
if (aMinSizeFallback) {
|
||||||
// Indefinite cross-size, and we're resolving main min-size, so we'll fall
|
// Indefinite cross-size, and we're resolving main min-size, so we'll fall
|
||||||
// back to ussing the cross min-size (which should be definite).
|
// back to ussing the cross min-size (which should be definite).
|
||||||
return GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
|
return GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
|
||||||
aItemReflowState.ComputedMinISize(),
|
aItemReflowInput.ComputedMinISize(),
|
||||||
aItemReflowState.ComputedMinBSize());
|
aItemReflowInput.ComputedMinBSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Indefinite cross-size.
|
// Indefinite cross-size.
|
||||||
@@ -1398,7 +1398,7 @@ MainSizeFromAspectRatio(nscoord aCrossSize,
|
|||||||
// Spec reference: http://dev.w3.org/csswg/css-flexbox/#min-size-auto
|
// Spec reference: http://dev.w3.org/csswg/css-flexbox/#min-size-auto
|
||||||
static nscoord
|
static nscoord
|
||||||
PartiallyResolveAutoMinSize(const FlexItem& aFlexItem,
|
PartiallyResolveAutoMinSize(const FlexItem& aFlexItem,
|
||||||
const ReflowInput& aItemReflowState,
|
const ReflowInput& aItemReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker)
|
const FlexboxAxisTracker& aAxisTracker)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aFlexItem.NeedsMinSizeAutoResolution(),
|
MOZ_ASSERT(aFlexItem.NeedsMinSizeAutoResolution(),
|
||||||
@@ -1411,7 +1411,7 @@ PartiallyResolveAutoMinSize(const FlexItem& aFlexItem,
|
|||||||
// * the used flex-basis, if the computed flex-basis was 'auto':
|
// * the used flex-basis, if the computed flex-basis was 'auto':
|
||||||
// XXXdholbert ('auto' might be renamed to 'main-size'; see bug 1032922)
|
// XXXdholbert ('auto' might be renamed to 'main-size'; see bug 1032922)
|
||||||
if (eStyleUnit_Auto ==
|
if (eStyleUnit_Auto ==
|
||||||
aItemReflowState.mStylePosition->mFlexBasis.GetUnit() &&
|
aItemReflowInput.mStylePosition->mFlexBasis.GetUnit() &&
|
||||||
aFlexItem.GetFlexBaseSize() != NS_AUTOHEIGHT) {
|
aFlexItem.GetFlexBaseSize() != NS_AUTOHEIGHT) {
|
||||||
// NOTE: We skip this if the flex base size depends on content & isn't yet
|
// NOTE: We skip this if the flex base size depends on content & isn't yet
|
||||||
// resolved. This is OK, because the caller is responsible for computing
|
// resolved. This is OK, because the caller is responsible for computing
|
||||||
@@ -1423,8 +1423,8 @@ PartiallyResolveAutoMinSize(const FlexItem& aFlexItem,
|
|||||||
// * the computed max-width (max-height), if that value is definite:
|
// * the computed max-width (max-height), if that value is definite:
|
||||||
nscoord maxSize =
|
nscoord maxSize =
|
||||||
GET_MAIN_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
|
GET_MAIN_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
|
||||||
aItemReflowState.ComputedMaxISize(),
|
aItemReflowInput.ComputedMaxISize(),
|
||||||
aItemReflowState.ComputedMaxBSize());
|
aItemReflowInput.ComputedMaxBSize());
|
||||||
if (maxSize != NS_UNCONSTRAINEDSIZE) {
|
if (maxSize != NS_UNCONSTRAINEDSIZE) {
|
||||||
minMainSize = std::min(minMainSize, maxSize);
|
minMainSize = std::min(minMainSize, maxSize);
|
||||||
}
|
}
|
||||||
@@ -1439,7 +1439,7 @@ PartiallyResolveAutoMinSize(const FlexItem& aFlexItem,
|
|||||||
// We have a usable aspect ratio. (not going to divide by 0)
|
// We have a usable aspect ratio. (not going to divide by 0)
|
||||||
const bool useMinSizeIfCrossSizeIsIndefinite = true;
|
const bool useMinSizeIfCrossSizeIsIndefinite = true;
|
||||||
nscoord crossSizeToUseWithRatio =
|
nscoord crossSizeToUseWithRatio =
|
||||||
CrossSizeToUseWithRatio(aFlexItem, aItemReflowState,
|
CrossSizeToUseWithRatio(aFlexItem, aItemReflowInput,
|
||||||
useMinSizeIfCrossSizeIsIndefinite,
|
useMinSizeIfCrossSizeIsIndefinite,
|
||||||
aAxisTracker);
|
aAxisTracker);
|
||||||
nscoord minMainSizeFromRatio =
|
nscoord minMainSizeFromRatio =
|
||||||
@@ -1457,7 +1457,7 @@ PartiallyResolveAutoMinSize(const FlexItem& aFlexItem,
|
|||||||
// the cross-size is indefinite), returns false.
|
// the cross-size is indefinite), returns false.
|
||||||
static bool
|
static bool
|
||||||
ResolveAutoFlexBasisFromRatio(FlexItem& aFlexItem,
|
ResolveAutoFlexBasisFromRatio(FlexItem& aFlexItem,
|
||||||
const ReflowInput& aItemReflowState,
|
const ReflowInput& aItemReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker)
|
const FlexboxAxisTracker& aAxisTracker)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_AUTOHEIGHT == aFlexItem.GetFlexBaseSize(),
|
MOZ_ASSERT(NS_AUTOHEIGHT == aFlexItem.GetFlexBaseSize(),
|
||||||
@@ -1472,7 +1472,7 @@ ResolveAutoFlexBasisFromRatio(FlexItem& aFlexItem,
|
|||||||
// We have a usable aspect ratio. (not going to divide by 0)
|
// We have a usable aspect ratio. (not going to divide by 0)
|
||||||
const bool useMinSizeIfCrossSizeIsIndefinite = false;
|
const bool useMinSizeIfCrossSizeIsIndefinite = false;
|
||||||
nscoord crossSizeToUseWithRatio =
|
nscoord crossSizeToUseWithRatio =
|
||||||
CrossSizeToUseWithRatio(aFlexItem, aItemReflowState,
|
CrossSizeToUseWithRatio(aFlexItem, aItemReflowInput,
|
||||||
useMinSizeIfCrossSizeIsIndefinite,
|
useMinSizeIfCrossSizeIsIndefinite,
|
||||||
aAxisTracker);
|
aAxisTracker);
|
||||||
if (crossSizeToUseWithRatio != NS_AUTOHEIGHT) {
|
if (crossSizeToUseWithRatio != NS_AUTOHEIGHT) {
|
||||||
@@ -1493,7 +1493,7 @@ void
|
|||||||
nsFlexContainerFrame::
|
nsFlexContainerFrame::
|
||||||
ResolveAutoFlexBasisAndMinSize(nsPresContext* aPresContext,
|
ResolveAutoFlexBasisAndMinSize(nsPresContext* aPresContext,
|
||||||
FlexItem& aFlexItem,
|
FlexItem& aFlexItem,
|
||||||
const ReflowInput& aItemReflowState,
|
const ReflowInput& aItemReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker)
|
const FlexboxAxisTracker& aAxisTracker)
|
||||||
{
|
{
|
||||||
// (Note: We should never have a used flex-basis of "auto" if our main axis
|
// (Note: We should never have a used flex-basis of "auto" if our main axis
|
||||||
@@ -1518,7 +1518,7 @@ nsFlexContainerFrame::
|
|||||||
// have a single-line (nowrap) flex container which itself has a definite
|
// have a single-line (nowrap) flex container which itself has a definite
|
||||||
// cross-size. Otherwise, we'll wait to do stretching, since (in other
|
// cross-size. Otherwise, we'll wait to do stretching, since (in other
|
||||||
// cases) we don't know how much the item should stretch yet.
|
// cases) we don't know how much the item should stretch yet.
|
||||||
const ReflowInput* flexContainerRS = aItemReflowState.mParentReflowState;
|
const ReflowInput* flexContainerRS = aItemReflowInput.mParentReflowInput;
|
||||||
MOZ_ASSERT(flexContainerRS,
|
MOZ_ASSERT(flexContainerRS,
|
||||||
"flex item's reflow state should have ptr to container's state");
|
"flex item's reflow state should have ptr to container's state");
|
||||||
if (NS_STYLE_FLEX_WRAP_NOWRAP == flexContainerRS->mStylePosition->mFlexWrap) {
|
if (NS_STYLE_FLEX_WRAP_NOWRAP == flexContainerRS->mStylePosition->mFlexWrap) {
|
||||||
@@ -1542,7 +1542,7 @@ nsFlexContainerFrame::
|
|||||||
if (isMainMinSizeAuto) {
|
if (isMainMinSizeAuto) {
|
||||||
// Resolve the min-size, except for considering the min-content size.
|
// Resolve the min-size, except for considering the min-content size.
|
||||||
// (We'll consider that later, if we need to.)
|
// (We'll consider that later, if we need to.)
|
||||||
resolvedMinSize = PartiallyResolveAutoMinSize(aFlexItem, aItemReflowState,
|
resolvedMinSize = PartiallyResolveAutoMinSize(aFlexItem, aItemReflowInput,
|
||||||
aAxisTracker);
|
aAxisTracker);
|
||||||
if (resolvedMinSize > 0 &&
|
if (resolvedMinSize > 0 &&
|
||||||
aAxisTracker.GetCrossComponent(aFlexItem.IntrinsicRatio()) == 0) {
|
aAxisTracker.GetCrossComponent(aFlexItem.IntrinsicRatio()) == 0) {
|
||||||
@@ -1557,7 +1557,7 @@ nsFlexContainerFrame::
|
|||||||
|
|
||||||
bool flexBasisNeedsToMeasureContent = false; // assume the best
|
bool flexBasisNeedsToMeasureContent = false; // assume the best
|
||||||
if (isMainSizeAuto) {
|
if (isMainSizeAuto) {
|
||||||
if (!ResolveAutoFlexBasisFromRatio(aFlexItem, aItemReflowState,
|
if (!ResolveAutoFlexBasisFromRatio(aFlexItem, aItemReflowInput,
|
||||||
aAxisTracker)) {
|
aAxisTracker)) {
|
||||||
flexBasisNeedsToMeasureContent = true;
|
flexBasisNeedsToMeasureContent = true;
|
||||||
}
|
}
|
||||||
@@ -1568,7 +1568,7 @@ nsFlexContainerFrame::
|
|||||||
if (aAxisTracker.IsMainAxisHorizontal()) {
|
if (aAxisTracker.IsMainAxisHorizontal()) {
|
||||||
if (minSizeNeedsToMeasureContent) {
|
if (minSizeNeedsToMeasureContent) {
|
||||||
nscoord frameMinISize =
|
nscoord frameMinISize =
|
||||||
aFlexItem.Frame()->GetMinISize(aItemReflowState.mRenderingContext);
|
aFlexItem.Frame()->GetMinISize(aItemReflowInput.mRenderingContext);
|
||||||
resolvedMinSize = std::min(resolvedMinSize, frameMinISize);
|
resolvedMinSize = std::min(resolvedMinSize, frameMinISize);
|
||||||
}
|
}
|
||||||
NS_ASSERTION(!flexBasisNeedsToMeasureContent,
|
NS_ASSERTION(!flexBasisNeedsToMeasureContent,
|
||||||
@@ -1614,14 +1614,14 @@ nsFlexContainerFrame::
|
|||||||
MeasureFlexItemContentHeight(nsPresContext* aPresContext,
|
MeasureFlexItemContentHeight(nsPresContext* aPresContext,
|
||||||
FlexItem& aFlexItem,
|
FlexItem& aFlexItem,
|
||||||
bool aForceVerticalResizeForMeasuringReflow,
|
bool aForceVerticalResizeForMeasuringReflow,
|
||||||
const ReflowInput& aParentReflowState)
|
const ReflowInput& aParentReflowInput)
|
||||||
{
|
{
|
||||||
// Set up a reflow state for measuring the flex item's auto-height:
|
// Set up a reflow state for measuring the flex item's auto-height:
|
||||||
WritingMode wm = aFlexItem.Frame()->GetWritingMode();
|
WritingMode wm = aFlexItem.Frame()->GetWritingMode();
|
||||||
LogicalSize availSize = aParentReflowState.ComputedSize(wm);
|
LogicalSize availSize = aParentReflowInput.ComputedSize(wm);
|
||||||
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
ReflowInput
|
ReflowInput
|
||||||
childRSForMeasuringHeight(aPresContext, aParentReflowState,
|
childRSForMeasuringHeight(aPresContext, aParentReflowInput,
|
||||||
aFlexItem.Frame(), availSize,
|
aFlexItem.Frame(), availSize,
|
||||||
nullptr, ReflowInput::CALLER_WILL_INIT);
|
nullptr, ReflowInput::CALLER_WILL_INIT);
|
||||||
childRSForMeasuringHeight.mFlags.mIsFlexContainerMeasuringHeight = true;
|
childRSForMeasuringHeight.mFlags.mIsFlexContainerMeasuringHeight = true;
|
||||||
@@ -1669,18 +1669,18 @@ nsFlexContainerFrame::
|
|||||||
return std::max(0, childDesiredHeight);
|
return std::max(0, childDesiredHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
FlexItem::FlexItem(ReflowInput& aFlexItemReflowState,
|
FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
|
||||||
float aFlexGrow, float aFlexShrink, nscoord aFlexBaseSize,
|
float aFlexGrow, float aFlexShrink, nscoord aFlexBaseSize,
|
||||||
nscoord aMainMinSize, nscoord aMainMaxSize,
|
nscoord aMainMinSize, nscoord aMainMaxSize,
|
||||||
nscoord aTentativeCrossSize,
|
nscoord aTentativeCrossSize,
|
||||||
nscoord aCrossMinSize, nscoord aCrossMaxSize,
|
nscoord aCrossMinSize, nscoord aCrossMaxSize,
|
||||||
const FlexboxAxisTracker& aAxisTracker)
|
const FlexboxAxisTracker& aAxisTracker)
|
||||||
: mFrame(aFlexItemReflowState.mFrame),
|
: mFrame(aFlexItemReflowInput.mFrame),
|
||||||
mFlexGrow(aFlexGrow),
|
mFlexGrow(aFlexGrow),
|
||||||
mFlexShrink(aFlexShrink),
|
mFlexShrink(aFlexShrink),
|
||||||
mIntrinsicRatio(mFrame->GetIntrinsicRatio()),
|
mIntrinsicRatio(mFrame->GetIntrinsicRatio()),
|
||||||
mBorderPadding(aFlexItemReflowState.ComputedPhysicalBorderPadding()),
|
mBorderPadding(aFlexItemReflowInput.ComputedPhysicalBorderPadding()),
|
||||||
mMargin(aFlexItemReflowState.ComputedPhysicalMargin()),
|
mMargin(aFlexItemReflowInput.ComputedPhysicalMargin()),
|
||||||
mMainMinSize(aMainMinSize),
|
mMainMinSize(aMainMinSize),
|
||||||
mMainMaxSize(aMainMaxSize),
|
mMainMaxSize(aMainMaxSize),
|
||||||
mCrossMinSize(aCrossMinSize),
|
mCrossMinSize(aCrossMinSize),
|
||||||
@@ -1697,7 +1697,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowState,
|
|||||||
mIsStretched(false),
|
mIsStretched(false),
|
||||||
mIsStrut(false),
|
mIsStrut(false),
|
||||||
// mNeedsMinSizeAutoResolution is initialized in CheckForMinSizeAuto()
|
// mNeedsMinSizeAutoResolution is initialized in CheckForMinSizeAuto()
|
||||||
mWM(aFlexItemReflowState.GetWritingMode())
|
mWM(aFlexItemReflowInput.GetWritingMode())
|
||||||
// mAlignSelf, see below
|
// mAlignSelf, see below
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
|
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
|
||||||
@@ -1706,7 +1706,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowState,
|
|||||||
MOZ_ASSERT(!(mFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW),
|
MOZ_ASSERT(!(mFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW),
|
||||||
"out-of-flow frames should not be treated as flex items");
|
"out-of-flow frames should not be treated as flex items");
|
||||||
|
|
||||||
const ReflowInput* containerRS = aFlexItemReflowState.mParentReflowState;
|
const ReflowInput* containerRS = aFlexItemReflowInput.mParentReflowInput;
|
||||||
if (IsLegacyBox(containerRS->mStyleDisplay,
|
if (IsLegacyBox(containerRS->mStyleDisplay,
|
||||||
containerRS->mFrame->StyleContext())) {
|
containerRS->mFrame->StyleContext())) {
|
||||||
// For -webkit-box/-webkit-inline-box, we need to:
|
// For -webkit-box/-webkit-inline-box, we need to:
|
||||||
@@ -1719,7 +1719,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowState,
|
|||||||
const nsStyleXUL* containerStyleXUL = containerRS->mFrame->StyleXUL();
|
const nsStyleXUL* containerStyleXUL = containerRS->mFrame->StyleXUL();
|
||||||
mAlignSelf = ConvertLegacyStyleToAlignItems(containerStyleXUL);
|
mAlignSelf = ConvertLegacyStyleToAlignItems(containerStyleXUL);
|
||||||
} else {
|
} else {
|
||||||
mAlignSelf = aFlexItemReflowState.mStylePosition->ComputedAlignSelf(
|
mAlignSelf = aFlexItemReflowInput.mStylePosition->ComputedAlignSelf(
|
||||||
mFrame->StyleContext()->GetParent());
|
mFrame->StyleContext()->GetParent());
|
||||||
if (MOZ_LIKELY(mAlignSelf == NS_STYLE_ALIGN_NORMAL)) {
|
if (MOZ_LIKELY(mAlignSelf == NS_STYLE_ALIGN_NORMAL)) {
|
||||||
mAlignSelf = NS_STYLE_ALIGN_STRETCH;
|
mAlignSelf = NS_STYLE_ALIGN_STRETCH;
|
||||||
@@ -1730,14 +1730,14 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetFlexBaseSizeAndMainSize(aFlexBaseSize);
|
SetFlexBaseSizeAndMainSize(aFlexBaseSize);
|
||||||
CheckForMinSizeAuto(aFlexItemReflowState, aAxisTracker);
|
CheckForMinSizeAuto(aFlexItemReflowInput, aAxisTracker);
|
||||||
|
|
||||||
// Assert that any "auto" margin components are set to 0.
|
// Assert that any "auto" margin components are set to 0.
|
||||||
// (We'll resolve them later; until then, we want to treat them as 0-sized.)
|
// (We'll resolve them later; until then, we want to treat them as 0-sized.)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
{
|
{
|
||||||
const nsStyleSides& styleMargin =
|
const nsStyleSides& styleMargin =
|
||||||
aFlexItemReflowState.mStyleMargin->mMargin;
|
aFlexItemReflowInput.mStyleMargin->mMargin;
|
||||||
NS_FOR_CSS_SIDES(side) {
|
NS_FOR_CSS_SIDES(side) {
|
||||||
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
|
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
|
||||||
MOZ_ASSERT(GetMarginComponentForSide(side) == 0,
|
MOZ_ASSERT(GetMarginComponentForSide(side) == 0,
|
||||||
@@ -1806,11 +1806,11 @@ FlexItem::FlexItem(nsIFrame* aChildFrame, nscoord aCrossSize,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FlexItem::CheckForMinSizeAuto(const ReflowInput& aFlexItemReflowState,
|
FlexItem::CheckForMinSizeAuto(const ReflowInput& aFlexItemReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker)
|
const FlexboxAxisTracker& aAxisTracker)
|
||||||
{
|
{
|
||||||
const nsStylePosition* pos = aFlexItemReflowState.mStylePosition;
|
const nsStylePosition* pos = aFlexItemReflowInput.mStylePosition;
|
||||||
const nsStyleDisplay* disp = aFlexItemReflowState.mStyleDisplay;
|
const nsStyleDisplay* disp = aFlexItemReflowInput.mStyleDisplay;
|
||||||
|
|
||||||
// We'll need special behavior for "min-[width|height]:auto" (whichever is in
|
// We'll need special behavior for "min-[width|height]:auto" (whichever is in
|
||||||
// the main axis) iff:
|
// the main axis) iff:
|
||||||
@@ -3363,7 +3363,7 @@ AddNewFlexLineToList(LinkedList<FlexLine>& aLines,
|
|||||||
void
|
void
|
||||||
nsFlexContainerFrame::GenerateFlexLines(
|
nsFlexContainerFrame::GenerateFlexLines(
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nscoord aContentBoxMainSize,
|
nscoord aContentBoxMainSize,
|
||||||
nscoord aAvailableBSizeForContent,
|
nscoord aAvailableBSizeForContent,
|
||||||
const nsTArray<StrutInfo>& aStruts,
|
const nsTArray<StrutInfo>& aStruts,
|
||||||
@@ -3373,7 +3373,7 @@ nsFlexContainerFrame::GenerateFlexLines(
|
|||||||
MOZ_ASSERT(aLines.isEmpty(), "Expecting outparam to start out empty");
|
MOZ_ASSERT(aLines.isEmpty(), "Expecting outparam to start out empty");
|
||||||
|
|
||||||
const bool isSingleLine =
|
const bool isSingleLine =
|
||||||
NS_STYLE_FLEX_WRAP_NOWRAP == aReflowState.mStylePosition->mFlexWrap;
|
NS_STYLE_FLEX_WRAP_NOWRAP == aReflowInput.mStylePosition->mFlexWrap;
|
||||||
|
|
||||||
// If we're transparently reversing axes, then we'll need to link up our
|
// If we're transparently reversing axes, then we'll need to link up our
|
||||||
// FlexItems and FlexLines in the reverse order, so that the rest of flex
|
// FlexItems and FlexLines in the reverse order, so that the rest of flex
|
||||||
@@ -3401,8 +3401,8 @@ nsFlexContainerFrame::GenerateFlexLines(
|
|||||||
if (wrapThreshold == NS_UNCONSTRAINEDSIZE) {
|
if (wrapThreshold == NS_UNCONSTRAINEDSIZE) {
|
||||||
const nscoord flexContainerMaxMainSize =
|
const nscoord flexContainerMaxMainSize =
|
||||||
GET_MAIN_COMPONENT_LOGICAL(aAxisTracker, aAxisTracker.GetWritingMode(),
|
GET_MAIN_COMPONENT_LOGICAL(aAxisTracker, aAxisTracker.GetWritingMode(),
|
||||||
aReflowState.ComputedMaxISize(),
|
aReflowInput.ComputedMaxISize(),
|
||||||
aReflowState.ComputedMaxBSize());
|
aReflowInput.ComputedMaxBSize());
|
||||||
|
|
||||||
wrapThreshold = flexContainerMaxMainSize;
|
wrapThreshold = flexContainerMaxMainSize;
|
||||||
}
|
}
|
||||||
@@ -3437,11 +3437,11 @@ nsFlexContainerFrame::GenerateFlexLines(
|
|||||||
|
|
||||||
// Use the simplified "strut" FlexItem constructor:
|
// Use the simplified "strut" FlexItem constructor:
|
||||||
item = MakeUnique<FlexItem>(childFrame, aStruts[nextStrutIdx].mStrutCrossSize,
|
item = MakeUnique<FlexItem>(childFrame, aStruts[nextStrutIdx].mStrutCrossSize,
|
||||||
aReflowState.GetWritingMode());
|
aReflowInput.GetWritingMode());
|
||||||
nextStrutIdx++;
|
nextStrutIdx++;
|
||||||
} else {
|
} else {
|
||||||
item = GenerateFlexItemForChild(aPresContext, childFrame,
|
item = GenerateFlexItemForChild(aPresContext, childFrame,
|
||||||
aReflowState, aAxisTracker);
|
aReflowInput, aAxisTracker);
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord itemInnerHypotheticalMainSize = item->GetMainSize();
|
nscoord itemInnerHypotheticalMainSize = item->GetMainSize();
|
||||||
@@ -3477,8 +3477,8 @@ nsFlexContainerFrame::GenerateFlexLines(
|
|||||||
// reflow state (specifically, the main-size of *this continuation* of the
|
// reflow state (specifically, the main-size of *this continuation* of the
|
||||||
// flex container).
|
// flex container).
|
||||||
nscoord
|
nscoord
|
||||||
nsFlexContainerFrame::GetMainSizeFromReflowState(
|
nsFlexContainerFrame::GetMainSizeFromReflowInput(
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker)
|
const FlexboxAxisTracker& aAxisTracker)
|
||||||
{
|
{
|
||||||
if (aAxisTracker.IsRowOriented()) {
|
if (aAxisTracker.IsRowOriented()) {
|
||||||
@@ -3487,15 +3487,15 @@ nsFlexContainerFrame::GetMainSizeFromReflowState(
|
|||||||
// XXXdholbert ISize may be (wrongly) unconstrained right now: bug 1163238
|
// XXXdholbert ISize may be (wrongly) unconstrained right now: bug 1163238
|
||||||
// Uncomment when that's fixed:
|
// Uncomment when that's fixed:
|
||||||
/*
|
/*
|
||||||
NS_WARN_IF_FALSE(aReflowState.ComputedISize() != NS_UNCONSTRAINEDSIZE,
|
NS_WARN_IF_FALSE(aReflowInput.ComputedISize() != NS_UNCONSTRAINEDSIZE,
|
||||||
"Unconstrained inline size; this should only result from "
|
"Unconstrained inline size; this should only result from "
|
||||||
"huge sizes (not intrinsic sizing w/ orthogonal flows)");
|
"huge sizes (not intrinsic sizing w/ orthogonal flows)");
|
||||||
*/
|
*/
|
||||||
return aReflowState.ComputedISize();
|
return aReflowInput.ComputedISize();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: This may be unconstrained, if our block size is "auto":
|
// Note: This may be unconstrained, if our block size is "auto":
|
||||||
return GetEffectiveComputedBSize(aReflowState);
|
return GetEffectiveComputedBSize(aReflowInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the largest outer hypothetical main-size of any line in |aLines|.
|
// Returns the largest outer hypothetical main-size of any line in |aLines|.
|
||||||
@@ -3521,14 +3521,14 @@ GetLargestLineMainSize(const FlexLine* aFirstLine)
|
|||||||
* Guaranteed to return a definite length, i.e. not NS_UNCONSTRAINEDSIZE,
|
* Guaranteed to return a definite length, i.e. not NS_UNCONSTRAINEDSIZE,
|
||||||
* aside from cases with huge lengths which happen to compute to that value.
|
* aside from cases with huge lengths which happen to compute to that value.
|
||||||
* XXXdholbert (this^ isn't quite true, if we're row-oriented and in an
|
* XXXdholbert (this^ isn't quite true, if we're row-oriented and in an
|
||||||
* orthogonal flow, per mentions of bug 1163238 in GetMainSizeFromReflowState.)
|
* orthogonal flow, per mentions of bug 1163238 in GetMainSizeFromReflowInput.)
|
||||||
*
|
*
|
||||||
* (Note: This function should be structurally similar to 'ComputeCrossSize()',
|
* (Note: This function should be structurally similar to 'ComputeCrossSize()',
|
||||||
* except that here, the caller has already grabbed the tentative size from the
|
* except that here, the caller has already grabbed the tentative size from the
|
||||||
* reflow state.)
|
* reflow state.)
|
||||||
*/
|
*/
|
||||||
static nscoord
|
static nscoord
|
||||||
ResolveFlexContainerMainSize(const ReflowInput& aReflowState,
|
ResolveFlexContainerMainSize(const ReflowInput& aReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker,
|
const FlexboxAxisTracker& aAxisTracker,
|
||||||
nscoord aTentativeMainSize,
|
nscoord aTentativeMainSize,
|
||||||
nscoord aAvailableBSizeForContent,
|
nscoord aAvailableBSizeForContent,
|
||||||
@@ -3576,12 +3576,12 @@ ResolveFlexContainerMainSize(const ReflowInput& aReflowState,
|
|||||||
// XXXdholbert Handle constrained-aAvailableBSizeForContent case here.
|
// XXXdholbert Handle constrained-aAvailableBSizeForContent case here.
|
||||||
nscoord largestLineOuterSize = GetLargestLineMainSize(aFirstLine);
|
nscoord largestLineOuterSize = GetLargestLineMainSize(aFirstLine);
|
||||||
return NS_CSS_MINMAX(largestLineOuterSize,
|
return NS_CSS_MINMAX(largestLineOuterSize,
|
||||||
aReflowState.ComputedMinBSize(),
|
aReflowInput.ComputedMinBSize(),
|
||||||
aReflowState.ComputedMaxBSize());
|
aReflowInput.ComputedMaxBSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
nsFlexContainerFrame::ComputeCrossSize(const ReflowInput& aReflowState,
|
nsFlexContainerFrame::ComputeCrossSize(const ReflowInput& aReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker,
|
const FlexboxAxisTracker& aAxisTracker,
|
||||||
nscoord aSumLineCrossSizes,
|
nscoord aSumLineCrossSizes,
|
||||||
nscoord aAvailableBSizeForContent,
|
nscoord aAvailableBSizeForContent,
|
||||||
@@ -3596,15 +3596,15 @@ nsFlexContainerFrame::ComputeCrossSize(const ReflowInput& aReflowState,
|
|||||||
// XXXdholbert ISize may be (wrongly) unconstrained right now: bug 1163238.
|
// XXXdholbert ISize may be (wrongly) unconstrained right now: bug 1163238.
|
||||||
// Uncomment when that's fixed:
|
// Uncomment when that's fixed:
|
||||||
/*
|
/*
|
||||||
NS_WARN_IF_FALSE(aReflowState.ComputedISize() != NS_UNCONSTRAINEDSIZE,
|
NS_WARN_IF_FALSE(aReflowInput.ComputedISize() != NS_UNCONSTRAINEDSIZE,
|
||||||
"Unconstrained inline size; this should only result from "
|
"Unconstrained inline size; this should only result from "
|
||||||
"huge sizes (not intrinsic sizing w/ orthogonal flows)");
|
"huge sizes (not intrinsic sizing w/ orthogonal flows)");
|
||||||
*/
|
*/
|
||||||
*aIsDefinite = true;
|
*aIsDefinite = true;
|
||||||
return aReflowState.ComputedISize();
|
return aReflowInput.ComputedISize();
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord effectiveComputedBSize = GetEffectiveComputedBSize(aReflowState);
|
nscoord effectiveComputedBSize = GetEffectiveComputedBSize(aReflowInput);
|
||||||
if (effectiveComputedBSize != NS_INTRINSICSIZE) {
|
if (effectiveComputedBSize != NS_INTRINSICSIZE) {
|
||||||
// Row-oriented case (cross axis is block-axis), with fixed BSize:
|
// Row-oriented case (cross axis is block-axis), with fixed BSize:
|
||||||
*aIsDefinite = true;
|
*aIsDefinite = true;
|
||||||
@@ -3637,8 +3637,8 @@ nsFlexContainerFrame::ComputeCrossSize(const ReflowInput& aReflowState,
|
|||||||
// XXXdholbert Handle constrained-aAvailableBSizeForContent case here.
|
// XXXdholbert Handle constrained-aAvailableBSizeForContent case here.
|
||||||
*aIsDefinite = false;
|
*aIsDefinite = false;
|
||||||
return NS_CSS_MINMAX(aSumLineCrossSizes,
|
return NS_CSS_MINMAX(aSumLineCrossSizes,
|
||||||
aReflowState.ComputedMinBSize(),
|
aReflowInput.ComputedMinBSize(),
|
||||||
aReflowState.ComputedMaxBSize());
|
aReflowInput.ComputedMaxBSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -3680,10 +3680,10 @@ static nscoord
|
|||||||
ComputePhysicalAscentFromFlexRelativeAscent(
|
ComputePhysicalAscentFromFlexRelativeAscent(
|
||||||
nscoord aFlexRelativeAscent,
|
nscoord aFlexRelativeAscent,
|
||||||
nscoord aContentBoxCrossSize,
|
nscoord aContentBoxCrossSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker)
|
const FlexboxAxisTracker& aAxisTracker)
|
||||||
{
|
{
|
||||||
return aReflowState.ComputedPhysicalBorderPadding().top +
|
return aReflowInput.ComputedPhysicalBorderPadding().top +
|
||||||
PhysicalCoordFromFlexRelativeCoord(aFlexRelativeAscent,
|
PhysicalCoordFromFlexRelativeCoord(aFlexRelativeAscent,
|
||||||
aContentBoxCrossSize,
|
aContentBoxCrossSize,
|
||||||
aAxisTracker.GetCrossAxis());
|
aAxisTracker.GetCrossAxis());
|
||||||
@@ -3693,7 +3693,7 @@ void
|
|||||||
nsFlexContainerFrame::SizeItemInCrossAxis(
|
nsFlexContainerFrame::SizeItemInCrossAxis(
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const FlexboxAxisTracker& aAxisTracker,
|
const FlexboxAxisTracker& aAxisTracker,
|
||||||
ReflowInput& aChildReflowState,
|
ReflowInput& aChildReflowInput,
|
||||||
FlexItem& aItem)
|
FlexItem& aItem)
|
||||||
{
|
{
|
||||||
if (aAxisTracker.IsCrossAxisHorizontal()) {
|
if (aAxisTracker.IsCrossAxisHorizontal()) {
|
||||||
@@ -3708,7 +3708,7 @@ nsFlexContainerFrame::SizeItemInCrossAxis(
|
|||||||
// For now, we only expect to get here for items with an intrinsic aspect
|
// For now, we only expect to get here for items with an intrinsic aspect
|
||||||
// ratio; and for those items, we can just read the size off of the reflow
|
// ratio; and for those items, we can just read the size off of the reflow
|
||||||
// state, without performing reflow.
|
// state, without performing reflow.
|
||||||
aItem.SetCrossSize(aChildReflowState.ComputedWidth());
|
aItem.SetCrossSize(aChildReflowInput.ComputedWidth());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3721,13 +3721,13 @@ nsFlexContainerFrame::SizeItemInCrossAxis(
|
|||||||
// not imposing that height for *this* measuring reflow, so we need to
|
// not imposing that height for *this* measuring reflow, so we need to
|
||||||
// tell it to treat this reflow as a vertical resize (regardless of
|
// tell it to treat this reflow as a vertical resize (regardless of
|
||||||
// whether any of its ancestors are being resized).
|
// whether any of its ancestors are being resized).
|
||||||
aChildReflowState.SetVResize(true);
|
aChildReflowInput.SetVResize(true);
|
||||||
}
|
}
|
||||||
ReflowOutput childDesiredSize(aChildReflowState);
|
ReflowOutput childDesiredSize(aChildReflowInput);
|
||||||
nsReflowStatus childReflowStatus;
|
nsReflowStatus childReflowStatus;
|
||||||
const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
|
const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
|
||||||
ReflowChild(aItem.Frame(), aPresContext,
|
ReflowChild(aItem.Frame(), aPresContext,
|
||||||
childDesiredSize, aChildReflowState,
|
childDesiredSize, aChildReflowInput,
|
||||||
0, 0, flags, childReflowStatus);
|
0, 0, flags, childReflowStatus);
|
||||||
aItem.SetHadMeasuringReflow();
|
aItem.SetHadMeasuringReflow();
|
||||||
|
|
||||||
@@ -3741,7 +3741,7 @@ nsFlexContainerFrame::SizeItemInCrossAxis(
|
|||||||
// Tell the child we're done with its initial reflow.
|
// Tell the child we're done with its initial reflow.
|
||||||
// (Necessary for e.g. GetBaseline() to work below w/out asserting)
|
// (Necessary for e.g. GetBaseline() to work below w/out asserting)
|
||||||
FinishReflowChild(aItem.Frame(), aPresContext,
|
FinishReflowChild(aItem.Frame(), aPresContext,
|
||||||
childDesiredSize, &aChildReflowState, 0, 0, flags);
|
childDesiredSize, &aChildReflowInput, 0, 0, flags);
|
||||||
|
|
||||||
// Save the sizing info that we learned from this reflow
|
// Save the sizing info that we learned from this reflow
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
@@ -3808,16 +3808,16 @@ FlexLine::PositionItemsInCrossAxis(nscoord aLineStartPosition,
|
|||||||
void
|
void
|
||||||
nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
|
nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsFlexContainerFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsFlexContainerFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
MOZ_LOG(gFlexContainerLog, LogLevel::Debug,
|
MOZ_LOG(gFlexContainerLog, LogLevel::Debug,
|
||||||
("Reflow() for nsFlexContainerFrame %p\n", this));
|
("Reflow() for nsFlexContainerFrame %p\n", this));
|
||||||
|
|
||||||
if (IsFrameTreeTooDeep(aReflowState, aDesiredSize, aStatus)) {
|
if (IsFrameTreeTooDeep(aReflowInput, aDesiredSize, aStatus)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3826,7 +3826,7 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// set and have block-size:auto. (There are actually other cases, too -- e.g. if
|
// set and have block-size:auto. (There are actually other cases, too -- e.g. if
|
||||||
// our parent is itself a block-dir flex container and we're flexible -- but
|
// our parent is itself a block-dir flex container and we're flexible -- but
|
||||||
// we'll let our ancestors handle those sorts of cases.)
|
// we'll let our ancestors handle those sorts of cases.)
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
const nsStylePosition* stylePos = StylePosition();
|
const nsStylePosition* stylePos = StylePosition();
|
||||||
const nsStyleCoord& bsize = stylePos->BSize(wm);
|
const nsStyleCoord& bsize = stylePos->BSize(wm);
|
||||||
if (bsize.HasPercent() ||
|
if (bsize.HasPercent() ||
|
||||||
@@ -3855,32 +3855,32 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
SortChildrenIfNeeded<IsOrderLEQWithDOMFallback>();
|
SortChildrenIfNeeded<IsOrderLEQWithDOMFallback>();
|
||||||
}
|
}
|
||||||
|
|
||||||
const FlexboxAxisTracker axisTracker(this, aReflowState.GetWritingMode());
|
const FlexboxAxisTracker axisTracker(this, aReflowInput.GetWritingMode());
|
||||||
|
|
||||||
// If we're being fragmented into a constrained BSize, then subtract off
|
// If we're being fragmented into a constrained BSize, then subtract off
|
||||||
// borderpadding BStart from that constrained BSize, to get the available
|
// borderpadding BStart from that constrained BSize, to get the available
|
||||||
// BSize for our content box. (No need to subtract the borderpadding BStart
|
// BSize for our content box. (No need to subtract the borderpadding BStart
|
||||||
// if we're already skipping it via GetLogicalSkipSides, though.)
|
// if we're already skipping it via GetLogicalSkipSides, though.)
|
||||||
nscoord availableBSizeForContent = aReflowState.AvailableBSize();
|
nscoord availableBSizeForContent = aReflowInput.AvailableBSize();
|
||||||
if (availableBSizeForContent != NS_UNCONSTRAINEDSIZE &&
|
if (availableBSizeForContent != NS_UNCONSTRAINEDSIZE &&
|
||||||
!(GetLogicalSkipSides(&aReflowState).BStart())) {
|
!(GetLogicalSkipSides(&aReflowInput).BStart())) {
|
||||||
availableBSizeForContent -=
|
availableBSizeForContent -=
|
||||||
aReflowState.ComputedLogicalBorderPadding().BStart(wm);
|
aReflowInput.ComputedLogicalBorderPadding().BStart(wm);
|
||||||
// (Don't let that push availableBSizeForContent below zero, though):
|
// (Don't let that push availableBSizeForContent below zero, though):
|
||||||
availableBSizeForContent = std::max(availableBSizeForContent, 0);
|
availableBSizeForContent = std::max(availableBSizeForContent, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord contentBoxMainSize = GetMainSizeFromReflowState(aReflowState,
|
nscoord contentBoxMainSize = GetMainSizeFromReflowInput(aReflowInput,
|
||||||
axisTracker);
|
axisTracker);
|
||||||
|
|
||||||
AutoTArray<StrutInfo, 1> struts;
|
AutoTArray<StrutInfo, 1> struts;
|
||||||
DoFlexLayout(aPresContext, aDesiredSize, aReflowState, aStatus,
|
DoFlexLayout(aPresContext, aDesiredSize, aReflowInput, aStatus,
|
||||||
contentBoxMainSize, availableBSizeForContent,
|
contentBoxMainSize, availableBSizeForContent,
|
||||||
struts, axisTracker);
|
struts, axisTracker);
|
||||||
|
|
||||||
if (!struts.IsEmpty()) {
|
if (!struts.IsEmpty()) {
|
||||||
// We're restarting flex layout, with new knowledge of collapsed items.
|
// We're restarting flex layout, with new knowledge of collapsed items.
|
||||||
DoFlexLayout(aPresContext, aDesiredSize, aReflowState, aStatus,
|
DoFlexLayout(aPresContext, aDesiredSize, aReflowInput, aStatus,
|
||||||
contentBoxMainSize, availableBSizeForContent,
|
contentBoxMainSize, availableBSizeForContent,
|
||||||
struts, axisTracker);
|
struts, axisTracker);
|
||||||
}
|
}
|
||||||
@@ -3951,7 +3951,7 @@ private:
|
|||||||
void
|
void
|
||||||
nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
nscoord aContentBoxMainSize,
|
nscoord aContentBoxMainSize,
|
||||||
nscoord aAvailableBSizeForContent,
|
nscoord aAvailableBSizeForContent,
|
||||||
@@ -3963,13 +3963,13 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||||||
LinkedList<FlexLine> lines;
|
LinkedList<FlexLine> lines;
|
||||||
AutoFlexLineListClearer cleanupLines(lines);
|
AutoFlexLineListClearer cleanupLines(lines);
|
||||||
|
|
||||||
GenerateFlexLines(aPresContext, aReflowState,
|
GenerateFlexLines(aPresContext, aReflowInput,
|
||||||
aContentBoxMainSize,
|
aContentBoxMainSize,
|
||||||
aAvailableBSizeForContent,
|
aAvailableBSizeForContent,
|
||||||
aStruts, aAxisTracker, lines);
|
aStruts, aAxisTracker, lines);
|
||||||
|
|
||||||
aContentBoxMainSize =
|
aContentBoxMainSize =
|
||||||
ResolveFlexContainerMainSize(aReflowState, aAxisTracker,
|
ResolveFlexContainerMainSize(aReflowInput, aAxisTracker,
|
||||||
aContentBoxMainSize, aAvailableBSizeForContent,
|
aContentBoxMainSize, aAvailableBSizeForContent,
|
||||||
lines.getFirst(), aStatus);
|
lines.getFirst(), aStatus);
|
||||||
|
|
||||||
@@ -3999,21 +3999,21 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
WritingMode wm = item->Frame()->GetWritingMode();
|
WritingMode wm = item->Frame()->GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.ComputedSize(wm);
|
LogicalSize availSize = aReflowInput.ComputedSize(wm);
|
||||||
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
ReflowInput childReflowState(aPresContext, aReflowState,
|
ReflowInput childReflowInput(aPresContext, aReflowInput,
|
||||||
item->Frame(), availSize);
|
item->Frame(), availSize);
|
||||||
if (!sizeOverride) {
|
if (!sizeOverride) {
|
||||||
// Directly override the computed main-size, by tweaking reflow state:
|
// Directly override the computed main-size, by tweaking reflow state:
|
||||||
if (aAxisTracker.IsMainAxisHorizontal()) {
|
if (aAxisTracker.IsMainAxisHorizontal()) {
|
||||||
childReflowState.SetComputedWidth(item->GetMainSize());
|
childReflowInput.SetComputedWidth(item->GetMainSize());
|
||||||
} else {
|
} else {
|
||||||
childReflowState.SetComputedHeight(item->GetMainSize());
|
childReflowInput.SetComputedHeight(item->GetMainSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SizeItemInCrossAxis(aPresContext, aAxisTracker,
|
SizeItemInCrossAxis(aPresContext, aAxisTracker,
|
||||||
childReflowState, *item);
|
childReflowInput, *item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Now that we've finished with this line's items, size the line itself:
|
// Now that we've finished with this line's items, size the line itself:
|
||||||
@@ -4023,14 +4023,14 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
bool isCrossSizeDefinite;
|
bool isCrossSizeDefinite;
|
||||||
const nscoord contentBoxCrossSize =
|
const nscoord contentBoxCrossSize =
|
||||||
ComputeCrossSize(aReflowState, aAxisTracker, sumLineCrossSizes,
|
ComputeCrossSize(aReflowInput, aAxisTracker, sumLineCrossSizes,
|
||||||
aAvailableBSizeForContent, &isCrossSizeDefinite, aStatus);
|
aAvailableBSizeForContent, &isCrossSizeDefinite, aStatus);
|
||||||
|
|
||||||
// Set up state for cross-axis alignment, at a high level (outside the
|
// Set up state for cross-axis alignment, at a high level (outside the
|
||||||
// scope of a particular flex line)
|
// scope of a particular flex line)
|
||||||
CrossAxisPositionTracker
|
CrossAxisPositionTracker
|
||||||
crossAxisPosnTracker(lines.getFirst(),
|
crossAxisPosnTracker(lines.getFirst(),
|
||||||
aReflowState.mStylePosition->ComputedAlignContent(),
|
aReflowInput.mStylePosition->ComputedAlignContent(),
|
||||||
contentBoxCrossSize, isCrossSizeDefinite,
|
contentBoxCrossSize, isCrossSizeDefinite,
|
||||||
aAxisTracker);
|
aAxisTracker);
|
||||||
|
|
||||||
@@ -4061,14 +4061,14 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||||||
flexContainerAscent =
|
flexContainerAscent =
|
||||||
ComputePhysicalAscentFromFlexRelativeAscent(
|
ComputePhysicalAscentFromFlexRelativeAscent(
|
||||||
crossAxisPosnTracker.GetPosition() + firstLineBaselineOffset,
|
crossAxisPosnTracker.GetPosition() + firstLineBaselineOffset,
|
||||||
contentBoxCrossSize, aReflowState, aAxisTracker);
|
contentBoxCrossSize, aReflowInput, aAxisTracker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto justifyContent = IsLegacyBox(aReflowState.mStyleDisplay,
|
const auto justifyContent = IsLegacyBox(aReflowInput.mStyleDisplay,
|
||||||
mStyleContext) ?
|
mStyleContext) ?
|
||||||
ConvertLegacyStyleToJustifyContent(StyleXUL()) :
|
ConvertLegacyStyleToJustifyContent(StyleXUL()) :
|
||||||
aReflowState.mStylePosition->ComputedJustifyContent();
|
aReflowInput.mStylePosition->ComputedJustifyContent();
|
||||||
|
|
||||||
for (FlexLine* line = lines.getFirst(); line; line = line->getNext()) {
|
for (FlexLine* line = lines.getFirst(); line; line = line->getNext()) {
|
||||||
// Main-Axis Alignment - Flexbox spec section 9.5
|
// Main-Axis Alignment - Flexbox spec section 9.5
|
||||||
@@ -4099,15 +4099,15 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||||||
flexContainerAscent =
|
flexContainerAscent =
|
||||||
ComputePhysicalAscentFromFlexRelativeAscent(
|
ComputePhysicalAscentFromFlexRelativeAscent(
|
||||||
crossAxisPosnTracker.GetPosition() - lastLineBaselineOffset,
|
crossAxisPosnTracker.GetPosition() - lastLineBaselineOffset,
|
||||||
contentBoxCrossSize, aReflowState, aAxisTracker);
|
contentBoxCrossSize, aReflowInput, aAxisTracker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Before giving each child a final reflow, calculate the origin of the
|
// Before giving each child a final reflow, calculate the origin of the
|
||||||
// flex container's content box (with respect to its border-box), so that
|
// flex container's content box (with respect to its border-box), so that
|
||||||
// we can compute our flex item's final positions.
|
// we can compute our flex item's final positions.
|
||||||
WritingMode flexWM = aReflowState.GetWritingMode();
|
WritingMode flexWM = aReflowInput.GetWritingMode();
|
||||||
LogicalMargin containerBP = aReflowState.ComputedLogicalBorderPadding();
|
LogicalMargin containerBP = aReflowInput.ComputedLogicalBorderPadding();
|
||||||
|
|
||||||
// Unconditionally skip block-end border & padding for now, regardless of
|
// Unconditionally skip block-end border & padding for now, regardless of
|
||||||
// writing-mode/GetLogicalSkipSides. We add it lower down, after we've
|
// writing-mode/GetLogicalSkipSides. We add it lower down, after we've
|
||||||
@@ -4115,7 +4115,7 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||||||
// we're fragmented).
|
// we're fragmented).
|
||||||
const nscoord blockEndContainerBP = containerBP.BEnd(flexWM);
|
const nscoord blockEndContainerBP = containerBP.BEnd(flexWM);
|
||||||
const LogicalSides skipSides =
|
const LogicalSides skipSides =
|
||||||
GetLogicalSkipSides(&aReflowState) | LogicalSides(eLogicalSideBitsBEnd);
|
GetLogicalSkipSides(&aReflowInput) | LogicalSides(eLogicalSideBitsBEnd);
|
||||||
containerBP.ApplySkipSides(skipSides);
|
containerBP.ApplySkipSides(skipSides);
|
||||||
|
|
||||||
const LogicalPoint containerContentBoxOrigin(flexWM,
|
const LogicalPoint containerContentBoxOrigin(flexWM,
|
||||||
@@ -4126,7 +4126,7 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||||||
LogicalSize logSize =
|
LogicalSize logSize =
|
||||||
aAxisTracker.LogicalSizeFromFlexRelativeSizes(aContentBoxMainSize,
|
aAxisTracker.LogicalSizeFromFlexRelativeSizes(aContentBoxMainSize,
|
||||||
contentBoxCrossSize);
|
contentBoxCrossSize);
|
||||||
logSize += aReflowState.ComputedLogicalBorderPadding().Size(flexWM);
|
logSize += aReflowInput.ComputedLogicalBorderPadding().Size(flexWM);
|
||||||
nsSize containerSize = logSize.GetPhysicalSize(flexWM);
|
nsSize containerSize = logSize.GetPhysicalSize(flexWM);
|
||||||
|
|
||||||
// FINAL REFLOW: Give each child frame another chance to reflow, now that
|
// FINAL REFLOW: Give each child frame another chance to reflow, now that
|
||||||
@@ -4169,13 +4169,13 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||||||
// it's now "definite"). Let's just make sure it's at the right
|
// it's now "definite"). Let's just make sure it's at the right
|
||||||
// position.
|
// position.
|
||||||
itemNeedsReflow = false;
|
itemNeedsReflow = false;
|
||||||
MoveFlexItemToFinalPosition(aReflowState, *item, framePos,
|
MoveFlexItemToFinalPosition(aReflowInput, *item, framePos,
|
||||||
containerSize);
|
containerSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (itemNeedsReflow) {
|
if (itemNeedsReflow) {
|
||||||
ReflowFlexItem(aPresContext, aAxisTracker, aReflowState,
|
ReflowFlexItem(aPresContext, aAxisTracker, aReflowInput,
|
||||||
*item, framePos, containerSize);
|
*item, framePos, containerSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4229,10 +4229,10 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||||||
nscoord desiredBSizeWithBEndBP =
|
nscoord desiredBSizeWithBEndBP =
|
||||||
desiredSizeInFlexWM.BSize(flexWM) + blockEndContainerBP;
|
desiredSizeInFlexWM.BSize(flexWM) + blockEndContainerBP;
|
||||||
|
|
||||||
if (aReflowState.AvailableBSize() == NS_UNCONSTRAINEDSIZE ||
|
if (aReflowInput.AvailableBSize() == NS_UNCONSTRAINEDSIZE ||
|
||||||
desiredSizeInFlexWM.BSize(flexWM) == 0 ||
|
desiredSizeInFlexWM.BSize(flexWM) == 0 ||
|
||||||
desiredBSizeWithBEndBP <= aReflowState.AvailableBSize() ||
|
desiredBSizeWithBEndBP <= aReflowInput.AvailableBSize() ||
|
||||||
aReflowState.ComputedBSize() == NS_INTRINSICSIZE) {
|
aReflowInput.ComputedBSize() == NS_INTRINSICSIZE) {
|
||||||
// Update desired height to include block-end border/padding
|
// Update desired height to include block-end border/padding
|
||||||
desiredSizeInFlexWM.BSize(flexWM) = desiredBSizeWithBEndBP;
|
desiredSizeInFlexWM.BSize(flexWM) = desiredBSizeWithBEndBP;
|
||||||
} else {
|
} else {
|
||||||
@@ -4251,19 +4251,19 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize,
|
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize,
|
||||||
aReflowState, aStatus);
|
aReflowInput, aStatus);
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize)
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsFlexContainerFrame::MoveFlexItemToFinalPosition(
|
nsFlexContainerFrame::MoveFlexItemToFinalPosition(
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
const FlexItem& aItem,
|
const FlexItem& aItem,
|
||||||
LogicalPoint& aFramePos,
|
LogicalPoint& aFramePos,
|
||||||
const nsSize& aContainerSize)
|
const nsSize& aContainerSize)
|
||||||
{
|
{
|
||||||
WritingMode outerWM = aReflowState.GetWritingMode();
|
WritingMode outerWM = aReflowInput.GetWritingMode();
|
||||||
|
|
||||||
// If item is relpos, look up its offsets (cached from prev reflow)
|
// If item is relpos, look up its offsets (cached from prev reflow)
|
||||||
LogicalMargin logicalOffsets(outerWM);
|
LogicalMargin logicalOffsets(outerWM);
|
||||||
@@ -4285,16 +4285,16 @@ nsFlexContainerFrame::MoveFlexItemToFinalPosition(
|
|||||||
void
|
void
|
||||||
nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
||||||
const FlexboxAxisTracker& aAxisTracker,
|
const FlexboxAxisTracker& aAxisTracker,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
const FlexItem& aItem,
|
const FlexItem& aItem,
|
||||||
LogicalPoint& aFramePos,
|
LogicalPoint& aFramePos,
|
||||||
const nsSize& aContainerSize)
|
const nsSize& aContainerSize)
|
||||||
{
|
{
|
||||||
WritingMode outerWM = aReflowState.GetWritingMode();
|
WritingMode outerWM = aReflowInput.GetWritingMode();
|
||||||
WritingMode wm = aItem.Frame()->GetWritingMode();
|
WritingMode wm = aItem.Frame()->GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.ComputedSize(wm);
|
LogicalSize availSize = aReflowInput.ComputedSize(wm);
|
||||||
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
ReflowInput childReflowState(aPresContext, aReflowState,
|
ReflowInput childReflowInput(aPresContext, aReflowInput,
|
||||||
aItem.Frame(), availSize);
|
aItem.Frame(), availSize);
|
||||||
|
|
||||||
// Keep track of whether we've overriden the child's computed height
|
// Keep track of whether we've overriden the child's computed height
|
||||||
@@ -4304,10 +4304,10 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Override computed main-size
|
// Override computed main-size
|
||||||
if (aAxisTracker.IsMainAxisHorizontal()) {
|
if (aAxisTracker.IsMainAxisHorizontal()) {
|
||||||
childReflowState.SetComputedWidth(aItem.GetMainSize());
|
childReflowInput.SetComputedWidth(aItem.GetMainSize());
|
||||||
didOverrideComputedWidth = true;
|
didOverrideComputedWidth = true;
|
||||||
} else {
|
} else {
|
||||||
childReflowState.SetComputedHeight(aItem.GetMainSize());
|
childReflowInput.SetComputedHeight(aItem.GetMainSize());
|
||||||
didOverrideComputedHeight = true;
|
didOverrideComputedHeight = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4323,10 +4323,10 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
|||||||
if (aItem.IsStretched() ||
|
if (aItem.IsStretched() ||
|
||||||
aItem.HasIntrinsicRatio()) {
|
aItem.HasIntrinsicRatio()) {
|
||||||
if (aAxisTracker.IsCrossAxisHorizontal()) {
|
if (aAxisTracker.IsCrossAxisHorizontal()) {
|
||||||
childReflowState.SetComputedWidth(aItem.GetCrossSize());
|
childReflowInput.SetComputedWidth(aItem.GetCrossSize());
|
||||||
didOverrideComputedWidth = true;
|
didOverrideComputedWidth = true;
|
||||||
} else {
|
} else {
|
||||||
childReflowState.SetComputedHeight(aItem.GetCrossSize());
|
childReflowInput.SetComputedHeight(aItem.GetCrossSize());
|
||||||
didOverrideComputedHeight = true;
|
didOverrideComputedHeight = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4348,20 +4348,20 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
|||||||
// sets mHResize whenever our computed width has changed since the
|
// sets mHResize whenever our computed width has changed since the
|
||||||
// previous reflow. Still, it's nice for symmetry, and it may become
|
// previous reflow. Still, it's nice for symmetry, and it may become
|
||||||
// necessary once we support orthogonal flows.)
|
// necessary once we support orthogonal flows.)
|
||||||
childReflowState.SetHResize(true);
|
childReflowInput.SetHResize(true);
|
||||||
}
|
}
|
||||||
if (didOverrideComputedHeight) {
|
if (didOverrideComputedHeight) {
|
||||||
childReflowState.SetVResize(true);
|
childReflowInput.SetVResize(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// NOTE: Be very careful about doing anything else with childReflowState
|
// NOTE: Be very careful about doing anything else with childReflowInput
|
||||||
// after this point, because some of its methods (e.g. SetComputedWidth)
|
// after this point, because some of its methods (e.g. SetComputedWidth)
|
||||||
// internally call InitResizeFlags and stomp on mVResize & mHResize.
|
// internally call InitResizeFlags and stomp on mVResize & mHResize.
|
||||||
|
|
||||||
ReflowOutput childDesiredSize(childReflowState);
|
ReflowOutput childDesiredSize(childReflowInput);
|
||||||
nsReflowStatus childReflowStatus;
|
nsReflowStatus childReflowStatus;
|
||||||
ReflowChild(aItem.Frame(), aPresContext,
|
ReflowChild(aItem.Frame(), aPresContext,
|
||||||
childDesiredSize, childReflowState,
|
childDesiredSize, childReflowInput,
|
||||||
outerWM, aFramePos, aContainerSize,
|
outerWM, aFramePos, aContainerSize,
|
||||||
0, childReflowStatus);
|
0, childReflowStatus);
|
||||||
|
|
||||||
@@ -4374,13 +4374,13 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
|||||||
"should be complete");
|
"should be complete");
|
||||||
|
|
||||||
LogicalMargin offsets =
|
LogicalMargin offsets =
|
||||||
childReflowState.ComputedLogicalOffsets().ConvertTo(outerWM, wm);
|
childReflowInput.ComputedLogicalOffsets().ConvertTo(outerWM, wm);
|
||||||
ReflowInput::ApplyRelativePositioning(aItem.Frame(), outerWM,
|
ReflowInput::ApplyRelativePositioning(aItem.Frame(), outerWM,
|
||||||
offsets, &aFramePos,
|
offsets, &aFramePos,
|
||||||
aContainerSize);
|
aContainerSize);
|
||||||
|
|
||||||
FinishReflowChild(aItem.Frame(), aPresContext,
|
FinishReflowChild(aItem.Frame(), aPresContext,
|
||||||
childDesiredSize, &childReflowState,
|
childDesiredSize, &childReflowInput,
|
||||||
outerWM, aFramePos, aContainerSize, 0);
|
outerWM, aFramePos, aContainerSize, 0);
|
||||||
|
|
||||||
// Save the first child's ascent; it may establish container's baseline.
|
// Save the first child's ascent; it may establish container's baseline.
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nscoord
|
virtual nscoord
|
||||||
@@ -102,7 +102,7 @@ protected:
|
|||||||
*/
|
*/
|
||||||
void DoFlexLayout(nsPresContext* aPresContext,
|
void DoFlexLayout(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
nscoord aContentBoxMainSize,
|
nscoord aContentBoxMainSize,
|
||||||
nscoord aAvailableBSizeForContent,
|
nscoord aAvailableBSizeForContent,
|
||||||
@@ -139,7 +139,7 @@ protected:
|
|||||||
*/
|
*/
|
||||||
mozilla::UniquePtr<FlexItem> GenerateFlexItemForChild(nsPresContext* aPresContext,
|
mozilla::UniquePtr<FlexItem> GenerateFlexItemForChild(nsPresContext* aPresContext,
|
||||||
nsIFrame* aChildFrame,
|
nsIFrame* aChildFrame,
|
||||||
const ReflowInput& aParentReflowState,
|
const ReflowInput& aParentReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker);
|
const FlexboxAxisTracker& aAxisTracker);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -151,7 +151,7 @@ protected:
|
|||||||
nscoord MeasureFlexItemContentHeight(nsPresContext* aPresContext,
|
nscoord MeasureFlexItemContentHeight(nsPresContext* aPresContext,
|
||||||
FlexItem& aFlexItem,
|
FlexItem& aFlexItem,
|
||||||
bool aForceVerticalResizeForMeasuringReflow,
|
bool aForceVerticalResizeForMeasuringReflow,
|
||||||
const ReflowInput& aParentReflowState);
|
const ReflowInput& aParentReflowInput);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method resolves an "auto" flex-basis and/or min-main-size value
|
* This method resolves an "auto" flex-basis and/or min-main-size value
|
||||||
@@ -160,7 +160,7 @@ protected:
|
|||||||
*/
|
*/
|
||||||
void ResolveAutoFlexBasisAndMinSize(nsPresContext* aPresContext,
|
void ResolveAutoFlexBasisAndMinSize(nsPresContext* aPresContext,
|
||||||
FlexItem& aFlexItem,
|
FlexItem& aFlexItem,
|
||||||
const ReflowInput& aItemReflowState,
|
const ReflowInput& aItemReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker);
|
const FlexboxAxisTracker& aAxisTracker);
|
||||||
|
|
||||||
// Creates FlexItems for all of our child frames, arranged in a list of
|
// Creates FlexItems for all of our child frames, arranged in a list of
|
||||||
@@ -168,17 +168,17 @@ protected:
|
|||||||
// return value has to be |nsresult|, in case we have to reflow a child
|
// return value has to be |nsresult|, in case we have to reflow a child
|
||||||
// to establish its flex base size and that reflow fails.
|
// to establish its flex base size and that reflow fails.
|
||||||
void GenerateFlexLines(nsPresContext* aPresContext,
|
void GenerateFlexLines(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nscoord aContentBoxMainSize,
|
nscoord aContentBoxMainSize,
|
||||||
nscoord aAvailableBSizeForContent,
|
nscoord aAvailableBSizeForContent,
|
||||||
const nsTArray<StrutInfo>& aStruts,
|
const nsTArray<StrutInfo>& aStruts,
|
||||||
const FlexboxAxisTracker& aAxisTracker,
|
const FlexboxAxisTracker& aAxisTracker,
|
||||||
mozilla::LinkedList<FlexLine>& aLines);
|
mozilla::LinkedList<FlexLine>& aLines);
|
||||||
|
|
||||||
nscoord GetMainSizeFromReflowState(const ReflowInput& aReflowState,
|
nscoord GetMainSizeFromReflowInput(const ReflowInput& aReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker);
|
const FlexboxAxisTracker& aAxisTracker);
|
||||||
|
|
||||||
nscoord ComputeCrossSize(const ReflowInput& aReflowState,
|
nscoord ComputeCrossSize(const ReflowInput& aReflowInput,
|
||||||
const FlexboxAxisTracker& aAxisTracker,
|
const FlexboxAxisTracker& aAxisTracker,
|
||||||
nscoord aSumLineCrossSizes,
|
nscoord aSumLineCrossSizes,
|
||||||
nscoord aAvailableBSizeForContent,
|
nscoord aAvailableBSizeForContent,
|
||||||
@@ -187,7 +187,7 @@ protected:
|
|||||||
|
|
||||||
void SizeItemInCrossAxis(nsPresContext* aPresContext,
|
void SizeItemInCrossAxis(nsPresContext* aPresContext,
|
||||||
const FlexboxAxisTracker& aAxisTracker,
|
const FlexboxAxisTracker& aAxisTracker,
|
||||||
ReflowInput& aChildReflowState,
|
ReflowInput& aChildReflowInput,
|
||||||
FlexItem& aItem);
|
FlexItem& aItem);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -198,14 +198,14 @@ protected:
|
|||||||
* for the flex item at the correct size, and hence can skip its final reflow
|
* for the flex item at the correct size, and hence can skip its final reflow
|
||||||
* (but still need to move it to the right final position).
|
* (but still need to move it to the right final position).
|
||||||
*
|
*
|
||||||
* @param aReflowState The flex container's reflow state.
|
* @param aReflowInput The flex container's reflow state.
|
||||||
* @param aItem The flex item whose frame should be moved.
|
* @param aItem The flex item whose frame should be moved.
|
||||||
* @param aFramePos The position where the flex item's frame should
|
* @param aFramePos The position where the flex item's frame should
|
||||||
* be placed. (pre-relative positioning)
|
* be placed. (pre-relative positioning)
|
||||||
* @param aContainerSize The flex container's size (required by some methods
|
* @param aContainerSize The flex container's size (required by some methods
|
||||||
* that we call, to interpret aFramePos correctly).
|
* that we call, to interpret aFramePos correctly).
|
||||||
*/
|
*/
|
||||||
void MoveFlexItemToFinalPosition(const ReflowInput& aReflowState,
|
void MoveFlexItemToFinalPosition(const ReflowInput& aReflowInput,
|
||||||
const FlexItem& aItem,
|
const FlexItem& aItem,
|
||||||
mozilla::LogicalPoint& aFramePos,
|
mozilla::LogicalPoint& aFramePos,
|
||||||
const nsSize& aContainerSize);
|
const nsSize& aContainerSize);
|
||||||
@@ -215,7 +215,7 @@ protected:
|
|||||||
*
|
*
|
||||||
* @param aPresContext The presentation context being used in reflow.
|
* @param aPresContext The presentation context being used in reflow.
|
||||||
* @param aAxisTracker A FlexboxAxisTracker with the flex container's axes.
|
* @param aAxisTracker A FlexboxAxisTracker with the flex container's axes.
|
||||||
* @param aReflowState The flex container's reflow state.
|
* @param aReflowInput The flex container's reflow state.
|
||||||
* @param aItem The flex item to be reflowed.
|
* @param aItem The flex item to be reflowed.
|
||||||
* @param aFramePos The position where the flex item's frame should
|
* @param aFramePos The position where the flex item's frame should
|
||||||
* be placed. (pre-relative positioning)
|
* be placed. (pre-relative positioning)
|
||||||
@@ -224,7 +224,7 @@ protected:
|
|||||||
*/
|
*/
|
||||||
void ReflowFlexItem(nsPresContext* aPresContext,
|
void ReflowFlexItem(nsPresContext* aPresContext,
|
||||||
const FlexboxAxisTracker& aAxisTracker,
|
const FlexboxAxisTracker& aAxisTracker,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
const FlexItem& aItem,
|
const FlexItem& aItem,
|
||||||
mozilla::LogicalPoint& aFramePos,
|
mozilla::LogicalPoint& aFramePos,
|
||||||
const nsSize& aContainerSize);
|
const nsSize& aContainerSize);
|
||||||
|
|||||||
@@ -562,11 +562,11 @@ nsAutoFloatManager::~nsAutoFloatManager()
|
|||||||
printf("restoring old float manager %p\n", mOld);
|
printf("restoring old float manager %p\n", mOld);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mReflowState.mFloatManager = mOld;
|
mReflowInput.mFloatManager = mOld;
|
||||||
|
|
||||||
#ifdef NOISY_FLOATMANAGER
|
#ifdef NOISY_FLOATMANAGER
|
||||||
if (mOld) {
|
if (mOld) {
|
||||||
static_cast<nsFrame *>(mReflowState.frame)->ListTag(stdout);
|
static_cast<nsFrame *>(mReflowInput.frame)->ListTag(stdout);
|
||||||
printf(": space-manager %p after reflow\n", mOld);
|
printf(": space-manager %p after reflow\n", mOld);
|
||||||
mOld->List(stdout);
|
mOld->List(stdout);
|
||||||
}
|
}
|
||||||
@@ -583,17 +583,17 @@ nsAutoFloatManager::CreateFloatManager(nsPresContext *aPresContext)
|
|||||||
// state. `Remember' the old float manager so we can restore it
|
// state. `Remember' the old float manager so we can restore it
|
||||||
// later.
|
// later.
|
||||||
mNew = new nsFloatManager(aPresContext->PresShell(),
|
mNew = new nsFloatManager(aPresContext->PresShell(),
|
||||||
mReflowState.GetWritingMode());
|
mReflowInput.GetWritingMode());
|
||||||
if (! mNew)
|
if (! mNew)
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
#ifdef NOISY_FLOATMANAGER
|
#ifdef NOISY_FLOATMANAGER
|
||||||
printf("constructed new float manager %p (replacing %p)\n",
|
printf("constructed new float manager %p (replacing %p)\n",
|
||||||
mNew, mReflowState.mFloatManager);
|
mNew, mReflowInput.mFloatManager);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Set the float manager in the existing reflow state
|
// Set the float manager in the existing reflow state
|
||||||
mOld = mReflowState.mFloatManager;
|
mOld = mReflowInput.mFloatManager;
|
||||||
mReflowState.mFloatManager = mNew;
|
mReflowInput.mFloatManager = mNew;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -376,8 +376,8 @@ class nsAutoFloatManager {
|
|||||||
using ReflowInput = mozilla::ReflowInput;
|
using ReflowInput = mozilla::ReflowInput;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit nsAutoFloatManager(ReflowInput& aReflowState)
|
explicit nsAutoFloatManager(ReflowInput& aReflowInput)
|
||||||
: mReflowState(aReflowState),
|
: mReflowInput(aReflowInput),
|
||||||
mNew(nullptr),
|
mNew(nullptr),
|
||||||
mOld(nullptr) {}
|
mOld(nullptr) {}
|
||||||
|
|
||||||
@@ -392,7 +392,7 @@ public:
|
|||||||
CreateFloatManager(nsPresContext *aPresContext);
|
CreateFloatManager(nsPresContext *aPresContext);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ReflowInput &mReflowState;
|
ReflowInput &mReflowInput;
|
||||||
nsFloatManager *mNew;
|
nsFloatManager *mNew;
|
||||||
nsFloatManager *mOld;
|
nsFloatManager *mOld;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,9 +31,9 @@ nsFontInflationData::FindFontInflationDataFor(const nsIFrame *aFrame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool
|
/* static */ bool
|
||||||
nsFontInflationData::UpdateFontInflationDataISizeFor(const ReflowInput& aReflowState)
|
nsFontInflationData::UpdateFontInflationDataISizeFor(const ReflowInput& aReflowInput)
|
||||||
{
|
{
|
||||||
nsIFrame *bfc = aReflowState.mFrame;
|
nsIFrame *bfc = aReflowInput.mFrame;
|
||||||
NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
|
NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
|
||||||
"should have been given a flow root");
|
"should have been given a flow root");
|
||||||
FrameProperties bfcProps(bfc->Properties());
|
FrameProperties bfcProps(bfc->Properties());
|
||||||
@@ -50,7 +50,7 @@ nsFontInflationData::UpdateFontInflationDataISizeFor(const ReflowInput& aReflowS
|
|||||||
oldInflationEnabled = true; /* not relevant */
|
oldInflationEnabled = true; /* not relevant */
|
||||||
}
|
}
|
||||||
|
|
||||||
data->UpdateISize(aReflowState);
|
data->UpdateISize(aReflowInput);
|
||||||
|
|
||||||
if (oldInflationEnabled != data->mInflationEnabled)
|
if (oldInflationEnabled != data->mInflationEnabled)
|
||||||
return true;
|
return true;
|
||||||
@@ -121,12 +121,12 @@ NearestCommonAncestorFirstInFlow(nsIFrame *aFrame1, nsIFrame *aFrame2,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nscoord
|
static nscoord
|
||||||
ComputeDescendantISize(const ReflowInput& aAncestorReflowState,
|
ComputeDescendantISize(const ReflowInput& aAncestorReflowInput,
|
||||||
nsIFrame *aDescendantFrame)
|
nsIFrame *aDescendantFrame)
|
||||||
{
|
{
|
||||||
nsIFrame *ancestorFrame = aAncestorReflowState.mFrame->FirstInFlow();
|
nsIFrame *ancestorFrame = aAncestorReflowInput.mFrame->FirstInFlow();
|
||||||
if (aDescendantFrame == ancestorFrame) {
|
if (aDescendantFrame == ancestorFrame) {
|
||||||
return aAncestorReflowState.ComputedISize();
|
return aAncestorReflowInput.ComputedISize();
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoTArray<nsIFrame*, 16> frames;
|
AutoTArray<nsIFrame*, 16> frames;
|
||||||
@@ -141,39 +141,39 @@ ComputeDescendantISize(const ReflowInput& aAncestorReflowState,
|
|||||||
// occasionally cause problems when writing tests on desktop.
|
// occasionally cause problems when writing tests on desktop.
|
||||||
|
|
||||||
uint32_t len = frames.Length();
|
uint32_t len = frames.Length();
|
||||||
ReflowInput *reflowStates = static_cast<ReflowInput*>
|
ReflowInput *reflowInputs = static_cast<ReflowInput*>
|
||||||
(moz_xmalloc(sizeof(ReflowInput) * len));
|
(moz_xmalloc(sizeof(ReflowInput) * len));
|
||||||
nsPresContext *presContext = aDescendantFrame->PresContext();
|
nsPresContext *presContext = aDescendantFrame->PresContext();
|
||||||
for (uint32_t i = 0; i < len; ++i) {
|
for (uint32_t i = 0; i < len; ++i) {
|
||||||
const ReflowInput &parentReflowState =
|
const ReflowInput &parentReflowInput =
|
||||||
(i == 0) ? aAncestorReflowState : reflowStates[i - 1];
|
(i == 0) ? aAncestorReflowInput : reflowInputs[i - 1];
|
||||||
nsIFrame *frame = frames[len - i - 1];
|
nsIFrame *frame = frames[len - i - 1];
|
||||||
WritingMode wm = frame->GetWritingMode();
|
WritingMode wm = frame->GetWritingMode();
|
||||||
LogicalSize availSize = parentReflowState.ComputedSize(wm);
|
LogicalSize availSize = parentReflowInput.ComputedSize(wm);
|
||||||
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
MOZ_ASSERT(frame->GetParent()->FirstInFlow() ==
|
MOZ_ASSERT(frame->GetParent()->FirstInFlow() ==
|
||||||
parentReflowState.mFrame->FirstInFlow(),
|
parentReflowInput.mFrame->FirstInFlow(),
|
||||||
"bad logic in this function");
|
"bad logic in this function");
|
||||||
new (reflowStates + i) ReflowInput(presContext, parentReflowState,
|
new (reflowInputs + i) ReflowInput(presContext, parentReflowInput,
|
||||||
frame, availSize);
|
frame, availSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(reflowStates[len - 1].mFrame == aDescendantFrame,
|
MOZ_ASSERT(reflowInputs[len - 1].mFrame == aDescendantFrame,
|
||||||
"bad logic in this function");
|
"bad logic in this function");
|
||||||
nscoord result = reflowStates[len - 1].ComputedISize();
|
nscoord result = reflowInputs[len - 1].ComputedISize();
|
||||||
|
|
||||||
for (uint32_t i = len; i-- != 0; ) {
|
for (uint32_t i = len; i-- != 0; ) {
|
||||||
reflowStates[i].~ReflowInput();
|
reflowInputs[i].~ReflowInput();
|
||||||
}
|
}
|
||||||
free(reflowStates);
|
free(reflowInputs);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsFontInflationData::UpdateISize(const ReflowInput &aReflowState)
|
nsFontInflationData::UpdateISize(const ReflowInput &aReflowInput)
|
||||||
{
|
{
|
||||||
nsIFrame *bfc = aReflowState.mFrame;
|
nsIFrame *bfc = aReflowInput.mFrame;
|
||||||
NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
|
NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
|
||||||
"must be block formatting context");
|
"must be block formatting context");
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ nsFontInflationData::UpdateISize(const ReflowInput &aReflowState)
|
|||||||
nca = nca->GetParent()->FirstInFlow();
|
nca = nca->GetParent()->FirstInFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord newNCAISize = ComputeDescendantISize(aReflowState, nca);
|
nscoord newNCAISize = ComputeDescendantISize(aReflowInput, nca);
|
||||||
|
|
||||||
// See comment above "font.size.inflation.lineThreshold" in
|
// See comment above "font.size.inflation.lineThreshold" in
|
||||||
// modules/libpref/src/init/all.js .
|
// modules/libpref/src/init/all.js .
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public:
|
|||||||
// Returns whether the effective width changed (which requires the
|
// Returns whether the effective width changed (which requires the
|
||||||
// caller to mark its descendants dirty
|
// caller to mark its descendants dirty
|
||||||
static bool
|
static bool
|
||||||
UpdateFontInflationDataISizeFor(const ReflowInput& aReflowState);
|
UpdateFontInflationDataISizeFor(const ReflowInput& aReflowInput);
|
||||||
|
|
||||||
static void MarkFontInflationDataTextDirty(nsIFrame *aFrame);
|
static void MarkFontInflationDataTextDirty(nsIFrame *aFrame);
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ private:
|
|||||||
nsFontInflationData(const nsFontInflationData&) = delete;
|
nsFontInflationData(const nsFontInflationData&) = delete;
|
||||||
void operator=(const nsFontInflationData&) = delete;
|
void operator=(const nsFontInflationData&) = delete;
|
||||||
|
|
||||||
void UpdateISize(const ReflowInput &aReflowState);
|
void UpdateISize(const ReflowInput &aReflowInput);
|
||||||
enum SearchDirection { eFromStart, eFromEnd };
|
enum SearchDirection { eFromStart, eFromEnd };
|
||||||
static nsIFrame* FindEdgeInflatableFrameIn(nsIFrame *aFrame,
|
static nsIFrame* FindEdgeInflatableFrameIn(nsIFrame *aFrame,
|
||||||
SearchDirection aDirection);
|
SearchDirection aDirection);
|
||||||
|
|||||||
@@ -1055,7 +1055,7 @@ nsIFrame::GetUsedPadding() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::Sides
|
nsIFrame::Sides
|
||||||
nsIFrame::GetSkipSides(const ReflowInput* aReflowState) const
|
nsIFrame::GetSkipSides(const ReflowInput* aReflowInput) const
|
||||||
{
|
{
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE) &&
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE) &&
|
||||||
@@ -1066,7 +1066,7 @@ nsIFrame::GetSkipSides(const ReflowInput* aReflowState) const
|
|||||||
// Convert the logical skip sides to physical sides using the frame's
|
// Convert the logical skip sides to physical sides using the frame's
|
||||||
// writing mode
|
// writing mode
|
||||||
WritingMode writingMode = GetWritingMode();
|
WritingMode writingMode = GetWritingMode();
|
||||||
LogicalSides logicalSkip = GetLogicalSkipSides(aReflowState);
|
LogicalSides logicalSkip = GetLogicalSkipSides(aReflowInput);
|
||||||
Sides skip;
|
Sides skip;
|
||||||
|
|
||||||
if (logicalSkip.BStart()) {
|
if (logicalSkip.BStart()) {
|
||||||
@@ -4933,7 +4933,7 @@ nsFrame::ShrinkWidthToFit(nsRenderingContext *aRenderingContext,
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsFrame::DidReflow(nsPresContext* aPresContext,
|
nsFrame::DidReflow(nsPresContext* aPresContext,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
nsDidReflowStatus aStatus)
|
nsDidReflowStatus aStatus)
|
||||||
{
|
{
|
||||||
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
|
||||||
@@ -4950,12 +4950,12 @@ nsFrame::DidReflow(nsPresContext* aPresContext,
|
|||||||
// The observer may be able to initiate another reflow with a computed
|
// The observer may be able to initiate another reflow with a computed
|
||||||
// bsize. This happens in the case where a table cell has no computed
|
// bsize. This happens in the case where a table cell has no computed
|
||||||
// bsize but can fabricate one when the cell bsize is known.
|
// bsize but can fabricate one when the cell bsize is known.
|
||||||
if (aReflowState && aReflowState->mPercentBSizeObserver &&
|
if (aReflowInput && aReflowInput->mPercentBSizeObserver &&
|
||||||
!GetPrevInFlow()) {
|
!GetPrevInFlow()) {
|
||||||
const nsStyleCoord &bsize =
|
const nsStyleCoord &bsize =
|
||||||
aReflowState->mStylePosition->BSize(aReflowState->GetWritingMode());
|
aReflowInput->mStylePosition->BSize(aReflowInput->GetWritingMode());
|
||||||
if (bsize.HasPercent()) {
|
if (bsize.HasPercent()) {
|
||||||
aReflowState->mPercentBSizeObserver->NotifyPercentBSize(*aReflowState);
|
aReflowInput->mPercentBSizeObserver->NotifyPercentBSize(*aReflowInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4965,11 +4965,11 @@ nsFrame::DidReflow(nsPresContext* aPresContext,
|
|||||||
void
|
void
|
||||||
nsFrame::FinishReflowWithAbsoluteFrames(nsPresContext* aPresContext,
|
nsFrame::FinishReflowWithAbsoluteFrames(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
bool aConstrainBSize)
|
bool aConstrainBSize)
|
||||||
{
|
{
|
||||||
ReflowAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus, aConstrainBSize);
|
ReflowAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus, aConstrainBSize);
|
||||||
|
|
||||||
FinishAndStoreOverflow(&aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
}
|
}
|
||||||
@@ -4977,7 +4977,7 @@ nsFrame::FinishReflowWithAbsoluteFrames(nsPresContext* aPresContext,
|
|||||||
void
|
void
|
||||||
nsFrame::ReflowAbsoluteFrames(nsPresContext* aPresContext,
|
nsFrame::ReflowAbsoluteFrames(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
bool aConstrainBSize)
|
bool aConstrainBSize)
|
||||||
{
|
{
|
||||||
@@ -5002,7 +5002,7 @@ nsFrame::ReflowAbsoluteFrames(nsPresContext* aPresContext,
|
|||||||
if (aConstrainBSize) {
|
if (aConstrainBSize) {
|
||||||
flags |= AbsPosReflowFlags::eConstrainHeight;
|
flags |= AbsPosReflowFlags::eConstrainHeight;
|
||||||
}
|
}
|
||||||
absoluteContainer->Reflow(container, aPresContext, aReflowState, aStatus,
|
absoluteContainer->Reflow(container, aPresContext, aReflowInput, aStatus,
|
||||||
containingBlock, flags,
|
containingBlock, flags,
|
||||||
&aDesiredSize.mOverflowAreas);
|
&aDesiredSize.mOverflowAreas);
|
||||||
}
|
}
|
||||||
@@ -5031,14 +5031,14 @@ nsFrame::CanContinueTextRun() const
|
|||||||
void
|
void
|
||||||
nsFrame::Reflow(nsPresContext* aPresContext,
|
nsFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsFrame");
|
||||||
aDesiredSize.ClearSize();
|
aDesiredSize.ClearSize();
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
@@ -6044,11 +6044,11 @@ nsFrame::UnionChildOverflow(nsOverflowAreas& aOverflowAreas)
|
|||||||
#define MAX_FRAME_DEPTH (MAX_REFLOW_DEPTH+4)
|
#define MAX_FRAME_DEPTH (MAX_REFLOW_DEPTH+4)
|
||||||
|
|
||||||
bool
|
bool
|
||||||
nsFrame::IsFrameTreeTooDeep(const ReflowInput& aReflowState,
|
nsFrame::IsFrameTreeTooDeep(const ReflowInput& aReflowInput,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (aReflowState.mReflowDepth > MAX_FRAME_DEPTH) {
|
if (aReflowInput.mReflowDepth > MAX_FRAME_DEPTH) {
|
||||||
NS_WARNING("frame tree too deep; setting zero size and returning");
|
NS_WARNING("frame tree too deep; setting zero size and returning");
|
||||||
mState |= NS_FRAME_TOO_DEEP_IN_FRAME_TREE;
|
mState |= NS_FRAME_TOO_DEEP_IN_FRAME_TREE;
|
||||||
ClearOverflowRects();
|
ClearOverflowRects();
|
||||||
@@ -8718,8 +8718,8 @@ nsFrame::RefreshSizeCache(nsBoxLayoutState& aState)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// do the nasty.
|
// do the nasty.
|
||||||
const WritingMode wm = aState.OuterReflowState() ?
|
const WritingMode wm = aState.OuterReflowInput() ?
|
||||||
aState.OuterReflowState()->GetWritingMode() : GetWritingMode();
|
aState.OuterReflowInput()->GetWritingMode() : GetWritingMode();
|
||||||
ReflowOutput desiredSize(wm);
|
ReflowOutput desiredSize(wm);
|
||||||
BoxReflow(aState, presContext, desiredSize, rendContext,
|
BoxReflow(aState, presContext, desiredSize, rendContext,
|
||||||
rect.x, rect.y,
|
rect.x, rect.y,
|
||||||
@@ -8819,7 +8819,7 @@ nsFrame::GetXULMinSize(nsBoxLayoutState& aState)
|
|||||||
{
|
{
|
||||||
nsSize size(0,0);
|
nsSize size(0,0);
|
||||||
DISPLAY_MIN_SIZE(this, size);
|
DISPLAY_MIN_SIZE(this, size);
|
||||||
// Don't use the cache if we have HTMLReflowState constraints --- they might have changed
|
// Don't use the cache if we have HTMLReflowInput constraints --- they might have changed
|
||||||
nsBoxLayoutMetrics *metrics = BoxMetrics();
|
nsBoxLayoutMetrics *metrics = BoxMetrics();
|
||||||
if (!DoesNeedRecalc(metrics->mMinSize)) {
|
if (!DoesNeedRecalc(metrics->mMinSize)) {
|
||||||
size = metrics->mMinSize;
|
size = metrics->mMinSize;
|
||||||
@@ -8854,7 +8854,7 @@ nsFrame::GetXULMaxSize(nsBoxLayoutState& aState)
|
|||||||
{
|
{
|
||||||
nsSize size(NS_INTRINSICSIZE, NS_INTRINSICSIZE);
|
nsSize size(NS_INTRINSICSIZE, NS_INTRINSICSIZE);
|
||||||
DISPLAY_MAX_SIZE(this, size);
|
DISPLAY_MAX_SIZE(this, size);
|
||||||
// Don't use the cache if we have HTMLReflowState constraints --- they might have changed
|
// Don't use the cache if we have HTMLReflowInput constraints --- they might have changed
|
||||||
nsBoxLayoutMetrics *metrics = BoxMetrics();
|
nsBoxLayoutMetrics *metrics = BoxMetrics();
|
||||||
if (!DoesNeedRecalc(metrics->mMaxSize)) {
|
if (!DoesNeedRecalc(metrics->mMaxSize)) {
|
||||||
size = metrics->mMaxSize;
|
size = metrics->mMaxSize;
|
||||||
@@ -8908,8 +8908,8 @@ nsFrame::DoXULLayout(nsBoxLayoutState& aState)
|
|||||||
nsRenderingContext* rendContext = aState.GetRenderingContext();
|
nsRenderingContext* rendContext = aState.GetRenderingContext();
|
||||||
nsPresContext* presContext = aState.PresContext();
|
nsPresContext* presContext = aState.PresContext();
|
||||||
WritingMode ourWM = GetWritingMode();
|
WritingMode ourWM = GetWritingMode();
|
||||||
const WritingMode outerWM = aState.OuterReflowState() ?
|
const WritingMode outerWM = aState.OuterReflowInput() ?
|
||||||
aState.OuterReflowState()->GetWritingMode() : ourWM;
|
aState.OuterReflowInput()->GetWritingMode() : ourWM;
|
||||||
ReflowOutput desiredSize(outerWM);
|
ReflowOutput desiredSize(outerWM);
|
||||||
LogicalSize ourSize = GetLogicalSize(outerWM);
|
LogicalSize ourSize = GetLogicalSize(outerWM);
|
||||||
|
|
||||||
@@ -8957,8 +8957,8 @@ nsFrame::DoXULLayout(nsBoxLayoutState& aState)
|
|||||||
desiredSize.UnionOverflowAreasWithDesiredBounds();
|
desiredSize.UnionOverflowAreasWithDesiredBounds();
|
||||||
|
|
||||||
if (HasAbsolutelyPositionedChildren()) {
|
if (HasAbsolutelyPositionedChildren()) {
|
||||||
// Set up a |reflowState| to pass into ReflowAbsoluteFrames
|
// Set up a |reflowInput| to pass into ReflowAbsoluteFrames
|
||||||
ReflowInput reflowState(aState.PresContext(), this,
|
ReflowInput reflowInput(aState.PresContext(), this,
|
||||||
aState.GetRenderingContext(),
|
aState.GetRenderingContext(),
|
||||||
LogicalSize(ourWM, ISize(),
|
LogicalSize(ourWM, ISize(),
|
||||||
NS_UNCONSTRAINEDSIZE),
|
NS_UNCONSTRAINEDSIZE),
|
||||||
@@ -8969,7 +8969,7 @@ nsFrame::DoXULLayout(nsBoxLayoutState& aState)
|
|||||||
// (just a dummy value; hopefully that's OK)
|
// (just a dummy value; hopefully that's OK)
|
||||||
nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
|
||||||
ReflowAbsoluteFrames(aState.PresContext(), desiredSize,
|
ReflowAbsoluteFrames(aState.PresContext(), desiredSize,
|
||||||
reflowState, reflowStatus);
|
reflowInput, reflowStatus);
|
||||||
RemoveStateBits(NS_FRAME_IN_REFLOW);
|
RemoveStateBits(NS_FRAME_IN_REFLOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9062,7 +9062,7 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
|||||||
nsFrameState savedState = parentFrame->GetStateBits();
|
nsFrameState savedState = parentFrame->GetStateBits();
|
||||||
WritingMode parentWM = parentFrame->GetWritingMode();
|
WritingMode parentWM = parentFrame->GetWritingMode();
|
||||||
ReflowInput
|
ReflowInput
|
||||||
parentReflowState(aPresContext, parentFrame, aRenderingContext,
|
parentReflowInput(aPresContext, parentFrame, aRenderingContext,
|
||||||
LogicalSize(parentWM, parentSize),
|
LogicalSize(parentWM, parentSize),
|
||||||
ReflowInput::DUMMY_PARENT_REFLOW_STATE);
|
ReflowInput::DUMMY_PARENT_REFLOW_STATE);
|
||||||
parentFrame->RemoveStateBits(~nsFrameState(0));
|
parentFrame->RemoveStateBits(~nsFrameState(0));
|
||||||
@@ -9070,31 +9070,31 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
|||||||
|
|
||||||
// This may not do very much useful, but it's probably worth trying.
|
// This may not do very much useful, but it's probably worth trying.
|
||||||
if (parentSize.width != NS_INTRINSICSIZE)
|
if (parentSize.width != NS_INTRINSICSIZE)
|
||||||
parentReflowState.SetComputedWidth(std::max(parentSize.width, 0));
|
parentReflowInput.SetComputedWidth(std::max(parentSize.width, 0));
|
||||||
if (parentSize.height != NS_INTRINSICSIZE)
|
if (parentSize.height != NS_INTRINSICSIZE)
|
||||||
parentReflowState.SetComputedHeight(std::max(parentSize.height, 0));
|
parentReflowInput.SetComputedHeight(std::max(parentSize.height, 0));
|
||||||
parentReflowState.ComputedPhysicalMargin().SizeTo(0, 0, 0, 0);
|
parentReflowInput.ComputedPhysicalMargin().SizeTo(0, 0, 0, 0);
|
||||||
// XXX use box methods
|
// XXX use box methods
|
||||||
parentFrame->GetXULPadding(parentReflowState.ComputedPhysicalPadding());
|
parentFrame->GetXULPadding(parentReflowInput.ComputedPhysicalPadding());
|
||||||
parentFrame->GetXULBorder(parentReflowState.ComputedPhysicalBorderPadding());
|
parentFrame->GetXULBorder(parentReflowInput.ComputedPhysicalBorderPadding());
|
||||||
parentReflowState.ComputedPhysicalBorderPadding() +=
|
parentReflowInput.ComputedPhysicalBorderPadding() +=
|
||||||
parentReflowState.ComputedPhysicalPadding();
|
parentReflowInput.ComputedPhysicalPadding();
|
||||||
|
|
||||||
// Construct the parent chain manually since constructing it normally
|
// Construct the parent chain manually since constructing it normally
|
||||||
// messes up dimensions.
|
// messes up dimensions.
|
||||||
const ReflowInput *outerReflowState = aState.OuterReflowState();
|
const ReflowInput *outerReflowInput = aState.OuterReflowInput();
|
||||||
NS_ASSERTION(!outerReflowState || outerReflowState->mFrame != this,
|
NS_ASSERTION(!outerReflowInput || outerReflowInput->mFrame != this,
|
||||||
"in and out of XUL on a single frame?");
|
"in and out of XUL on a single frame?");
|
||||||
const ReflowInput* parentRS;
|
const ReflowInput* parentRS;
|
||||||
if (outerReflowState && outerReflowState->mFrame == parentFrame) {
|
if (outerReflowInput && outerReflowInput->mFrame == parentFrame) {
|
||||||
// We're a frame (such as a text control frame) that jumps into
|
// We're a frame (such as a text control frame) that jumps into
|
||||||
// box reflow and then straight out of it on the child frame.
|
// box reflow and then straight out of it on the child frame.
|
||||||
// This means we actually have a real parent reflow state.
|
// This means we actually have a real parent reflow state.
|
||||||
// nsLayoutUtils::InflationMinFontSizeFor used to need this to be
|
// nsLayoutUtils::InflationMinFontSizeFor used to need this to be
|
||||||
// linked up correctly for text control frames, so do so here).
|
// linked up correctly for text control frames, so do so here).
|
||||||
parentRS = outerReflowState;
|
parentRS = outerReflowInput;
|
||||||
} else {
|
} else {
|
||||||
parentRS = &parentReflowState;
|
parentRS = &parentReflowInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX Is it OK that this reflow state has only one ancestor?
|
// XXX Is it OK that this reflow state has only one ancestor?
|
||||||
@@ -9102,24 +9102,24 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
|||||||
WritingMode wm = GetWritingMode();
|
WritingMode wm = GetWritingMode();
|
||||||
LogicalSize logicalSize(wm, nsSize(aWidth, aHeight));
|
LogicalSize logicalSize(wm, nsSize(aWidth, aHeight));
|
||||||
logicalSize.BSize(wm) = NS_INTRINSICSIZE;
|
logicalSize.BSize(wm) = NS_INTRINSICSIZE;
|
||||||
ReflowInput reflowState(aPresContext, *parentRS, this,
|
ReflowInput reflowInput(aPresContext, *parentRS, this,
|
||||||
logicalSize, nullptr,
|
logicalSize, nullptr,
|
||||||
ReflowInput::DUMMY_PARENT_REFLOW_STATE);
|
ReflowInput::DUMMY_PARENT_REFLOW_STATE);
|
||||||
|
|
||||||
// XXX_jwir3: This is somewhat fishy. If this is actually changing the value
|
// XXX_jwir3: This is somewhat fishy. If this is actually changing the value
|
||||||
// here (which it might be), then we should make sure that it's
|
// here (which it might be), then we should make sure that it's
|
||||||
// correct the first time around, rather than changing it later.
|
// correct the first time around, rather than changing it later.
|
||||||
reflowState.mCBReflowState = parentRS;
|
reflowInput.mCBReflowInput = parentRS;
|
||||||
|
|
||||||
reflowState.mReflowDepth = aState.GetReflowDepth();
|
reflowInput.mReflowDepth = aState.GetReflowDepth();
|
||||||
|
|
||||||
// mComputedWidth and mComputedHeight are content-box, not
|
// mComputedWidth and mComputedHeight are content-box, not
|
||||||
// border-box
|
// border-box
|
||||||
if (aWidth != NS_INTRINSICSIZE) {
|
if (aWidth != NS_INTRINSICSIZE) {
|
||||||
nscoord computedWidth =
|
nscoord computedWidth =
|
||||||
aWidth - reflowState.ComputedPhysicalBorderPadding().LeftRight();
|
aWidth - reflowInput.ComputedPhysicalBorderPadding().LeftRight();
|
||||||
computedWidth = std::max(computedWidth, 0);
|
computedWidth = std::max(computedWidth, 0);
|
||||||
reflowState.SetComputedWidth(computedWidth);
|
reflowInput.SetComputedWidth(computedWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Most child frames of box frames (e.g. subdocument or scroll frames)
|
// Most child frames of box frames (e.g. subdocument or scroll frames)
|
||||||
@@ -9130,18 +9130,18 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
|||||||
if (!IsFrameOfType(eBlockFrame)) {
|
if (!IsFrameOfType(eBlockFrame)) {
|
||||||
if (aHeight != NS_INTRINSICSIZE) {
|
if (aHeight != NS_INTRINSICSIZE) {
|
||||||
nscoord computedHeight =
|
nscoord computedHeight =
|
||||||
aHeight - reflowState.ComputedPhysicalBorderPadding().TopBottom();
|
aHeight - reflowInput.ComputedPhysicalBorderPadding().TopBottom();
|
||||||
computedHeight = std::max(computedHeight, 0);
|
computedHeight = std::max(computedHeight, 0);
|
||||||
reflowState.SetComputedHeight(computedHeight);
|
reflowInput.SetComputedHeight(computedHeight);
|
||||||
} else {
|
} else {
|
||||||
reflowState.SetComputedHeight(
|
reflowInput.SetComputedHeight(
|
||||||
ComputeSize(aRenderingContext, wm,
|
ComputeSize(aRenderingContext, wm,
|
||||||
logicalSize,
|
logicalSize,
|
||||||
logicalSize.ISize(wm),
|
logicalSize.ISize(wm),
|
||||||
reflowState.ComputedLogicalMargin().Size(wm),
|
reflowInput.ComputedLogicalMargin().Size(wm),
|
||||||
reflowState.ComputedLogicalBorderPadding().Size(wm) -
|
reflowInput.ComputedLogicalBorderPadding().Size(wm) -
|
||||||
reflowState.ComputedLogicalPadding().Size(wm),
|
reflowInput.ComputedLogicalPadding().Size(wm),
|
||||||
reflowState.ComputedLogicalPadding().Size(wm),
|
reflowInput.ComputedLogicalPadding().Size(wm),
|
||||||
ComputeSizeFlags::eDefault).Height(wm));
|
ComputeSizeFlags::eDefault).Height(wm));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9153,7 +9153,7 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
|||||||
// However, mLastSize can also be the size passed to BoxReflow by
|
// However, mLastSize can also be the size passed to BoxReflow by
|
||||||
// RefreshSizeCache, so that doesn't really make sense.
|
// RefreshSizeCache, so that doesn't really make sense.
|
||||||
if (metrics->mLastSize.width != aWidth) {
|
if (metrics->mLastSize.width != aWidth) {
|
||||||
reflowState.SetHResize(true);
|
reflowInput.SetHResize(true);
|
||||||
|
|
||||||
// When font size inflation is enabled, a horizontal resize
|
// When font size inflation is enabled, a horizontal resize
|
||||||
// requires a full reflow. See ReflowInput::InitResizeFlags
|
// requires a full reflow. See ReflowInput::InitResizeFlags
|
||||||
@@ -9163,27 +9163,27 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (metrics->mLastSize.height != aHeight) {
|
if (metrics->mLastSize.height != aHeight) {
|
||||||
reflowState.SetVResize(true);
|
reflowInput.SetVResize(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_REFLOW
|
#ifdef DEBUG_REFLOW
|
||||||
nsAdaptorAddIndents();
|
nsAdaptorAddIndents();
|
||||||
printf("Size=(%d,%d)\n",reflowState.ComputedWidth(),
|
printf("Size=(%d,%d)\n",reflowInput.ComputedWidth(),
|
||||||
reflowState.ComputedHeight());
|
reflowInput.ComputedHeight());
|
||||||
nsAdaptorAddIndents();
|
nsAdaptorAddIndents();
|
||||||
nsAdaptorPrintReason(reflowState);
|
nsAdaptorPrintReason(reflowInput);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// place the child and reflow
|
// place the child and reflow
|
||||||
|
|
||||||
Reflow(aPresContext, aDesiredSize, reflowState, status);
|
Reflow(aPresContext, aDesiredSize, reflowInput, status);
|
||||||
|
|
||||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
|
||||||
|
|
||||||
uint32_t layoutFlags = aState.LayoutFlags();
|
uint32_t layoutFlags = aState.LayoutFlags();
|
||||||
nsContainerFrame::FinishReflowChild(this, aPresContext, aDesiredSize,
|
nsContainerFrame::FinishReflowChild(this, aPresContext, aDesiredSize,
|
||||||
&reflowState, aX, aY, layoutFlags | NS_FRAME_NO_MOVE_FRAME);
|
&reflowInput, aX, aY, layoutFlags | NS_FRAME_NO_MOVE_FRAME);
|
||||||
|
|
||||||
// Save the ascent. (bug 103925)
|
// Save the ascent. (bug 103925)
|
||||||
if (IsXULCollapsed()) {
|
if (IsXULCollapsed()) {
|
||||||
@@ -9491,11 +9491,11 @@ nsAdaptorAddIndents()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsAdaptorPrintReason(ReflowInput& aReflowState)
|
nsAdaptorPrintReason(ReflowInput& aReflowInput)
|
||||||
{
|
{
|
||||||
char* reflowReasonString;
|
char* reflowReasonString;
|
||||||
|
|
||||||
switch(aReflowState.reason)
|
switch(aReflowInput.reason)
|
||||||
{
|
{
|
||||||
case eReflowReason_Initial:
|
case eReflowReason_Initial:
|
||||||
reflowReasonString = "initial";
|
reflowReasonString = "initial";
|
||||||
@@ -9512,7 +9512,7 @@ nsAdaptorPrintReason(ReflowInput& aReflowState)
|
|||||||
break;
|
break;
|
||||||
case eReflowReason_Incremental:
|
case eReflowReason_Incremental:
|
||||||
{
|
{
|
||||||
switch (aReflowState.reflowCommand->Type()) {
|
switch (aReflowInput.reflowCommand->Type()) {
|
||||||
case eReflowType_StyleChanged:
|
case eReflowType_StyleChanged:
|
||||||
reflowReasonString = "incremental (StyleChanged)";
|
reflowReasonString = "incremental (StyleChanged)";
|
||||||
break;
|
break;
|
||||||
@@ -9609,13 +9609,13 @@ nsFrame::VerifyDirtyBitSet(const nsFrameList& aFrameList)
|
|||||||
|
|
||||||
DR_cookie::DR_cookie(nsPresContext* aPresContext,
|
DR_cookie::DR_cookie(nsPresContext* aPresContext,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
:mPresContext(aPresContext), mFrame(aFrame), mReflowState(aReflowState), mMetrics(aMetrics), mStatus(aStatus)
|
:mPresContext(aPresContext), mFrame(aFrame), mReflowInput(aReflowInput), mMetrics(aMetrics), mStatus(aStatus)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(DR_cookie);
|
MOZ_COUNT_CTOR(DR_cookie);
|
||||||
mValue = nsFrame::DisplayReflowEnter(aPresContext, mFrame, mReflowState);
|
mValue = nsFrame::DisplayReflowEnter(aPresContext, mFrame, mReflowInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
DR_cookie::~DR_cookie()
|
DR_cookie::~DR_cookie()
|
||||||
@@ -9748,7 +9748,7 @@ struct DR_State
|
|||||||
DR_FrameTypeInfo* GetFrameTypeInfo(char* aFrameName);
|
DR_FrameTypeInfo* GetFrameTypeInfo(char* aFrameName);
|
||||||
void InitFrameTypeTable();
|
void InitFrameTypeTable();
|
||||||
DR_FrameTreeNode* CreateTreeNode(nsIFrame* aFrame,
|
DR_FrameTreeNode* CreateTreeNode(nsIFrame* aFrame,
|
||||||
const ReflowInput* aReflowState);
|
const ReflowInput* aReflowInput);
|
||||||
void FindMatchingRule(DR_FrameTreeNode& aNode);
|
void FindMatchingRule(DR_FrameTreeNode& aNode);
|
||||||
bool RuleMatches(DR_Rule& aRule,
|
bool RuleMatches(DR_Rule& aRule,
|
||||||
DR_FrameTreeNode& aNode);
|
DR_FrameTreeNode& aNode);
|
||||||
@@ -10218,12 +10218,12 @@ void DR_State::FindMatchingRule(DR_FrameTreeNode& aNode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DR_FrameTreeNode* DR_State::CreateTreeNode(nsIFrame* aFrame,
|
DR_FrameTreeNode* DR_State::CreateTreeNode(nsIFrame* aFrame,
|
||||||
const ReflowInput* aReflowState)
|
const ReflowInput* aReflowInput)
|
||||||
{
|
{
|
||||||
// find the frame of the parent reflow state (usually just the parent of aFrame)
|
// find the frame of the parent reflow state (usually just the parent of aFrame)
|
||||||
nsIFrame* parentFrame;
|
nsIFrame* parentFrame;
|
||||||
if (aReflowState) {
|
if (aReflowInput) {
|
||||||
const ReflowInput* parentRS = aReflowState->mParentReflowState;
|
const ReflowInput* parentRS = aReflowInput->mParentReflowInput;
|
||||||
parentFrame = (parentRS) ? parentRS->mFrame : nullptr;
|
parentFrame = (parentRS) ? parentRS->mFrame : nullptr;
|
||||||
} else {
|
} else {
|
||||||
parentFrame = aFrame->GetParent();
|
parentFrame = aFrame->GetParent();
|
||||||
@@ -10317,7 +10317,7 @@ CheckPixelError(nscoord aSize,
|
|||||||
|
|
||||||
static void DisplayReflowEnterPrint(nsPresContext* aPresContext,
|
static void DisplayReflowEnterPrint(nsPresContext* aPresContext,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
DR_FrameTreeNode& aTreeNode,
|
DR_FrameTreeNode& aTreeNode,
|
||||||
bool aChanged)
|
bool aChanged)
|
||||||
{
|
{
|
||||||
@@ -10327,12 +10327,12 @@ static void DisplayReflowEnterPrint(nsPresContext* aPresContext,
|
|||||||
char width[16];
|
char width[16];
|
||||||
char height[16];
|
char height[16];
|
||||||
|
|
||||||
DR_state->PrettyUC(aReflowState.AvailableWidth(), width, 16);
|
DR_state->PrettyUC(aReflowInput.AvailableWidth(), width, 16);
|
||||||
DR_state->PrettyUC(aReflowState.AvailableHeight(), height, 16);
|
DR_state->PrettyUC(aReflowInput.AvailableHeight(), height, 16);
|
||||||
printf("Reflow a=%s,%s ", width, height);
|
printf("Reflow a=%s,%s ", width, height);
|
||||||
|
|
||||||
DR_state->PrettyUC(aReflowState.ComputedWidth(), width, 16);
|
DR_state->PrettyUC(aReflowInput.ComputedWidth(), width, 16);
|
||||||
DR_state->PrettyUC(aReflowState.ComputedHeight(), height, 16);
|
DR_state->PrettyUC(aReflowInput.ComputedHeight(), height, 16);
|
||||||
printf("c=%s,%s ", width, height);
|
printf("c=%s,%s ", width, height);
|
||||||
|
|
||||||
if (aFrame->GetStateBits() & NS_FRAME_IS_DIRTY)
|
if (aFrame->GetStateBits() & NS_FRAME_IS_DIRTY)
|
||||||
@@ -10341,13 +10341,13 @@ static void DisplayReflowEnterPrint(nsPresContext* aPresContext,
|
|||||||
if (aFrame->GetStateBits() & NS_FRAME_HAS_DIRTY_CHILDREN)
|
if (aFrame->GetStateBits() & NS_FRAME_HAS_DIRTY_CHILDREN)
|
||||||
printf("dirty-children ");
|
printf("dirty-children ");
|
||||||
|
|
||||||
if (aReflowState.mFlags.mSpecialBSizeReflow)
|
if (aReflowInput.mFlags.mSpecialBSizeReflow)
|
||||||
printf("special-bsize ");
|
printf("special-bsize ");
|
||||||
|
|
||||||
if (aReflowState.IsHResize())
|
if (aReflowInput.IsHResize())
|
||||||
printf("h-resize ");
|
printf("h-resize ");
|
||||||
|
|
||||||
if (aReflowState.IsVResize())
|
if (aReflowInput.IsVResize())
|
||||||
printf("v-resize ");
|
printf("v-resize ");
|
||||||
|
|
||||||
nsIFrame* inFlow = aFrame->GetPrevInFlow();
|
nsIFrame* inFlow = aFrame->GetPrevInFlow();
|
||||||
@@ -10364,26 +10364,26 @@ static void DisplayReflowEnterPrint(nsPresContext* aPresContext,
|
|||||||
printf("cnt=%d \n", DR_state->mCount);
|
printf("cnt=%d \n", DR_state->mCount);
|
||||||
if (DR_state->mDisplayPixelErrors) {
|
if (DR_state->mDisplayPixelErrors) {
|
||||||
int32_t p2t = aPresContext->AppUnitsPerDevPixel();
|
int32_t p2t = aPresContext->AppUnitsPerDevPixel();
|
||||||
CheckPixelError(aReflowState.AvailableWidth(), p2t);
|
CheckPixelError(aReflowInput.AvailableWidth(), p2t);
|
||||||
CheckPixelError(aReflowState.AvailableHeight(), p2t);
|
CheckPixelError(aReflowInput.AvailableHeight(), p2t);
|
||||||
CheckPixelError(aReflowState.ComputedWidth(), p2t);
|
CheckPixelError(aReflowInput.ComputedWidth(), p2t);
|
||||||
CheckPixelError(aReflowState.ComputedHeight(), p2t);
|
CheckPixelError(aReflowInput.ComputedHeight(), p2t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void* nsFrame::DisplayReflowEnter(nsPresContext* aPresContext,
|
void* nsFrame::DisplayReflowEnter(nsPresContext* aPresContext,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
const ReflowInput& aReflowState)
|
const ReflowInput& aReflowInput)
|
||||||
{
|
{
|
||||||
if (!DR_state->mInited) DR_state->Init();
|
if (!DR_state->mInited) DR_state->Init();
|
||||||
if (!DR_state->mActive) return nullptr;
|
if (!DR_state->mActive) return nullptr;
|
||||||
|
|
||||||
NS_ASSERTION(aFrame, "invalid call");
|
NS_ASSERTION(aFrame, "invalid call");
|
||||||
|
|
||||||
DR_FrameTreeNode* treeNode = DR_state->CreateTreeNode(aFrame, &aReflowState);
|
DR_FrameTreeNode* treeNode = DR_state->CreateTreeNode(aFrame, &aReflowInput);
|
||||||
if (treeNode) {
|
if (treeNode) {
|
||||||
DisplayReflowEnterPrint(aPresContext, aFrame, aReflowState, *treeNode, false);
|
DisplayReflowEnterPrint(aPresContext, aFrame, aReflowInput, *treeNode, false);
|
||||||
}
|
}
|
||||||
return treeNode;
|
return treeNode;
|
||||||
}
|
}
|
||||||
@@ -10575,7 +10575,7 @@ void DR_cookie::Change() const
|
|||||||
{
|
{
|
||||||
DR_FrameTreeNode* treeNode = (DR_FrameTreeNode*)mValue;
|
DR_FrameTreeNode* treeNode = (DR_FrameTreeNode*)mValue;
|
||||||
if (treeNode && treeNode->mDisplay) {
|
if (treeNode && treeNode->mDisplay) {
|
||||||
DisplayReflowEnterPrint(mPresContext, mFrame, mReflowState, *treeNode, true);
|
DisplayReflowEnterPrint(mPresContext, mFrame, mReflowInput, *treeNode, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10598,7 +10598,7 @@ ReflowInput::DisplayInitConstraintsEnter(nsIFrame* aFrame,
|
|||||||
DR_state->DisplayFrameTypeInfo(aFrame, treeNode->mIndent);
|
DR_state->DisplayFrameTypeInfo(aFrame, treeNode->mIndent);
|
||||||
|
|
||||||
printf("InitConstraints parent=%p",
|
printf("InitConstraints parent=%p",
|
||||||
(void*)aState->mParentReflowState);
|
(void*)aState->mParentReflowInput);
|
||||||
|
|
||||||
char width[16];
|
char width[16];
|
||||||
char height[16];
|
char height[16];
|
||||||
|
|||||||
@@ -334,10 +334,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
virtual void DidReflow(nsPresContext* aPresContext,
|
virtual void DidReflow(nsPresContext* aPresContext,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
nsDidReflowStatus aStatus) override;
|
nsDidReflowStatus aStatus) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -347,12 +347,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
void ReflowAbsoluteFrames(nsPresContext* aPresContext,
|
void ReflowAbsoluteFrames(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
bool aConstrainBSize = true);
|
bool aConstrainBSize = true);
|
||||||
void FinishReflowWithAbsoluteFrames(nsPresContext* aPresContext,
|
void FinishReflowWithAbsoluteFrames(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
bool aConstrainBSize = true);
|
bool aConstrainBSize = true);
|
||||||
|
|
||||||
@@ -431,7 +431,7 @@ public:
|
|||||||
// the reflow status, and returns true. Otherwise, the frame is
|
// the reflow status, and returns true. Otherwise, the frame is
|
||||||
// unmarked "unflowable" and the metrics and reflow status are not
|
// unmarked "unflowable" and the metrics and reflow status are not
|
||||||
// touched and false is returned.
|
// touched and false is returned.
|
||||||
bool IsFrameTreeTooDeep(const ReflowInput& aReflowState,
|
bool IsFrameTreeTooDeep(const ReflowInput& aReflowInput,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
@@ -443,8 +443,8 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @return true if we should avoid a page/column break in this frame.
|
* @return true if we should avoid a page/column break in this frame.
|
||||||
*/
|
*/
|
||||||
bool ShouldAvoidBreakInside(const ReflowInput& aReflowState) const {
|
bool ShouldAvoidBreakInside(const ReflowInput& aReflowInput) const {
|
||||||
return !aReflowState.mFlags.mIsTopOfPage &&
|
return !aReflowInput.mFlags.mIsTopOfPage &&
|
||||||
NS_STYLE_PAGE_BREAK_AVOID == StyleDisplay()->mBreakInside &&
|
NS_STYLE_PAGE_BREAK_AVOID == StyleDisplay()->mBreakInside &&
|
||||||
!GetPrevInFlow();
|
!GetPrevInFlow();
|
||||||
}
|
}
|
||||||
@@ -480,7 +480,7 @@ public:
|
|||||||
// Display Reflow Debugging
|
// Display Reflow Debugging
|
||||||
static void* DisplayReflowEnter(nsPresContext* aPresContext,
|
static void* DisplayReflowEnter(nsPresContext* aPresContext,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
const ReflowInput& aReflowState);
|
const ReflowInput& aReflowInput);
|
||||||
static void* DisplayLayoutEnter(nsIFrame* aFrame);
|
static void* DisplayLayoutEnter(nsIFrame* aFrame);
|
||||||
static void* DisplayIntrinsicISizeEnter(nsIFrame* aFrame,
|
static void* DisplayIntrinsicISizeEnter(nsIFrame* aFrame,
|
||||||
const char* aType);
|
const char* aType);
|
||||||
@@ -769,7 +769,7 @@ public:
|
|||||||
struct DR_cookie {
|
struct DR_cookie {
|
||||||
DR_cookie(nsPresContext* aPresContext,
|
DR_cookie(nsPresContext* aPresContext,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
const mozilla::ReflowInput& aReflowState,
|
const mozilla::ReflowInput& aReflowInput,
|
||||||
mozilla::ReflowOutput& aMetrics,
|
mozilla::ReflowOutput& aMetrics,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
~DR_cookie();
|
~DR_cookie();
|
||||||
@@ -777,7 +777,7 @@ public:
|
|||||||
|
|
||||||
nsPresContext* mPresContext;
|
nsPresContext* mPresContext;
|
||||||
nsIFrame* mFrame;
|
nsIFrame* mFrame;
|
||||||
const mozilla::ReflowInput& mReflowState;
|
const mozilla::ReflowInput& mReflowInput;
|
||||||
mozilla::ReflowOutput& mMetrics;
|
mozilla::ReflowOutput& mMetrics;
|
||||||
nsReflowStatus& mStatus;
|
nsReflowStatus& mStatus;
|
||||||
void* mValue;
|
void* mValue;
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
bool GetVisibility() { return mVisibility; }
|
bool GetVisibility() { return mVisibility; }
|
||||||
@@ -154,7 +154,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -563,17 +563,17 @@ int32_t nsHTMLFramesetFrame::GetBorderWidth(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsHTMLFramesetFrame::GetDesiredSize(nsPresContext* aPresContext,
|
nsHTMLFramesetFrame::GetDesiredSize(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
ReflowOutput& aDesiredSize)
|
ReflowOutput& aDesiredSize)
|
||||||
{
|
{
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
LogicalSize desiredSize(wm);
|
LogicalSize desiredSize(wm);
|
||||||
nsHTMLFramesetFrame* framesetParent = do_QueryFrame(GetParent());
|
nsHTMLFramesetFrame* framesetParent = do_QueryFrame(GetParent());
|
||||||
if (nullptr == framesetParent) {
|
if (nullptr == framesetParent) {
|
||||||
if (aPresContext->IsPaginated()) {
|
if (aPresContext->IsPaginated()) {
|
||||||
// XXX This needs to be changed when framesets paginate properly
|
// XXX This needs to be changed when framesets paginate properly
|
||||||
desiredSize.ISize(wm) = aReflowState.AvailableISize();
|
desiredSize.ISize(wm) = aReflowInput.AvailableISize();
|
||||||
desiredSize.BSize(wm) = aReflowState.AvailableBSize();
|
desiredSize.BSize(wm) = aReflowInput.AvailableBSize();
|
||||||
} else {
|
} else {
|
||||||
LogicalSize area(wm, aPresContext->GetVisibleArea().Size());
|
LogicalSize area(wm, aPresContext->GetVisibleArea().Size());
|
||||||
|
|
||||||
@@ -682,22 +682,22 @@ nsHTMLFramesetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||||||
void
|
void
|
||||||
nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsPoint& aOffset,
|
nsPoint& aOffset,
|
||||||
nsSize& aSize,
|
nsSize& aSize,
|
||||||
nsIntPoint* aCellIndex)
|
nsIntPoint* aCellIndex)
|
||||||
{
|
{
|
||||||
// reflow the child
|
// reflow the child
|
||||||
ReflowInput reflowState(aPresContext, aReflowState, aChild,
|
ReflowInput reflowInput(aPresContext, aReflowInput, aChild,
|
||||||
LogicalSize(aChild->GetWritingMode(), aSize));
|
LogicalSize(aChild->GetWritingMode(), aSize));
|
||||||
reflowState.SetComputedWidth(std::max(0, aSize.width - reflowState.ComputedPhysicalBorderPadding().LeftRight()));
|
reflowInput.SetComputedWidth(std::max(0, aSize.width - reflowInput.ComputedPhysicalBorderPadding().LeftRight()));
|
||||||
reflowState.SetComputedHeight(std::max(0, aSize.height - reflowState.ComputedPhysicalBorderPadding().TopBottom()));
|
reflowInput.SetComputedHeight(std::max(0, aSize.height - reflowInput.ComputedPhysicalBorderPadding().TopBottom()));
|
||||||
ReflowOutput metrics(aReflowState);
|
ReflowOutput metrics(aReflowInput);
|
||||||
metrics.Width() = aSize.width;
|
metrics.Width() = aSize.width;
|
||||||
metrics.Height() = aSize.height;
|
metrics.Height() = aSize.height;
|
||||||
nsReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
ReflowChild(aChild, aPresContext, metrics, reflowState, aOffset.x,
|
ReflowChild(aChild, aPresContext, metrics, reflowInput, aOffset.x,
|
||||||
aOffset.y, 0, status);
|
aOffset.y, 0, status);
|
||||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
|
||||||
|
|
||||||
@@ -793,25 +793,25 @@ nscolor nsHTMLFramesetFrame::GetBorderColor(nsIContent* aContent)
|
|||||||
void
|
void
|
||||||
nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsHTMLFramesetFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsHTMLFramesetFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
nsIPresShell *shell = aPresContext->PresShell();
|
nsIPresShell *shell = aPresContext->PresShell();
|
||||||
StyleSetHandle styleSet = shell->StyleSet();
|
StyleSetHandle styleSet = shell->StyleSet();
|
||||||
|
|
||||||
GetParent()->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
|
GetParent()->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
|
||||||
|
|
||||||
//printf("FramesetFrame2::Reflow %X (%d,%d) \n", this, aReflowState.AvailableWidth(), aReflowState.AvailableHeight());
|
//printf("FramesetFrame2::Reflow %X (%d,%d) \n", this, aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight());
|
||||||
// Always get the size so that the caller knows how big we are
|
// Always get the size so that the caller knows how big we are
|
||||||
GetDesiredSize(aPresContext, aReflowState, aDesiredSize);
|
GetDesiredSize(aPresContext, aReflowInput, aDesiredSize);
|
||||||
|
|
||||||
nscoord width = (aDesiredSize.Width() <= aReflowState.AvailableWidth())
|
nscoord width = (aDesiredSize.Width() <= aReflowInput.AvailableWidth())
|
||||||
? aDesiredSize.Width() : aReflowState.AvailableWidth();
|
? aDesiredSize.Width() : aReflowInput.AvailableWidth();
|
||||||
nscoord height = (aDesiredSize.Height() <= aReflowState.AvailableHeight())
|
nscoord height = (aDesiredSize.Height() <= aReflowInput.AvailableHeight())
|
||||||
? aDesiredSize.Height() : aReflowState.AvailableHeight();
|
? aDesiredSize.Height() : aReflowInput.AvailableHeight();
|
||||||
|
|
||||||
// We might be reflowed more than once with NS_FRAME_FIRST_REFLOW;
|
// We might be reflowed more than once with NS_FRAME_FIRST_REFLOW;
|
||||||
// that's allowed. (Though it will only happen for misuse of frameset
|
// that's allowed. (Though it will only happen for misuse of frameset
|
||||||
@@ -845,7 +845,7 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
if (mNumRows != rows || mNumCols != cols) {
|
if (mNumRows != rows || mNumCols != cols) {
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
mDrag.UnSet();
|
mDrag.UnSet();
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -923,7 +923,7 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
borderChildX++;
|
borderChildX++;
|
||||||
}
|
}
|
||||||
nsSize borderSize(aDesiredSize.Width(), borderWidth);
|
nsSize borderSize(aDesiredSize.Width(), borderWidth);
|
||||||
ReflowPlaceChild(borderFrame, aPresContext, aReflowState, offset, borderSize);
|
ReflowPlaceChild(borderFrame, aPresContext, aReflowInput, offset, borderSize);
|
||||||
borderFrame = nullptr;
|
borderFrame = nullptr;
|
||||||
offset.y += borderWidth;
|
offset.y += borderWidth;
|
||||||
} else {
|
} else {
|
||||||
@@ -953,14 +953,14 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
borderChildX++;
|
borderChildX++;
|
||||||
}
|
}
|
||||||
nsSize borderSize(borderWidth, aDesiredSize.Height());
|
nsSize borderSize(borderWidth, aDesiredSize.Height());
|
||||||
ReflowPlaceChild(borderFrame, aPresContext, aReflowState, offset, borderSize);
|
ReflowPlaceChild(borderFrame, aPresContext, aReflowInput, offset, borderSize);
|
||||||
borderFrame = nullptr;
|
borderFrame = nullptr;
|
||||||
}
|
}
|
||||||
offset.x += borderWidth;
|
offset.x += borderWidth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReflowPlaceChild(child, aPresContext, aReflowState, offset, size, &cellIndex);
|
ReflowPlaceChild(child, aPresContext, aReflowInput, offset, size, &cellIndex);
|
||||||
|
|
||||||
if (firstTime) {
|
if (firstTime) {
|
||||||
int32_t childVis;
|
int32_t childVis;
|
||||||
@@ -1082,7 +1082,7 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
FinishAndStoreOverflow(&aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIAtom*
|
nsIAtom*
|
||||||
@@ -1373,15 +1373,15 @@ void nsHTMLFramesetBorderFrame::SetColor(nscolor aColor)
|
|||||||
void
|
void
|
||||||
nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext,
|
nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsHTMLFramesetBorderFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsHTMLFramesetBorderFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
// Override Reflow(), since we don't want to deal with what our
|
// Override Reflow(), since we don't want to deal with what our
|
||||||
// computed values are.
|
// computed values are.
|
||||||
SizeToAvailSize(aReflowState, aDesiredSize);
|
SizeToAvailSize(aReflowInput, aDesiredSize);
|
||||||
|
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
@@ -1588,14 +1588,14 @@ nscoord nsHTMLFramesetBlankFrame::GetIntrinsicBSize()
|
|||||||
void
|
void
|
||||||
nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext,
|
nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsHTMLFramesetBlankFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsHTMLFramesetBlankFrame");
|
||||||
|
|
||||||
// Override Reflow(), since we don't want to deal with what our
|
// Override Reflow(), since we don't want to deal with what our
|
||||||
// computed values are.
|
// computed values are.
|
||||||
SizeToAvailSize(aReflowState, aDesiredSize);
|
SizeToAvailSize(aReflowInput, aDesiredSize);
|
||||||
|
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsIAtom* GetType() const override;
|
virtual nsIAtom* GetType() const override;
|
||||||
@@ -150,7 +150,7 @@ protected:
|
|||||||
nsString& aNewAttr);
|
nsString& aNewAttr);
|
||||||
|
|
||||||
virtual void GetDesiredSize(nsPresContext* aPresContext,
|
virtual void GetDesiredSize(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
ReflowOutput& aDesiredSize);
|
ReflowOutput& aDesiredSize);
|
||||||
|
|
||||||
int32_t GetBorderWidth(nsPresContext* aPresContext,
|
int32_t GetBorderWidth(nsPresContext* aPresContext,
|
||||||
@@ -176,7 +176,7 @@ protected:
|
|||||||
|
|
||||||
void ReflowPlaceChild(nsIFrame* aChild,
|
void ReflowPlaceChild(nsIFrame* aChild,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsPoint& aOffset,
|
nsPoint& aOffset,
|
||||||
nsSize& aSize,
|
nsSize& aSize,
|
||||||
nsIntPoint* aCellIndex = 0);
|
nsIntPoint* aCellIndex = 0);
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ nsHTMLScrollFrame::GetType() const
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
struct MOZ_STACK_CLASS ScrollReflowInput {
|
struct MOZ_STACK_CLASS ScrollReflowInput {
|
||||||
const ReflowInput& mReflowState;
|
const ReflowInput& mReflowInput;
|
||||||
nsBoxLayoutState mBoxState;
|
nsBoxLayoutState mBoxState;
|
||||||
ScrollbarStyles mStyles;
|
ScrollbarStyles mStyles;
|
||||||
nsMargin mComputedBorder;
|
nsMargin mComputedBorder;
|
||||||
@@ -228,7 +228,7 @@ struct MOZ_STACK_CLASS ScrollReflowInput {
|
|||||||
|
|
||||||
ScrollReflowInput(nsIScrollableFrame* aFrame,
|
ScrollReflowInput(nsIScrollableFrame* aFrame,
|
||||||
const ReflowInput& aState) :
|
const ReflowInput& aState) :
|
||||||
mReflowState(aState),
|
mReflowInput(aState),
|
||||||
// mBoxState is just used for scrollbars so we don't need to
|
// mBoxState is just used for scrollbars so we don't need to
|
||||||
// worry about the reflow depth here
|
// worry about the reflow depth here
|
||||||
mBoxState(aState.mFrame->PresContext(), aState.mRenderingContext, 0),
|
mBoxState(aState.mFrame->PresContext(), aState.mRenderingContext, 0),
|
||||||
@@ -245,21 +245,21 @@ static nsSize ComputeInsideBorderSize(ScrollReflowInput* aState,
|
|||||||
// aDesiredInsideBorderSize is the frame size; i.e., it includes
|
// aDesiredInsideBorderSize is the frame size; i.e., it includes
|
||||||
// borders and padding (but the scrolled child doesn't have
|
// borders and padding (but the scrolled child doesn't have
|
||||||
// borders). The scrolled child has the same padding as us.
|
// borders). The scrolled child has the same padding as us.
|
||||||
nscoord contentWidth = aState->mReflowState.ComputedWidth();
|
nscoord contentWidth = aState->mReflowInput.ComputedWidth();
|
||||||
if (contentWidth == NS_UNCONSTRAINEDSIZE) {
|
if (contentWidth == NS_UNCONSTRAINEDSIZE) {
|
||||||
contentWidth = aDesiredInsideBorderSize.width -
|
contentWidth = aDesiredInsideBorderSize.width -
|
||||||
aState->mReflowState.ComputedPhysicalPadding().LeftRight();
|
aState->mReflowInput.ComputedPhysicalPadding().LeftRight();
|
||||||
}
|
}
|
||||||
nscoord contentHeight = aState->mReflowState.ComputedHeight();
|
nscoord contentHeight = aState->mReflowInput.ComputedHeight();
|
||||||
if (contentHeight == NS_UNCONSTRAINEDSIZE) {
|
if (contentHeight == NS_UNCONSTRAINEDSIZE) {
|
||||||
contentHeight = aDesiredInsideBorderSize.height -
|
contentHeight = aDesiredInsideBorderSize.height -
|
||||||
aState->mReflowState.ComputedPhysicalPadding().TopBottom();
|
aState->mReflowInput.ComputedPhysicalPadding().TopBottom();
|
||||||
}
|
}
|
||||||
|
|
||||||
contentWidth = aState->mReflowState.ApplyMinMaxWidth(contentWidth);
|
contentWidth = aState->mReflowInput.ApplyMinMaxWidth(contentWidth);
|
||||||
contentHeight = aState->mReflowState.ApplyMinMaxHeight(contentHeight);
|
contentHeight = aState->mReflowInput.ApplyMinMaxHeight(contentHeight);
|
||||||
return nsSize(contentWidth + aState->mReflowState.ComputedPhysicalPadding().LeftRight(),
|
return nsSize(contentWidth + aState->mReflowInput.ComputedPhysicalPadding().LeftRight(),
|
||||||
contentHeight + aState->mReflowState.ComputedPhysicalPadding().TopBottom());
|
contentHeight + aState->mReflowInput.ComputedPhysicalPadding().TopBottom());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -438,9 +438,9 @@ nsHTMLScrollFrame::ScrolledContentDependsOnHeight(ScrollReflowInput* aState)
|
|||||||
// based on the presence of a horizontal scrollbar.
|
// based on the presence of a horizontal scrollbar.
|
||||||
return mHelper.mScrolledFrame->HasAnyStateBits(
|
return mHelper.mScrolledFrame->HasAnyStateBits(
|
||||||
NS_FRAME_CONTAINS_RELATIVE_BSIZE | NS_FRAME_DESCENDANT_INTRINSIC_ISIZE_DEPENDS_ON_BSIZE) ||
|
NS_FRAME_CONTAINS_RELATIVE_BSIZE | NS_FRAME_DESCENDANT_INTRINSIC_ISIZE_DEPENDS_ON_BSIZE) ||
|
||||||
aState->mReflowState.ComputedBSize() != NS_UNCONSTRAINEDSIZE ||
|
aState->mReflowInput.ComputedBSize() != NS_UNCONSTRAINEDSIZE ||
|
||||||
aState->mReflowState.ComputedMinBSize() > 0 ||
|
aState->mReflowInput.ComputedMinBSize() > 0 ||
|
||||||
aState->mReflowState.ComputedMaxBSize() != NS_UNCONSTRAINEDSIZE;
|
aState->mReflowInput.ComputedMaxBSize() != NS_UNCONSTRAINEDSIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -454,13 +454,13 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
|
|||||||
|
|
||||||
// these could be NS_UNCONSTRAINEDSIZE ... std::min arithmetic should
|
// these could be NS_UNCONSTRAINEDSIZE ... std::min arithmetic should
|
||||||
// be OK
|
// be OK
|
||||||
LogicalMargin padding = aState->mReflowState.ComputedLogicalPadding();
|
LogicalMargin padding = aState->mReflowInput.ComputedLogicalPadding();
|
||||||
nscoord availISize =
|
nscoord availISize =
|
||||||
aState->mReflowState.ComputedISize() + padding.IStartEnd(wm);
|
aState->mReflowInput.ComputedISize() + padding.IStartEnd(wm);
|
||||||
|
|
||||||
nscoord computedBSize = aState->mReflowState.ComputedBSize();
|
nscoord computedBSize = aState->mReflowInput.ComputedBSize();
|
||||||
nscoord computedMinBSize = aState->mReflowState.ComputedMinBSize();
|
nscoord computedMinBSize = aState->mReflowInput.ComputedMinBSize();
|
||||||
nscoord computedMaxBSize = aState->mReflowState.ComputedMaxBSize();
|
nscoord computedMaxBSize = aState->mReflowInput.ComputedMaxBSize();
|
||||||
if (!ShouldPropagateComputedBSizeToScrolledContent()) {
|
if (!ShouldPropagateComputedBSizeToScrolledContent()) {
|
||||||
computedBSize = NS_UNCONSTRAINEDSIZE;
|
computedBSize = NS_UNCONSTRAINEDSIZE;
|
||||||
computedMinBSize = 0;
|
computedMinBSize = 0;
|
||||||
@@ -513,20 +513,20 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
|
|||||||
|
|
||||||
// Pass false for aInit so we can pass in the correct padding.
|
// Pass false for aInit so we can pass in the correct padding.
|
||||||
ReflowInput
|
ReflowInput
|
||||||
kidReflowState(presContext, aState->mReflowState,
|
kidReflowInput(presContext, aState->mReflowInput,
|
||||||
mHelper.mScrolledFrame,
|
mHelper.mScrolledFrame,
|
||||||
LogicalSize(wm, availISize, NS_UNCONSTRAINEDSIZE),
|
LogicalSize(wm, availISize, NS_UNCONSTRAINEDSIZE),
|
||||||
nullptr, ReflowInput::CALLER_WILL_INIT);
|
nullptr, ReflowInput::CALLER_WILL_INIT);
|
||||||
const nsMargin physicalPadding = padding.GetPhysicalMargin(wm);
|
const nsMargin physicalPadding = padding.GetPhysicalMargin(wm);
|
||||||
kidReflowState.Init(presContext, nullptr, nullptr,
|
kidReflowInput.Init(presContext, nullptr, nullptr,
|
||||||
&physicalPadding);
|
&physicalPadding);
|
||||||
kidReflowState.mFlags.mAssumingHScrollbar = aAssumeHScroll;
|
kidReflowInput.mFlags.mAssumingHScrollbar = aAssumeHScroll;
|
||||||
kidReflowState.mFlags.mAssumingVScrollbar = aAssumeVScroll;
|
kidReflowInput.mFlags.mAssumingVScrollbar = aAssumeVScroll;
|
||||||
kidReflowState.SetComputedBSize(computedBSize);
|
kidReflowInput.SetComputedBSize(computedBSize);
|
||||||
kidReflowState.ComputedMinBSize() = computedMinBSize;
|
kidReflowInput.ComputedMinBSize() = computedMinBSize;
|
||||||
kidReflowState.ComputedMaxBSize() = computedMaxBSize;
|
kidReflowInput.ComputedMaxBSize() = computedMaxBSize;
|
||||||
if (aState->mReflowState.IsBResizeForWM(kidReflowState.GetWritingMode())) {
|
if (aState->mReflowInput.IsBResizeForWM(kidReflowInput.GetWritingMode())) {
|
||||||
kidReflowState.SetBResize(true);
|
kidReflowInput.SetBResize(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporarily set mHasHorizontalScrollbar/mHasVerticalScrollbar to
|
// Temporarily set mHasHorizontalScrollbar/mHasVerticalScrollbar to
|
||||||
@@ -542,7 +542,7 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
|
|||||||
// the frame (i.e. if NS_FRAME_NO_MOVE_FRAME isn't set)
|
// the frame (i.e. if NS_FRAME_NO_MOVE_FRAME isn't set)
|
||||||
const nsSize dummyContainerSize;
|
const nsSize dummyContainerSize;
|
||||||
ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics,
|
ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics,
|
||||||
kidReflowState, wm, LogicalPoint(wm), dummyContainerSize,
|
kidReflowInput, wm, LogicalPoint(wm), dummyContainerSize,
|
||||||
NS_FRAME_NO_MOVE_FRAME, status);
|
NS_FRAME_NO_MOVE_FRAME, status);
|
||||||
|
|
||||||
mHelper.mHasHorizontalScrollbar = didHaveHorizontalScrollbar;
|
mHelper.mHasHorizontalScrollbar = didHaveHorizontalScrollbar;
|
||||||
@@ -554,7 +554,7 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
|
|||||||
// which will usually be different from the scrollport height;
|
// which will usually be different from the scrollport height;
|
||||||
// invalidating the difference will cause unnecessary repainting.
|
// invalidating the difference will cause unnecessary repainting.
|
||||||
FinishReflowChild(mHelper.mScrolledFrame, presContext,
|
FinishReflowChild(mHelper.mScrolledFrame, presContext,
|
||||||
*aMetrics, &kidReflowState, wm, LogicalPoint(wm),
|
*aMetrics, &kidReflowInput, wm, LogicalPoint(wm),
|
||||||
dummyContainerSize,
|
dummyContainerSize,
|
||||||
NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW);
|
NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW);
|
||||||
|
|
||||||
@@ -835,16 +835,16 @@ GetBrowserRoot(nsIContent* aContent)
|
|||||||
void
|
void
|
||||||
nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsHTMLScrollFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsHTMLScrollFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
mHelper.HandleScrollbarStyleSwitching();
|
mHelper.HandleScrollbarStyleSwitching();
|
||||||
|
|
||||||
ScrollReflowInput state(this, aReflowState);
|
ScrollReflowInput state(this, aReflowInput);
|
||||||
// sanity check: ensure that if we have no scrollbar, we treat it
|
// sanity check: ensure that if we have no scrollbar, we treat it
|
||||||
// as hidden.
|
// as hidden.
|
||||||
if (!mHelper.mVScrollbarBox || mHelper.mNeverHasVerticalScrollbar)
|
if (!mHelper.mVScrollbarBox || mHelper.mNeverHasVerticalScrollbar)
|
||||||
@@ -856,7 +856,7 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
bool reflowHScrollbar = true;
|
bool reflowHScrollbar = true;
|
||||||
bool reflowVScrollbar = true;
|
bool reflowVScrollbar = true;
|
||||||
bool reflowScrollCorner = true;
|
bool reflowScrollCorner = true;
|
||||||
if (!aReflowState.ShouldReflowAllKids()) {
|
if (!aReflowInput.ShouldReflowAllKids()) {
|
||||||
#define NEEDS_REFLOW(frame_) \
|
#define NEEDS_REFLOW(frame_) \
|
||||||
((frame_) && NS_SUBTREE_DIRTY(frame_))
|
((frame_) && NS_SUBTREE_DIRTY(frame_))
|
||||||
|
|
||||||
@@ -884,8 +884,8 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
mHelper.mScrolledFrame->GetScrollableOverflowRectRelativeToParent();
|
mHelper.mScrolledFrame->GetScrollableOverflowRectRelativeToParent();
|
||||||
nsPoint oldScrollPosition = mHelper.GetScrollPosition();
|
nsPoint oldScrollPosition = mHelper.GetScrollPosition();
|
||||||
|
|
||||||
state.mComputedBorder = aReflowState.ComputedPhysicalBorderPadding() -
|
state.mComputedBorder = aReflowInput.ComputedPhysicalBorderPadding() -
|
||||||
aReflowState.ComputedPhysicalPadding();
|
aReflowInput.ComputedPhysicalPadding();
|
||||||
|
|
||||||
ReflowContents(&state, aDesiredSize);
|
ReflowContents(&state, aDesiredSize);
|
||||||
|
|
||||||
@@ -940,7 +940,7 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mHelper.UpdateSticky();
|
mHelper.UpdateSticky();
|
||||||
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus);
|
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
|
|
||||||
if (!InInitialReflow() && !mHelper.mHadNonInitialReflow) {
|
if (!InInitialReflow() && !mHelper.mHadNonInitialReflow) {
|
||||||
mHelper.mHadNonInitialReflow = true;
|
mHelper.mHadNonInitialReflow = true;
|
||||||
@@ -953,7 +953,7 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
mHelper.UpdatePrevScrolledRect();
|
mHelper.UpdatePrevScrolledRect();
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
mHelper.PostOverflowEvent();
|
mHelper.PostOverflowEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -702,7 +702,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override {
|
virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override {
|
||||||
@@ -1158,8 +1158,8 @@ public:
|
|||||||
void RemoveHorizontalScrollbar(nsBoxLayoutState& aState, bool aOnBottom);
|
void RemoveHorizontalScrollbar(nsBoxLayoutState& aState, bool aOnBottom);
|
||||||
void RemoveVerticalScrollbar (nsBoxLayoutState& aState, bool aOnRight);
|
void RemoveVerticalScrollbar (nsBoxLayoutState& aState, bool aOnRight);
|
||||||
|
|
||||||
static void AdjustReflowStateForPrintPreview(nsBoxLayoutState& aState, bool& aSetBack);
|
static void AdjustReflowInputForPrintPreview(nsBoxLayoutState& aState, bool& aSetBack);
|
||||||
static void AdjustReflowStateBack(nsBoxLayoutState& aState, bool aSetBack);
|
static void AdjustReflowInputBack(nsBoxLayoutState& aState, bool aSetBack);
|
||||||
|
|
||||||
// nsIScrollableFrame
|
// nsIScrollableFrame
|
||||||
virtual nsIFrame* GetScrolledFrame() const override {
|
virtual nsIFrame* GetScrolledFrame() const override {
|
||||||
|
|||||||
@@ -67,11 +67,11 @@ ReparentFrames(nsFrameList& aFrameList, nsContainerFrame* aOldParent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nscoord
|
static nscoord
|
||||||
ClampToCSSMaxBSize(nscoord aSize, const ReflowInput* aReflowState)
|
ClampToCSSMaxBSize(nscoord aSize, const ReflowInput* aReflowInput)
|
||||||
{
|
{
|
||||||
auto maxSize = aReflowState->ComputedMaxBSize();
|
auto maxSize = aReflowInput->ComputedMaxBSize();
|
||||||
if (MOZ_UNLIKELY(maxSize != NS_UNCONSTRAINEDSIZE)) {
|
if (MOZ_UNLIKELY(maxSize != NS_UNCONSTRAINEDSIZE)) {
|
||||||
MOZ_ASSERT(aReflowState->ComputedMinBSize() <= maxSize);
|
MOZ_ASSERT(aReflowInput->ComputedMinBSize() <= maxSize);
|
||||||
aSize = std::min(aSize, maxSize);
|
aSize = std::min(aSize, maxSize);
|
||||||
}
|
}
|
||||||
return aSize;
|
return aSize;
|
||||||
@@ -82,12 +82,12 @@ ClampToCSSMaxBSize(nscoord aSize, const ReflowInput* aReflowState)
|
|||||||
// i.e. we're effectively breaking in our overflow, so we should leave
|
// i.e. we're effectively breaking in our overflow, so we should leave
|
||||||
// aStatus as is (it will likely be set to OVERFLOW_INCOMPLETE later)).
|
// aStatus as is (it will likely be set to OVERFLOW_INCOMPLETE later)).
|
||||||
static nscoord
|
static nscoord
|
||||||
ClampToCSSMaxBSize(nscoord aSize, const ReflowInput* aReflowState,
|
ClampToCSSMaxBSize(nscoord aSize, const ReflowInput* aReflowInput,
|
||||||
nsReflowStatus* aStatus)
|
nsReflowStatus* aStatus)
|
||||||
{
|
{
|
||||||
auto maxSize = aReflowState->ComputedMaxBSize();
|
auto maxSize = aReflowInput->ComputedMaxBSize();
|
||||||
if (MOZ_UNLIKELY(maxSize != NS_UNCONSTRAINEDSIZE)) {
|
if (MOZ_UNLIKELY(maxSize != NS_UNCONSTRAINEDSIZE)) {
|
||||||
MOZ_ASSERT(aReflowState->ComputedMinBSize() <= maxSize);
|
MOZ_ASSERT(aReflowInput->ComputedMinBSize() <= maxSize);
|
||||||
if (aSize < maxSize) {
|
if (aSize < maxSize) {
|
||||||
NS_FRAME_SET_INCOMPLETE(*aStatus);
|
NS_FRAME_SET_INCOMPLETE(*aStatus);
|
||||||
} else {
|
} else {
|
||||||
@@ -1130,7 +1130,7 @@ struct nsGridContainerFrame::Tracks
|
|||||||
/**
|
/**
|
||||||
* Initialize grid item baseline state and offsets.
|
* Initialize grid item baseline state and offsets.
|
||||||
*/
|
*/
|
||||||
void InitializeItemBaselines(GridReflowState& aState,
|
void InitializeItemBaselines(GridReflowInput& aState,
|
||||||
nsTArray<GridItemInfo>& aGridItems);
|
nsTArray<GridItemInfo>& aGridItems);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1143,7 +1143,7 @@ struct nsGridContainerFrame::Tracks
|
|||||||
* Resolve Intrinsic Track Sizes.
|
* Resolve Intrinsic Track Sizes.
|
||||||
* http://dev.w3.org/csswg/css-grid/#algo-content
|
* http://dev.w3.org/csswg/css-grid/#algo-content
|
||||||
*/
|
*/
|
||||||
void ResolveIntrinsicSize(GridReflowState& aState,
|
void ResolveIntrinsicSize(GridReflowInput& aState,
|
||||||
nsTArray<GridItemInfo>& aGridItems,
|
nsTArray<GridItemInfo>& aGridItems,
|
||||||
const TrackSizingFunctions& aFunctions,
|
const TrackSizingFunctions& aFunctions,
|
||||||
LineRange GridArea::* aRange,
|
LineRange GridArea::* aRange,
|
||||||
@@ -1155,7 +1155,7 @@ struct nsGridContainerFrame::Tracks
|
|||||||
* non-spanning items" in the spec. Return true if the track has a <flex>
|
* non-spanning items" in the spec. Return true if the track has a <flex>
|
||||||
* max-sizing function, false otherwise.
|
* max-sizing function, false otherwise.
|
||||||
*/
|
*/
|
||||||
bool ResolveIntrinsicSizeStep1(GridReflowState& aState,
|
bool ResolveIntrinsicSizeStep1(GridReflowInput& aState,
|
||||||
const TrackSizingFunctions& aFunctions,
|
const TrackSizingFunctions& aFunctions,
|
||||||
nscoord aPercentageBasis,
|
nscoord aPercentageBasis,
|
||||||
IntrinsicISizeType aConstraint,
|
IntrinsicISizeType aConstraint,
|
||||||
@@ -1454,7 +1454,7 @@ struct nsGridContainerFrame::Tracks
|
|||||||
* (The returned value is a 'nscoord' divided by a factor - a floating type
|
* (The returned value is a 'nscoord' divided by a factor - a floating type
|
||||||
* is used to avoid intermediary rounding errors.)
|
* is used to avoid intermediary rounding errors.)
|
||||||
*/
|
*/
|
||||||
float FindUsedFlexFraction(GridReflowState& aState,
|
float FindUsedFlexFraction(GridReflowInput& aState,
|
||||||
nsTArray<GridItemInfo>& aGridItems,
|
nsTArray<GridItemInfo>& aGridItems,
|
||||||
const nsTArray<uint32_t>& aFlexTracks,
|
const nsTArray<uint32_t>& aFlexTracks,
|
||||||
const TrackSizingFunctions& aFunctions,
|
const TrackSizingFunctions& aFunctions,
|
||||||
@@ -1464,7 +1464,7 @@ struct nsGridContainerFrame::Tracks
|
|||||||
* Implements "12.7. Stretch Flexible Tracks"
|
* Implements "12.7. Stretch Flexible Tracks"
|
||||||
* http://dev.w3.org/csswg/css-grid/#algo-flex-tracks
|
* http://dev.w3.org/csswg/css-grid/#algo-flex-tracks
|
||||||
*/
|
*/
|
||||||
void StretchFlexibleTracks(GridReflowState& aState,
|
void StretchFlexibleTracks(GridReflowInput& aState,
|
||||||
nsTArray<GridItemInfo>& aGridItems,
|
nsTArray<GridItemInfo>& aGridItems,
|
||||||
const TrackSizingFunctions& aFunctions,
|
const TrackSizingFunctions& aFunctions,
|
||||||
nscoord aAvailableSize);
|
nscoord aAvailableSize);
|
||||||
@@ -1473,7 +1473,7 @@ struct nsGridContainerFrame::Tracks
|
|||||||
* Implements "12.3. Track Sizing Algorithm"
|
* Implements "12.3. Track Sizing Algorithm"
|
||||||
* http://dev.w3.org/csswg/css-grid/#algo-track-sizing
|
* http://dev.w3.org/csswg/css-grid/#algo-track-sizing
|
||||||
*/
|
*/
|
||||||
void CalculateSizes(GridReflowState& aState,
|
void CalculateSizes(GridReflowInput& aState,
|
||||||
nsTArray<GridItemInfo>& aGridItems,
|
nsTArray<GridItemInfo>& aGridItems,
|
||||||
const TrackSizingFunctions& aFunctions,
|
const TrackSizingFunctions& aFunctions,
|
||||||
nscoord aContentSize,
|
nscoord aContentSize,
|
||||||
@@ -1638,14 +1638,14 @@ struct nsGridContainerFrame::Tracks
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Grid data shared by all continuations, owned by the first-in-flow.
|
* Grid data shared by all continuations, owned by the first-in-flow.
|
||||||
* The data is initialized from the first-in-flow's GridReflowState at
|
* The data is initialized from the first-in-flow's GridReflowInput at
|
||||||
* the end of its reflow. Fragmentation will modify mRows.mSizes -
|
* the end of its reflow. Fragmentation will modify mRows.mSizes -
|
||||||
* the mPosition to remove the row gap at the break boundary, the mState
|
* the mPosition to remove the row gap at the break boundary, the mState
|
||||||
* by setting the eBreakBefore flag, and mBase is modified when we decide
|
* by setting the eBreakBefore flag, and mBase is modified when we decide
|
||||||
* to grow a row. mOriginalRowData is setup by the first-in-flow and
|
* to grow a row. mOriginalRowData is setup by the first-in-flow and
|
||||||
* not modified after that. It's used for undoing the changes to mRows.
|
* not modified after that. It's used for undoing the changes to mRows.
|
||||||
* mCols, mGridItems, mAbsPosItems are used for initializing the grid
|
* mCols, mGridItems, mAbsPosItems are used for initializing the grid
|
||||||
* reflow state for continuations, see GridReflowState::Initialize below.
|
* reflow state for continuations, see GridReflowInput::Initialize below.
|
||||||
*/
|
*/
|
||||||
struct nsGridContainerFrame::SharedGridData
|
struct nsGridContainerFrame::SharedGridData
|
||||||
{
|
{
|
||||||
@@ -1663,21 +1663,21 @@ struct nsGridContainerFrame::SharedGridData
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Only set on the first-in-flow. Continuations will Initialize() their
|
* Only set on the first-in-flow. Continuations will Initialize() their
|
||||||
* GridReflowState from it.
|
* GridReflowInput from it.
|
||||||
*/
|
*/
|
||||||
NS_DECLARE_FRAME_PROPERTY_DELETABLE(Prop, SharedGridData)
|
NS_DECLARE_FRAME_PROPERTY_DELETABLE(Prop, SharedGridData)
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MOZ_STACK_CLASS nsGridContainerFrame::GridReflowState
|
struct MOZ_STACK_CLASS nsGridContainerFrame::GridReflowInput
|
||||||
{
|
{
|
||||||
GridReflowState(nsGridContainerFrame* aFrame,
|
GridReflowInput(nsGridContainerFrame* aFrame,
|
||||||
const ReflowInput& aRS)
|
const ReflowInput& aRS)
|
||||||
: GridReflowState(aFrame, *aRS.mRenderingContext, &aRS, aRS.mStylePosition,
|
: GridReflowInput(aFrame, *aRS.mRenderingContext, &aRS, aRS.mStylePosition,
|
||||||
aRS.GetWritingMode())
|
aRS.GetWritingMode())
|
||||||
{}
|
{}
|
||||||
GridReflowState(nsGridContainerFrame* aFrame,
|
GridReflowInput(nsGridContainerFrame* aFrame,
|
||||||
nsRenderingContext& aRC)
|
nsRenderingContext& aRC)
|
||||||
: GridReflowState(aFrame, aRC, nullptr, aFrame->StylePosition(),
|
: GridReflowInput(aFrame, aRC, nullptr, aFrame->StylePosition(),
|
||||||
aFrame->GetWritingMode())
|
aFrame->GetWritingMode())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -1825,11 +1825,11 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::GridReflowState
|
|||||||
nsTArray<GridItemInfo> mAbsPosItems;
|
nsTArray<GridItemInfo> mAbsPosItems;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @note mReflowState may be null when using the 2nd ctor above. In this case
|
* @note mReflowInput may be null when using the 2nd ctor above. In this case
|
||||||
* we'll construct a dummy parent reflow state if we need it to calculate
|
* we'll construct a dummy parent reflow state if we need it to calculate
|
||||||
* min/max-content contributions when sizing tracks.
|
* min/max-content contributions when sizing tracks.
|
||||||
*/
|
*/
|
||||||
const ReflowInput* const mReflowState;
|
const ReflowInput* const mReflowInput;
|
||||||
nsRenderingContext& mRenderingContext;
|
nsRenderingContext& mRenderingContext;
|
||||||
nsGridContainerFrame* const mFrame;
|
nsGridContainerFrame* const mFrame;
|
||||||
SharedGridData* mSharedGridData; // [weak] owned by mFrame's first-in-flow.
|
SharedGridData* mSharedGridData; // [weak] owned by mFrame's first-in-flow.
|
||||||
@@ -1848,9 +1848,9 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::GridReflowState
|
|||||||
const WritingMode mWM;
|
const WritingMode mWM;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GridReflowState(nsGridContainerFrame* aFrame,
|
GridReflowInput(nsGridContainerFrame* aFrame,
|
||||||
nsRenderingContext& aRenderingContext,
|
nsRenderingContext& aRenderingContext,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
const nsStylePosition* aGridStyle,
|
const nsStylePosition* aGridStyle,
|
||||||
const WritingMode& aWM)
|
const WritingMode& aWM)
|
||||||
: mIter(aFrame, kPrincipalList)
|
: mIter(aFrame, kPrincipalList)
|
||||||
@@ -1863,7 +1863,7 @@ private:
|
|||||||
, mRowFunctions(mGridStyle->mGridTemplateRows,
|
, mRowFunctions(mGridStyle->mGridTemplateRows,
|
||||||
mGridStyle->mGridAutoRowsMin,
|
mGridStyle->mGridAutoRowsMin,
|
||||||
mGridStyle->mGridAutoRowsMax)
|
mGridStyle->mGridAutoRowsMax)
|
||||||
, mReflowState(aReflowState)
|
, mReflowInput(aReflowInput)
|
||||||
, mRenderingContext(aRenderingContext)
|
, mRenderingContext(aRenderingContext)
|
||||||
, mFrame(aFrame)
|
, mFrame(aFrame)
|
||||||
, mSharedGridData(nullptr)
|
, mSharedGridData(nullptr)
|
||||||
@@ -1872,16 +1872,16 @@ private:
|
|||||||
, mStartRow(0)
|
, mStartRow(0)
|
||||||
, mWM(aWM)
|
, mWM(aWM)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!aReflowState || aReflowState->mFrame == mFrame);
|
MOZ_ASSERT(!aReflowInput || aReflowInput->mFrame == mFrame);
|
||||||
if (aReflowState) {
|
if (aReflowInput) {
|
||||||
mBorderPadding = aReflowState->ComputedLogicalBorderPadding();
|
mBorderPadding = aReflowInput->ComputedLogicalBorderPadding();
|
||||||
mSkipSides = aFrame->PreReflowBlockLevelLogicalSkipSides();
|
mSkipSides = aFrame->PreReflowBlockLevelLogicalSkipSides();
|
||||||
mBorderPadding.ApplySkipSides(mSkipSides);
|
mBorderPadding.ApplySkipSides(mSkipSides);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
using GridReflowState = nsGridContainerFrame::GridReflowState;
|
using GridReflowInput = nsGridContainerFrame::GridReflowInput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Grid implements grid item placement and the state of the grid -
|
* The Grid implements grid item placement and the state of the grid -
|
||||||
@@ -1900,7 +1900,7 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::Grid
|
|||||||
* @param aComputedMaxSize the container's max-size - used to determine
|
* @param aComputedMaxSize the container's max-size - used to determine
|
||||||
* the number of repeat(auto-fill/fit) tracks.
|
* the number of repeat(auto-fill/fit) tracks.
|
||||||
*/
|
*/
|
||||||
void PlaceGridItems(GridReflowState& aState,
|
void PlaceGridItems(GridReflowInput& aState,
|
||||||
const LogicalSize& aComputedMinSize,
|
const LogicalSize& aComputedMinSize,
|
||||||
const LogicalSize& aComputedSize,
|
const LogicalSize& aComputedSize,
|
||||||
const LogicalSize& aComputedMaxSize);
|
const LogicalSize& aComputedMaxSize);
|
||||||
@@ -2254,7 +2254,7 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::Grid
|
|||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
nsGridContainerFrame::GridReflowState::CalculateTrackSizes(
|
nsGridContainerFrame::GridReflowInput::CalculateTrackSizes(
|
||||||
const Grid& aGrid,
|
const Grid& aGrid,
|
||||||
const LogicalSize& aContentBox,
|
const LogicalSize& aContentBox,
|
||||||
IntrinsicISizeType aConstraint)
|
IntrinsicISizeType aConstraint)
|
||||||
@@ -3093,7 +3093,7 @@ nsGridContainerFrame::Grid::PlaceAutoAutoInColOrder(uint32_t aStartCol,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsGridContainerFrame::Grid::PlaceGridItems(GridReflowState& aState,
|
nsGridContainerFrame::Grid::PlaceGridItems(GridReflowInput& aState,
|
||||||
const LogicalSize& aComputedMinSize,
|
const LogicalSize& aComputedMinSize,
|
||||||
const LogicalSize& aComputedSize,
|
const LogicalSize& aComputedSize,
|
||||||
const LogicalSize& aComputedMaxSize)
|
const LogicalSize& aComputedMaxSize)
|
||||||
@@ -3420,15 +3420,15 @@ nsGridContainerFrame::Tracks::Initialize(
|
|||||||
*/
|
*/
|
||||||
static nscoord
|
static nscoord
|
||||||
MeasuringReflow(nsIFrame* aChild,
|
MeasuringReflow(nsIFrame* aChild,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
nsRenderingContext* aRC,
|
nsRenderingContext* aRC,
|
||||||
const LogicalSize& aAvailableSize)
|
const LogicalSize& aAvailableSize)
|
||||||
{
|
{
|
||||||
nsContainerFrame* parent = aChild->GetParent();
|
nsContainerFrame* parent = aChild->GetParent();
|
||||||
nsPresContext* pc = aChild->PresContext();
|
nsPresContext* pc = aChild->PresContext();
|
||||||
Maybe<ReflowInput> dummyParentState;
|
Maybe<ReflowInput> dummyParentState;
|
||||||
const ReflowInput* rs = aReflowState;
|
const ReflowInput* rs = aReflowInput;
|
||||||
if (!aReflowState) {
|
if (!aReflowInput) {
|
||||||
MOZ_ASSERT(!parent->HasAnyStateBits(NS_FRAME_IN_REFLOW));
|
MOZ_ASSERT(!parent->HasAnyStateBits(NS_FRAME_IN_REFLOW));
|
||||||
dummyParentState.emplace(pc, parent, aRC,
|
dummyParentState.emplace(pc, parent, aRC,
|
||||||
LogicalSize(parent->GetWritingMode(), 0,
|
LogicalSize(parent->GetWritingMode(), 0,
|
||||||
@@ -3464,7 +3464,7 @@ MeasuringReflow(nsIFrame* aChild,
|
|||||||
*/
|
*/
|
||||||
static nscoord
|
static nscoord
|
||||||
ContentContribution(const GridItemInfo& aGridItem,
|
ContentContribution(const GridItemInfo& aGridItem,
|
||||||
const GridReflowState& aState,
|
const GridReflowInput& aState,
|
||||||
nsRenderingContext* aRC,
|
nsRenderingContext* aRC,
|
||||||
WritingMode aCBWM,
|
WritingMode aCBWM,
|
||||||
LogicalAxis aAxis,
|
LogicalAxis aAxis,
|
||||||
@@ -3490,7 +3490,7 @@ ContentContribution(const GridItemInfo& aGridItem,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
LogicalSize availableSize(childWM, cbISize, cbBSize);
|
LogicalSize availableSize(childWM, cbISize, cbBSize);
|
||||||
size = ::MeasuringReflow(child, aState.mReflowState, aRC, availableSize);
|
size = ::MeasuringReflow(child, aState.mReflowInput, aRC, availableSize);
|
||||||
nsIFrame::IntrinsicISizeOffsetData offsets = child->IntrinsicBSizeOffsets();
|
nsIFrame::IntrinsicISizeOffsetData offsets = child->IntrinsicBSizeOffsets();
|
||||||
size += offsets.hMargin;
|
size += offsets.hMargin;
|
||||||
size = nsLayoutUtils::AddPercents(aConstraint, size, offsets.hPctMargin);
|
size = nsLayoutUtils::AddPercents(aConstraint, size, offsets.hPctMargin);
|
||||||
@@ -3506,7 +3506,7 @@ ContentContribution(const GridItemInfo& aGridItem,
|
|||||||
|
|
||||||
static nscoord
|
static nscoord
|
||||||
MinContentContribution(const GridItemInfo& aGridItem,
|
MinContentContribution(const GridItemInfo& aGridItem,
|
||||||
const GridReflowState& aState,
|
const GridReflowInput& aState,
|
||||||
nsRenderingContext* aRC,
|
nsRenderingContext* aRC,
|
||||||
WritingMode aCBWM,
|
WritingMode aCBWM,
|
||||||
LogicalAxis aAxis)
|
LogicalAxis aAxis)
|
||||||
@@ -3517,7 +3517,7 @@ MinContentContribution(const GridItemInfo& aGridItem,
|
|||||||
|
|
||||||
static nscoord
|
static nscoord
|
||||||
MaxContentContribution(const GridItemInfo& aGridItem,
|
MaxContentContribution(const GridItemInfo& aGridItem,
|
||||||
const GridReflowState& aState,
|
const GridReflowInput& aState,
|
||||||
nsRenderingContext* aRC,
|
nsRenderingContext* aRC,
|
||||||
WritingMode aCBWM,
|
WritingMode aCBWM,
|
||||||
LogicalAxis aAxis)
|
LogicalAxis aAxis)
|
||||||
@@ -3528,7 +3528,7 @@ MaxContentContribution(const GridItemInfo& aGridItem,
|
|||||||
|
|
||||||
static nscoord
|
static nscoord
|
||||||
MinSize(const GridItemInfo& aGridItem,
|
MinSize(const GridItemInfo& aGridItem,
|
||||||
const GridReflowState& aState,
|
const GridReflowInput& aState,
|
||||||
nsRenderingContext* aRC,
|
nsRenderingContext* aRC,
|
||||||
WritingMode aCBWM,
|
WritingMode aCBWM,
|
||||||
LogicalAxis aAxis)
|
LogicalAxis aAxis)
|
||||||
@@ -3567,7 +3567,7 @@ MinSize(const GridItemInfo& aGridItem,
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsGridContainerFrame::Tracks::CalculateSizes(
|
nsGridContainerFrame::Tracks::CalculateSizes(
|
||||||
GridReflowState& aState,
|
GridReflowInput& aState,
|
||||||
nsTArray<GridItemInfo>& aGridItems,
|
nsTArray<GridItemInfo>& aGridItems,
|
||||||
const TrackSizingFunctions& aFunctions,
|
const TrackSizingFunctions& aFunctions,
|
||||||
nscoord aContentBoxSize,
|
nscoord aContentBoxSize,
|
||||||
@@ -3621,7 +3621,7 @@ nsGridContainerFrame::Tracks::HasIntrinsicButNoFlexSizingInRange(
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
nsGridContainerFrame::Tracks::ResolveIntrinsicSizeStep1(
|
nsGridContainerFrame::Tracks::ResolveIntrinsicSizeStep1(
|
||||||
GridReflowState& aState,
|
GridReflowInput& aState,
|
||||||
const TrackSizingFunctions& aFunctions,
|
const TrackSizingFunctions& aFunctions,
|
||||||
nscoord aPercentageBasis,
|
nscoord aPercentageBasis,
|
||||||
IntrinsicISizeType aConstraint,
|
IntrinsicISizeType aConstraint,
|
||||||
@@ -3730,7 +3730,7 @@ nsGridContainerFrame::Tracks::CalculateItemBaselines(
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsGridContainerFrame::Tracks::InitializeItemBaselines(
|
nsGridContainerFrame::Tracks::InitializeItemBaselines(
|
||||||
GridReflowState& aState,
|
GridReflowInput& aState,
|
||||||
nsTArray<GridItemInfo>& aGridItems)
|
nsTArray<GridItemInfo>& aGridItems)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -3838,7 +3838,7 @@ nsGridContainerFrame::Tracks::InitializeItemBaselines(
|
|||||||
auto* rc = &aState.mRenderingContext;
|
auto* rc = &aState.mRenderingContext;
|
||||||
// XXX figure out if we can avoid/merge this reflow with the main reflow.
|
// XXX figure out if we can avoid/merge this reflow with the main reflow.
|
||||||
// XXX (after bug 1174569 is sorted out)
|
// XXX (after bug 1174569 is sorted out)
|
||||||
::MeasuringReflow(child, aState.mReflowState, rc, avail);
|
::MeasuringReflow(child, aState.mReflowInput, rc, avail);
|
||||||
nscoord baseline;
|
nscoord baseline;
|
||||||
if (state & ItemState::eFirstBaseline) {
|
if (state & ItemState::eFirstBaseline) {
|
||||||
if (nsLayoutUtils::GetFirstLineBaseline(wm, child, &baseline)) {
|
if (nsLayoutUtils::GetFirstLineBaseline(wm, child, &baseline)) {
|
||||||
@@ -3941,7 +3941,7 @@ nsGridContainerFrame::Tracks::AlignBaselineSubtree(
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsGridContainerFrame::Tracks::ResolveIntrinsicSize(
|
nsGridContainerFrame::Tracks::ResolveIntrinsicSize(
|
||||||
GridReflowState& aState,
|
GridReflowInput& aState,
|
||||||
nsTArray<GridItemInfo>& aGridItems,
|
nsTArray<GridItemInfo>& aGridItems,
|
||||||
const TrackSizingFunctions& aFunctions,
|
const TrackSizingFunctions& aFunctions,
|
||||||
LineRange GridArea::* aRange,
|
LineRange GridArea::* aRange,
|
||||||
@@ -4246,7 +4246,7 @@ nsGridContainerFrame::Tracks::FindFrUnitSize(
|
|||||||
|
|
||||||
float
|
float
|
||||||
nsGridContainerFrame::Tracks::FindUsedFlexFraction(
|
nsGridContainerFrame::Tracks::FindUsedFlexFraction(
|
||||||
GridReflowState& aState,
|
GridReflowInput& aState,
|
||||||
nsTArray<GridItemInfo>& aGridItems,
|
nsTArray<GridItemInfo>& aGridItems,
|
||||||
const nsTArray<uint32_t>& aFlexTracks,
|
const nsTArray<uint32_t>& aFlexTracks,
|
||||||
const TrackSizingFunctions& aFunctions,
|
const TrackSizingFunctions& aFunctions,
|
||||||
@@ -4299,7 +4299,7 @@ nsGridContainerFrame::Tracks::FindUsedFlexFraction(
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsGridContainerFrame::Tracks::StretchFlexibleTracks(
|
nsGridContainerFrame::Tracks::StretchFlexibleTracks(
|
||||||
GridReflowState& aState,
|
GridReflowInput& aState,
|
||||||
nsTArray<GridItemInfo>& aGridItems,
|
nsTArray<GridItemInfo>& aGridItems,
|
||||||
const TrackSizingFunctions& aFunctions,
|
const TrackSizingFunctions& aFunctions,
|
||||||
nscoord aAvailableSize)
|
nscoord aAvailableSize)
|
||||||
@@ -4526,7 +4526,7 @@ nsGridContainerFrame::LineRange::ToPositionAndLengthForAbsPos(
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogicalRect
|
LogicalRect
|
||||||
nsGridContainerFrame::GridReflowState::ContainingBlockFor(const GridArea& aArea) const
|
nsGridContainerFrame::GridReflowInput::ContainingBlockFor(const GridArea& aArea) const
|
||||||
{
|
{
|
||||||
nscoord i, b, iSize, bSize;
|
nscoord i, b, iSize, bSize;
|
||||||
MOZ_ASSERT(aArea.mCols.Extent() > 0, "grid items cover at least one track");
|
MOZ_ASSERT(aArea.mCols.Extent() > 0, "grid items cover at least one track");
|
||||||
@@ -4537,7 +4537,7 @@ nsGridContainerFrame::GridReflowState::ContainingBlockFor(const GridArea& aArea)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogicalRect
|
LogicalRect
|
||||||
nsGridContainerFrame::GridReflowState::ContainingBlockForAbsPos(
|
nsGridContainerFrame::GridReflowInput::ContainingBlockForAbsPos(
|
||||||
const GridArea& aArea,
|
const GridArea& aArea,
|
||||||
const LogicalPoint& aGridOrigin,
|
const LogicalPoint& aGridOrigin,
|
||||||
const LogicalRect& aGridCB) const
|
const LogicalRect& aGridCB) const
|
||||||
@@ -4560,13 +4560,13 @@ nsGridContainerFrame::GridReflowState::ContainingBlockForAbsPos(
|
|||||||
* the same writing-mode and have overflow:visible.
|
* the same writing-mode and have overflow:visible.
|
||||||
*/
|
*/
|
||||||
Maybe<nsGridContainerFrame::Fragmentainer>
|
Maybe<nsGridContainerFrame::Fragmentainer>
|
||||||
nsGridContainerFrame::GetNearestFragmentainer(const GridReflowState& aState) const
|
nsGridContainerFrame::GetNearestFragmentainer(const GridReflowInput& aState) const
|
||||||
{
|
{
|
||||||
Maybe<nsGridContainerFrame::Fragmentainer> data;
|
Maybe<nsGridContainerFrame::Fragmentainer> data;
|
||||||
WritingMode wm = aState.mWM;
|
WritingMode wm = aState.mWM;
|
||||||
const ReflowInput* gridRS = aState.mReflowState;
|
const ReflowInput* gridRS = aState.mReflowInput;
|
||||||
const ReflowInput* cbRS = gridRS->mCBReflowState;
|
const ReflowInput* cbRS = gridRS->mCBReflowInput;
|
||||||
for ( ; cbRS; cbRS = cbRS->mCBReflowState) {
|
for ( ; cbRS; cbRS = cbRS->mCBReflowInput) {
|
||||||
nsIScrollableFrame* sf = do_QueryFrame(cbRS->mFrame);
|
nsIScrollableFrame* sf = do_QueryFrame(cbRS->mFrame);
|
||||||
if (sf) {
|
if (sf) {
|
||||||
break;
|
break;
|
||||||
@@ -4610,15 +4610,15 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
|
|||||||
nsSize aContainerSize,
|
nsSize aContainerSize,
|
||||||
Maybe<nscoord> aStretchBSize,
|
Maybe<nscoord> aStretchBSize,
|
||||||
const Fragmentainer* aFragmentainer,
|
const Fragmentainer* aFragmentainer,
|
||||||
const GridReflowState& aState,
|
const GridReflowInput& aState,
|
||||||
const LogicalRect& aContentArea,
|
const LogicalRect& aContentArea,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsPresContext* pc = PresContext();
|
nsPresContext* pc = PresContext();
|
||||||
nsStyleContext* containerSC = StyleContext();
|
nsStyleContext* containerSC = StyleContext();
|
||||||
WritingMode wm = aState.mReflowState->GetWritingMode();
|
WritingMode wm = aState.mReflowInput->GetWritingMode();
|
||||||
LogicalMargin pad(aState.mReflowState->ComputedLogicalPadding());
|
LogicalMargin pad(aState.mReflowInput->ComputedLogicalPadding());
|
||||||
const LogicalPoint padStart(wm, pad.IStart(wm), pad.BStart(wm));
|
const LogicalPoint padStart(wm, pad.IStart(wm), pad.BStart(wm));
|
||||||
const bool isGridItem = !!aGridItemInfo;
|
const bool isGridItem = !!aGridItemInfo;
|
||||||
MOZ_ASSERT(isGridItem == (aChild->GetType() != nsGkAtoms::placeholderFrame));
|
MOZ_ASSERT(isGridItem == (aChild->GetType() != nsGkAtoms::placeholderFrame));
|
||||||
@@ -4693,7 +4693,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogicalSize percentBasis(cb.Size(wm).ConvertTo(childWM, wm));
|
LogicalSize percentBasis(cb.Size(wm).ConvertTo(childWM, wm));
|
||||||
ReflowInput childRS(pc, *aState.mReflowState, aChild, childCBSize,
|
ReflowInput childRS(pc, *aState.mReflowInput, aChild, childCBSize,
|
||||||
&percentBasis);
|
&percentBasis);
|
||||||
childRS.mFlags.mIsTopOfPage = aFragmentainer ? aFragmentainer->mIsTopOfPage : false;
|
childRS.mFlags.mIsTopOfPage = aFragmentainer ? aFragmentainer->mIsTopOfPage : false;
|
||||||
|
|
||||||
@@ -4760,7 +4760,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
nsGridContainerFrame::ReflowInFragmentainer(GridReflowState& aState,
|
nsGridContainerFrame::ReflowInFragmentainer(GridReflowInput& aState,
|
||||||
const LogicalRect& aContentArea,
|
const LogicalRect& aContentArea,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
@@ -4768,7 +4768,7 @@ nsGridContainerFrame::ReflowInFragmentainer(GridReflowState& aState,
|
|||||||
const nsSize& aContainerSize)
|
const nsSize& aContainerSize)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aStatus == NS_FRAME_COMPLETE);
|
MOZ_ASSERT(aStatus == NS_FRAME_COMPLETE);
|
||||||
MOZ_ASSERT(aState.mReflowState);
|
MOZ_ASSERT(aState.mReflowInput);
|
||||||
|
|
||||||
// Collect our grid items and sort them in row order. Collect placeholders
|
// Collect our grid items and sort them in row order. Collect placeholders
|
||||||
// and put them in a separate array.
|
// and put them in a separate array.
|
||||||
@@ -4803,7 +4803,7 @@ nsGridContainerFrame::ReflowInFragmentainer(GridReflowState& aState,
|
|||||||
nscoord childAvailableSize = aFragmentainer.mToFragmentainerEnd;
|
nscoord childAvailableSize = aFragmentainer.mToFragmentainerEnd;
|
||||||
const uint32_t startRow = aState.mStartRow;
|
const uint32_t startRow = aState.mStartRow;
|
||||||
const uint32_t numRows = aState.mRows.mSizes.Length();
|
const uint32_t numRows = aState.mRows.mSizes.Length();
|
||||||
bool isBDBClone = aState.mReflowState->mStyleBorder->mBoxDecorationBreak ==
|
bool isBDBClone = aState.mReflowInput->mStyleBorder->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE;
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE;
|
||||||
nscoord bpBEnd = aState.mBorderPadding.BEnd(aState.mWM);
|
nscoord bpBEnd = aState.mBorderPadding.BEnd(aState.mWM);
|
||||||
|
|
||||||
@@ -4823,7 +4823,7 @@ nsGridContainerFrame::ReflowInFragmentainer(GridReflowState& aState,
|
|||||||
// Check for forced breaks on the items.
|
// Check for forced breaks on the items.
|
||||||
const bool isTopOfPage = aFragmentainer.mIsTopOfPage;
|
const bool isTopOfPage = aFragmentainer.mIsTopOfPage;
|
||||||
bool isForcedBreak = false;
|
bool isForcedBreak = false;
|
||||||
const bool avoidBreakInside = ShouldAvoidBreakInside(*aState.mReflowState);
|
const bool avoidBreakInside = ShouldAvoidBreakInside(*aState.mReflowInput);
|
||||||
for (const GridItemInfo* info : sortedItems) {
|
for (const GridItemInfo* info : sortedItems) {
|
||||||
uint32_t itemStartRow = info->mArea.mRows.mStart;
|
uint32_t itemStartRow = info->mArea.mRows.mStart;
|
||||||
if (itemStartRow == endRow) {
|
if (itemStartRow == endRow) {
|
||||||
@@ -4885,7 +4885,7 @@ nsGridContainerFrame::ReflowInFragmentainer(GridReflowState& aState,
|
|||||||
// We only apply min-bsize once all rows are complete (when bsize is auto).
|
// We only apply min-bsize once all rows are complete (when bsize is auto).
|
||||||
if (endRow < numRows) {
|
if (endRow < numRows) {
|
||||||
bSize = bEndRow;
|
bSize = bEndRow;
|
||||||
auto clampedBSize = ClampToCSSMaxBSize(bSize, aState.mReflowState);
|
auto clampedBSize = ClampToCSSMaxBSize(bSize, aState.mReflowInput);
|
||||||
if (MOZ_UNLIKELY(clampedBSize != bSize)) {
|
if (MOZ_UNLIKELY(clampedBSize != bSize)) {
|
||||||
// We apply max-bsize in all fragments though.
|
// We apply max-bsize in all fragments though.
|
||||||
bSize = clampedBSize;
|
bSize = clampedBSize;
|
||||||
@@ -4896,13 +4896,13 @@ nsGridContainerFrame::ReflowInFragmentainer(GridReflowState& aState,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bSize = NS_CSS_MINMAX(bEndRow,
|
bSize = NS_CSS_MINMAX(bEndRow,
|
||||||
aState.mReflowState->ComputedMinBSize(),
|
aState.mReflowInput->ComputedMinBSize(),
|
||||||
aState.mReflowState->ComputedMaxBSize());
|
aState.mReflowInput->ComputedMaxBSize());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bSize = NS_CSS_MINMAX(aState.mReflowState->ComputedBSize(),
|
bSize = NS_CSS_MINMAX(aState.mReflowInput->ComputedBSize(),
|
||||||
aState.mReflowState->ComputedMinBSize(),
|
aState.mReflowInput->ComputedMinBSize(),
|
||||||
aState.mReflowState->ComputedMaxBSize());
|
aState.mReflowInput->ComputedMaxBSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for overflow and set aStatus INCOMPLETE if so.
|
// Check for overflow and set aStatus INCOMPLETE if so.
|
||||||
@@ -4942,12 +4942,12 @@ nsGridContainerFrame::ReflowInFragmentainer(GridReflowState& aState,
|
|||||||
bEndRow = aState.mRows.GridLineEdge(endRow, GridLineSide::eBeforeGridGap);
|
bEndRow = aState.mRows.GridLineEdge(endRow, GridLineSide::eBeforeGridGap);
|
||||||
bSize = bEndRow;
|
bSize = bEndRow;
|
||||||
if (aFragmentainer.mIsAutoBSize) {
|
if (aFragmentainer.mIsAutoBSize) {
|
||||||
bSize = ClampToCSSMaxBSize(bSize, aState.mReflowState);
|
bSize = ClampToCSSMaxBSize(bSize, aState.mReflowInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NS_FRAME_SET_INCOMPLETE(aStatus);
|
NS_FRAME_SET_INCOMPLETE(aStatus);
|
||||||
} else if (endRow < numRows) {
|
} else if (endRow < numRows) {
|
||||||
bSize = ClampToCSSMaxBSize(bEndRow, aState.mReflowState, &aStatus);
|
bSize = ClampToCSSMaxBSize(bEndRow, aState.mReflowInput, &aStatus);
|
||||||
} // else - no break opportunities.
|
} // else - no break opportunities.
|
||||||
} else {
|
} else {
|
||||||
// Even though our block-size fits we need to honor forced breaks, or if
|
// Even though our block-size fits we need to honor forced breaks, or if
|
||||||
@@ -4955,7 +4955,7 @@ nsGridContainerFrame::ReflowInFragmentainer(GridReflowState& aState,
|
|||||||
// by a max-bsize which make us overflow-incomplete).
|
// by a max-bsize which make us overflow-incomplete).
|
||||||
if (endRow < numRows && (isForcedBreak ||
|
if (endRow < numRows && (isForcedBreak ||
|
||||||
(aFragmentainer.mIsAutoBSize && bEndRow == bSize))) {
|
(aFragmentainer.mIsAutoBSize && bEndRow == bSize))) {
|
||||||
bSize = ClampToCSSMaxBSize(bEndRow, aState.mReflowState, &aStatus);
|
bSize = ClampToCSSMaxBSize(bEndRow, aState.mReflowInput, &aStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4978,7 +4978,7 @@ nsGridContainerFrame::ReflowInFragmentainer(GridReflowState& aState,
|
|||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
nsGridContainerFrame::ReflowRowsInFragmentainer(
|
nsGridContainerFrame::ReflowRowsInFragmentainer(
|
||||||
GridReflowState& aState,
|
GridReflowInput& aState,
|
||||||
const LogicalRect& aContentArea,
|
const LogicalRect& aContentArea,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
@@ -4993,7 +4993,7 @@ nsGridContainerFrame::ReflowRowsInFragmentainer(
|
|||||||
FrameHashtable pushedItems;
|
FrameHashtable pushedItems;
|
||||||
FrameHashtable incompleteItems;
|
FrameHashtable incompleteItems;
|
||||||
FrameHashtable overflowIncompleteItems;
|
FrameHashtable overflowIncompleteItems;
|
||||||
bool isBDBClone = aState.mReflowState->mStyleBorder->mBoxDecorationBreak ==
|
bool isBDBClone = aState.mReflowInput->mStyleBorder->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE;
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE;
|
||||||
bool didGrowRow = false;
|
bool didGrowRow = false;
|
||||||
// As we walk across rows, we track whether the current row is at the top
|
// As we walk across rows, we track whether the current row is at the top
|
||||||
@@ -5098,11 +5098,11 @@ nsGridContainerFrame::ReflowRowsInFragmentainer(
|
|||||||
aState.mRows.GridLineEdge(aEndRow, GridLineSide::eBeforeGridGap);
|
aState.mRows.GridLineEdge(aEndRow, GridLineSide::eBeforeGridGap);
|
||||||
aFragmentainer.mToFragmentainerEnd = bEndRow;
|
aFragmentainer.mToFragmentainerEnd = bEndRow;
|
||||||
if (aFragmentainer.mIsAutoBSize) {
|
if (aFragmentainer.mIsAutoBSize) {
|
||||||
aBSize = ClampToCSSMaxBSize(bEndRow, aState.mReflowState, &aStatus);
|
aBSize = ClampToCSSMaxBSize(bEndRow, aState.mReflowInput, &aStatus);
|
||||||
} else if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
|
} else if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
|
||||||
aBSize = NS_CSS_MINMAX(aState.mReflowState->ComputedBSize(),
|
aBSize = NS_CSS_MINMAX(aState.mReflowInput->ComputedBSize(),
|
||||||
aState.mReflowState->ComputedMinBSize(),
|
aState.mReflowInput->ComputedMinBSize(),
|
||||||
aState.mReflowState->ComputedMaxBSize());
|
aState.mReflowInput->ComputedMaxBSize());
|
||||||
aBSize = std::min(bEndRow, aBSize);
|
aBSize = std::min(bEndRow, aBSize);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@@ -5256,23 +5256,23 @@ nsGridContainerFrame::ReflowRowsInFragmentainer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
nsGridContainerFrame::ReflowChildren(GridReflowState& aState,
|
nsGridContainerFrame::ReflowChildren(GridReflowInput& aState,
|
||||||
const LogicalRect& aContentArea,
|
const LogicalRect& aContentArea,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aState.mReflowState);
|
MOZ_ASSERT(aState.mReflowInput);
|
||||||
|
|
||||||
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.mReflowState,
|
ReflowOverflowContainerChildren(PresContext(), *aState.mReflowInput,
|
||||||
ocBounds, 0, ocStatus,
|
ocBounds, 0, ocStatus,
|
||||||
MergeSortedFrameListsFor);
|
MergeSortedFrameListsFor);
|
||||||
}
|
}
|
||||||
|
|
||||||
WritingMode wm = aState.mReflowState->GetWritingMode();
|
WritingMode wm = aState.mReflowInput->GetWritingMode();
|
||||||
const nsSize containerSize =
|
const nsSize containerSize =
|
||||||
(aContentArea.Size(wm) + aState.mBorderPadding.Size(wm)).GetPhysicalSize(wm);
|
(aContentArea.Size(wm) + aState.mBorderPadding.Size(wm)).GetPhysicalSize(wm);
|
||||||
|
|
||||||
@@ -5305,7 +5305,7 @@ nsGridContainerFrame::ReflowChildren(GridReflowState& aState,
|
|||||||
if (!children.IsEmpty()) {
|
if (!children.IsEmpty()) {
|
||||||
// 'gridOrigin' is the origin of the grid (the start of the first track),
|
// 'gridOrigin' is the origin of the grid (the start of the first track),
|
||||||
// with respect to the grid container's padding-box (CB).
|
// with respect to the grid container's padding-box (CB).
|
||||||
LogicalMargin pad(aState.mReflowState->ComputedLogicalPadding());
|
LogicalMargin pad(aState.mReflowInput->ComputedLogicalPadding());
|
||||||
const LogicalPoint gridOrigin(wm, pad.IStart(wm), pad.BStart(wm));
|
const LogicalPoint gridOrigin(wm, pad.IStart(wm), pad.BStart(wm));
|
||||||
const LogicalRect gridCB(wm, 0, 0,
|
const LogicalRect gridCB(wm, 0, 0,
|
||||||
aContentArea.ISize(wm) + pad.IStartEnd(wm),
|
aContentArea.ISize(wm) + pad.IStartEnd(wm),
|
||||||
@@ -5336,7 +5336,7 @@ nsGridContainerFrame::ReflowChildren(GridReflowState& aState,
|
|||||||
flags |= AbsPosReflowFlags::eConstrainHeight;
|
flags |= AbsPosReflowFlags::eConstrainHeight;
|
||||||
flags |= AbsPosReflowFlags::eIsGridContainerCB;
|
flags |= AbsPosReflowFlags::eIsGridContainerCB;
|
||||||
GetAbsoluteContainingBlock()->Reflow(this, PresContext(),
|
GetAbsoluteContainingBlock()->Reflow(this, PresContext(),
|
||||||
*aState.mReflowState,
|
*aState.mReflowInput,
|
||||||
aStatus, dummyRect, flags,
|
aStatus, dummyRect, flags,
|
||||||
&aDesiredSize.mOverflowAreas);
|
&aDesiredSize.mOverflowAreas);
|
||||||
}
|
}
|
||||||
@@ -5347,14 +5347,14 @@ nsGridContainerFrame::ReflowChildren(GridReflowState& aState,
|
|||||||
void
|
void
|
||||||
nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsGridContainerFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsGridContainerFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
if (IsFrameTreeTooDeep(aReflowState, aDesiredSize, aStatus)) {
|
if (IsFrameTreeTooDeep(aReflowInput, aDesiredSize, aStatus)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5528,19 +5528,19 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
SanityCheckGridItemsBeforeReflow();
|
SanityCheckGridItemsBeforeReflow();
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
|
||||||
const nsStylePosition* stylePos = aReflowState.mStylePosition;
|
const nsStylePosition* stylePos = aReflowInput.mStylePosition;
|
||||||
if (!prevInFlow) {
|
if (!prevInFlow) {
|
||||||
InitImplicitNamedAreas(stylePos);
|
InitImplicitNamedAreas(stylePos);
|
||||||
}
|
}
|
||||||
GridReflowState gridReflowState(this, aReflowState);
|
GridReflowInput gridReflowInput(this, aReflowInput);
|
||||||
if (gridReflowState.mIter.ItemsAreAlreadyInOrder()) {
|
if (gridReflowInput.mIter.ItemsAreAlreadyInOrder()) {
|
||||||
AddStateBits(NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER);
|
AddStateBits(NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER);
|
||||||
} else {
|
} else {
|
||||||
RemoveStateBits(NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER);
|
RemoveStateBits(NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER);
|
||||||
}
|
}
|
||||||
const nscoord computedBSize = aReflowState.ComputedBSize();
|
const nscoord computedBSize = aReflowInput.ComputedBSize();
|
||||||
const nscoord computedISize = aReflowState.ComputedISize();
|
const nscoord computedISize = aReflowInput.ComputedISize();
|
||||||
const WritingMode& wm = gridReflowState.mWM;
|
const WritingMode& wm = gridReflowInput.mWM;
|
||||||
LogicalSize computedSize(wm, computedISize, computedBSize);
|
LogicalSize computedSize(wm, computedISize, computedBSize);
|
||||||
|
|
||||||
nscoord consumedBSize = 0;
|
nscoord consumedBSize = 0;
|
||||||
@@ -5548,8 +5548,8 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// ComputedMinSize is zero rather than NS_UNCONSTRAINEDSIZE when indefinite
|
// ComputedMinSize is zero rather than NS_UNCONSTRAINEDSIZE when indefinite
|
||||||
// (unfortunately) so we have to check the style data and parent reflow state
|
// (unfortunately) so we have to check the style data and parent reflow state
|
||||||
// to determine if it's indefinite.
|
// to determine if it's indefinite.
|
||||||
LogicalSize computedMinSize(aReflowState.ComputedMinSize());
|
LogicalSize computedMinSize(aReflowInput.ComputedMinSize());
|
||||||
const ReflowInput* cbState = aReflowState.mCBReflowState;
|
const ReflowInput* cbState = aReflowInput.mCBReflowInput;
|
||||||
if (!stylePos->MinISize(wm).IsCoordPercentCalcUnit() ||
|
if (!stylePos->MinISize(wm).IsCoordPercentCalcUnit() ||
|
||||||
(stylePos->MinISize(wm).HasPercent() && cbState &&
|
(stylePos->MinISize(wm).HasPercent() && cbState &&
|
||||||
cbState->ComputedSize(wm).ISize(wm) == NS_UNCONSTRAINEDSIZE)) {
|
cbState->ComputedSize(wm).ISize(wm) == NS_UNCONSTRAINEDSIZE)) {
|
||||||
@@ -5561,53 +5561,53 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
computedMinSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
computedMinSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
|
||||||
}
|
}
|
||||||
Grid grid;
|
Grid grid;
|
||||||
grid.PlaceGridItems(gridReflowState, computedMinSize, computedSize,
|
grid.PlaceGridItems(gridReflowInput, computedMinSize, computedSize,
|
||||||
aReflowState.ComputedMaxSize());
|
aReflowInput.ComputedMaxSize());
|
||||||
|
|
||||||
gridReflowState.CalculateTrackSizes(grid, computedSize,
|
gridReflowInput.CalculateTrackSizes(grid, computedSize,
|
||||||
nsLayoutUtils::PREF_ISIZE);
|
nsLayoutUtils::PREF_ISIZE);
|
||||||
} else {
|
} else {
|
||||||
consumedBSize = GetConsumedBSize();
|
consumedBSize = GetConsumedBSize();
|
||||||
gridReflowState.InitializeForContinuation(this, consumedBSize);
|
gridReflowInput.InitializeForContinuation(this, consumedBSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord bSize = 0;
|
nscoord bSize = 0;
|
||||||
if (computedBSize == NS_AUTOHEIGHT) {
|
if (computedBSize == NS_AUTOHEIGHT) {
|
||||||
const uint32_t numRows = gridReflowState.mRows.mSizes.Length();
|
const uint32_t numRows = gridReflowInput.mRows.mSizes.Length();
|
||||||
if (!prevInFlow) {
|
if (!prevInFlow) {
|
||||||
// Note: we can't use GridLineEdge here since we haven't calculated
|
// Note: we can't use GridLineEdge here since we haven't calculated
|
||||||
// the rows' mPosition yet (happens in AlignJustifyContent below).
|
// the rows' mPosition yet (happens in AlignJustifyContent below).
|
||||||
for (uint32_t i = 0; i < numRows; ++i) {
|
for (uint32_t i = 0; i < numRows; ++i) {
|
||||||
bSize += gridReflowState.mRows.mSizes[i].mBase;
|
bSize += gridReflowInput.mRows.mSizes[i].mBase;
|
||||||
}
|
}
|
||||||
bSize += gridReflowState.mRows.SumOfGridGaps();
|
bSize += gridReflowInput.mRows.SumOfGridGaps();
|
||||||
} else {
|
} else {
|
||||||
bSize = gridReflowState.mRows.GridLineEdge(numRows,
|
bSize = gridReflowInput.mRows.GridLineEdge(numRows,
|
||||||
GridLineSide::eAfterGridGap);
|
GridLineSide::eAfterGridGap);
|
||||||
}
|
}
|
||||||
bSize = NS_CSS_MINMAX(bSize,
|
bSize = NS_CSS_MINMAX(bSize,
|
||||||
aReflowState.ComputedMinBSize(),
|
aReflowInput.ComputedMinBSize(),
|
||||||
aReflowState.ComputedMaxBSize());
|
aReflowInput.ComputedMaxBSize());
|
||||||
} else {
|
} else {
|
||||||
bSize = computedBSize;
|
bSize = computedBSize;
|
||||||
}
|
}
|
||||||
bSize = std::max(bSize - consumedBSize, 0);
|
bSize = std::max(bSize - consumedBSize, 0);
|
||||||
auto& bp = gridReflowState.mBorderPadding;
|
auto& bp = gridReflowInput.mBorderPadding;
|
||||||
LogicalRect contentArea(wm, bp.IStart(wm), bp.BStart(wm),
|
LogicalRect contentArea(wm, bp.IStart(wm), bp.BStart(wm),
|
||||||
computedISize, bSize);
|
computedISize, bSize);
|
||||||
|
|
||||||
if (!prevInFlow) {
|
if (!prevInFlow) {
|
||||||
// Apply 'align/justify-content' to the grid.
|
// Apply 'align/justify-content' to the grid.
|
||||||
// CalculateTrackSizes did the columns.
|
// CalculateTrackSizes did the columns.
|
||||||
gridReflowState.mRows.AlignJustifyContent(stylePos, wm, contentArea.Size(wm));
|
gridReflowInput.mRows.AlignJustifyContent(stylePos, wm, contentArea.Size(wm));
|
||||||
}
|
}
|
||||||
|
|
||||||
bSize = ReflowChildren(gridReflowState, contentArea, aDesiredSize, aStatus);
|
bSize = ReflowChildren(gridReflowInput, contentArea, aDesiredSize, aStatus);
|
||||||
bSize = std::max(bSize - consumedBSize, 0);
|
bSize = std::max(bSize - consumedBSize, 0);
|
||||||
|
|
||||||
// Skip our block-end border if we're INCOMPLETE.
|
// Skip our block-end border if we're INCOMPLETE.
|
||||||
if (!NS_FRAME_IS_COMPLETE(aStatus) &&
|
if (!NS_FRAME_IS_COMPLETE(aStatus) &&
|
||||||
!gridReflowState.mSkipSides.BEnd() &&
|
!gridReflowInput.mSkipSides.BEnd() &&
|
||||||
StyleBorder()->mBoxDecorationBreak !=
|
StyleBorder()->mBoxDecorationBreak !=
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE) {
|
||||||
bp.BEnd(wm) = nscoord(0);
|
bp.BEnd(wm) = nscoord(0);
|
||||||
@@ -5641,16 +5641,16 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// Now that we know column and row sizes and positions, set
|
// Now that we know column and row sizes and positions, set
|
||||||
// the ComputedGridTrackInfo and related properties
|
// the ComputedGridTrackInfo and related properties
|
||||||
|
|
||||||
uint32_t colTrackCount = gridReflowState.mCols.mSizes.Length();
|
uint32_t colTrackCount = gridReflowInput.mCols.mSizes.Length();
|
||||||
nsTArray<nscoord> colTrackPositions(colTrackCount);
|
nsTArray<nscoord> colTrackPositions(colTrackCount);
|
||||||
nsTArray<nscoord> colTrackSizes(colTrackCount);
|
nsTArray<nscoord> colTrackSizes(colTrackCount);
|
||||||
nsTArray<uint32_t> colTrackStates(colTrackCount);
|
nsTArray<uint32_t> colTrackStates(colTrackCount);
|
||||||
uint32_t col = 0;
|
uint32_t col = 0;
|
||||||
for (const TrackSize& sz : gridReflowState.mCols.mSizes) {
|
for (const TrackSize& sz : gridReflowInput.mCols.mSizes) {
|
||||||
colTrackPositions.AppendElement(sz.mPosition);
|
colTrackPositions.AppendElement(sz.mPosition);
|
||||||
colTrackSizes.AppendElement(sz.mBase);
|
colTrackSizes.AppendElement(sz.mBase);
|
||||||
bool isRepeat = ((col >= gridReflowState.mColFunctions.mRepeatAutoStart) &&
|
bool isRepeat = ((col >= gridReflowInput.mColFunctions.mRepeatAutoStart) &&
|
||||||
(col < gridReflowState.mColFunctions.mRepeatAutoEnd));
|
(col < gridReflowInput.mColFunctions.mRepeatAutoEnd));
|
||||||
colTrackStates.AppendElement(
|
colTrackStates.AppendElement(
|
||||||
isRepeat ?
|
isRepeat ?
|
||||||
(uint32_t)mozilla::dom::GridTrackState::Repeat :
|
(uint32_t)mozilla::dom::GridTrackState::Repeat :
|
||||||
@@ -5660,8 +5660,8 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
col++;
|
col++;
|
||||||
}
|
}
|
||||||
ComputedGridTrackInfo* colInfo = new ComputedGridTrackInfo(
|
ComputedGridTrackInfo* colInfo = new ComputedGridTrackInfo(
|
||||||
gridReflowState.mColFunctions.mExplicitGridOffset,
|
gridReflowInput.mColFunctions.mExplicitGridOffset,
|
||||||
gridReflowState.mColFunctions.NumExplicitTracks(),
|
gridReflowInput.mColFunctions.NumExplicitTracks(),
|
||||||
0,
|
0,
|
||||||
col,
|
col,
|
||||||
Move(colTrackPositions),
|
Move(colTrackPositions),
|
||||||
@@ -5669,16 +5669,16 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
Move(colTrackStates));
|
Move(colTrackStates));
|
||||||
Properties().Set(GridColTrackInfo(), colInfo);
|
Properties().Set(GridColTrackInfo(), colInfo);
|
||||||
|
|
||||||
uint32_t rowTrackCount = gridReflowState.mRows.mSizes.Length();
|
uint32_t rowTrackCount = gridReflowInput.mRows.mSizes.Length();
|
||||||
nsTArray<nscoord> rowTrackPositions(rowTrackCount);
|
nsTArray<nscoord> rowTrackPositions(rowTrackCount);
|
||||||
nsTArray<nscoord> rowTrackSizes(rowTrackCount);
|
nsTArray<nscoord> rowTrackSizes(rowTrackCount);
|
||||||
nsTArray<uint32_t> rowTrackStates(rowTrackCount);
|
nsTArray<uint32_t> rowTrackStates(rowTrackCount);
|
||||||
uint32_t row = 0;
|
uint32_t row = 0;
|
||||||
for (const TrackSize& sz : gridReflowState.mRows.mSizes) {
|
for (const TrackSize& sz : gridReflowInput.mRows.mSizes) {
|
||||||
rowTrackPositions.AppendElement(sz.mPosition);
|
rowTrackPositions.AppendElement(sz.mPosition);
|
||||||
rowTrackSizes.AppendElement(sz.mBase);
|
rowTrackSizes.AppendElement(sz.mBase);
|
||||||
bool isRepeat = ((row >= gridReflowState.mRowFunctions.mRepeatAutoStart) &&
|
bool isRepeat = ((row >= gridReflowInput.mRowFunctions.mRepeatAutoStart) &&
|
||||||
(row < gridReflowState.mRowFunctions.mRepeatAutoEnd));
|
(row < gridReflowInput.mRowFunctions.mRepeatAutoEnd));
|
||||||
rowTrackStates.AppendElement(
|
rowTrackStates.AppendElement(
|
||||||
isRepeat ?
|
isRepeat ?
|
||||||
(uint32_t)mozilla::dom::GridTrackState::Repeat :
|
(uint32_t)mozilla::dom::GridTrackState::Repeat :
|
||||||
@@ -5691,9 +5691,9 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// later calls to Reflow. For now, presume that no more fragmentation will
|
// later calls to Reflow. For now, presume that no more fragmentation will
|
||||||
// occur.
|
// occur.
|
||||||
ComputedGridTrackInfo* rowInfo = new ComputedGridTrackInfo(
|
ComputedGridTrackInfo* rowInfo = new ComputedGridTrackInfo(
|
||||||
gridReflowState.mRowFunctions.mExplicitGridOffset,
|
gridReflowInput.mRowFunctions.mExplicitGridOffset,
|
||||||
gridReflowState.mRowFunctions.NumExplicitTracks(),
|
gridReflowInput.mRowFunctions.NumExplicitTracks(),
|
||||||
gridReflowState.mStartRow,
|
gridReflowInput.mStartRow,
|
||||||
row,
|
row,
|
||||||
Move(rowTrackPositions),
|
Move(rowTrackPositions),
|
||||||
Move(rowTrackSizes),
|
Move(rowTrackSizes),
|
||||||
@@ -5723,7 +5723,7 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
priorRowInfo->mNumLeadingImplicitTracks,
|
priorRowInfo->mNumLeadingImplicitTracks,
|
||||||
priorRowInfo->mNumExplicitTracks,
|
priorRowInfo->mNumExplicitTracks,
|
||||||
priorRowInfo->mStartFragmentTrack,
|
priorRowInfo->mStartFragmentTrack,
|
||||||
gridReflowState.mStartRow,
|
gridReflowInput.mStartRow,
|
||||||
Move(priorRowInfo->mPositions),
|
Move(priorRowInfo->mPositions),
|
||||||
Move(priorRowInfo->mSizes),
|
Move(priorRowInfo->mSizes),
|
||||||
Move(priorRowInfo->mStates));
|
Move(priorRowInfo->mStates));
|
||||||
@@ -5734,14 +5734,14 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// repeat tracks produced in the reflow.
|
// repeat tracks produced in the reflow.
|
||||||
|
|
||||||
// Generate column lines first.
|
// Generate column lines first.
|
||||||
uint32_t capacity = gridReflowState.mColFunctions.NumRepeatTracks() +
|
uint32_t capacity = gridReflowInput.mColFunctions.NumRepeatTracks() +
|
||||||
gridReflowState.mCols.mSizes.Length();
|
gridReflowInput.mCols.mSizes.Length();
|
||||||
nsTArray<nsTArray<nsString>> columnLineNames(capacity);
|
nsTArray<nsTArray<nsString>> columnLineNames(capacity);
|
||||||
for (col = 0; col <= gridReflowState.mCols.mSizes.Length(); col++) {
|
for (col = 0; col <= gridReflowInput.mCols.mSizes.Length(); col++) {
|
||||||
columnLineNames.AppendElement(
|
columnLineNames.AppendElement(
|
||||||
gridReflowState.mCols.GetLineNamesAtIndex(
|
gridReflowInput.mCols.GetLineNamesAtIndex(
|
||||||
gridReflowState.mGridStyle->mGridTemplateColumns,
|
gridReflowInput.mGridStyle->mGridTemplateColumns,
|
||||||
gridReflowState.mColFunctions,
|
gridReflowInput.mColFunctions,
|
||||||
col));
|
col));
|
||||||
}
|
}
|
||||||
ComputedGridLineInfo* columnLineInfo = new ComputedGridLineInfo(
|
ComputedGridLineInfo* columnLineInfo = new ComputedGridLineInfo(
|
||||||
@@ -5749,14 +5749,14 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
Properties().Set(GridColumnLineInfo(), columnLineInfo);
|
Properties().Set(GridColumnLineInfo(), columnLineInfo);
|
||||||
|
|
||||||
// Generate row lines next.
|
// Generate row lines next.
|
||||||
capacity = gridReflowState.mRowFunctions.NumRepeatTracks() +
|
capacity = gridReflowInput.mRowFunctions.NumRepeatTracks() +
|
||||||
gridReflowState.mRows.mSizes.Length();
|
gridReflowInput.mRows.mSizes.Length();
|
||||||
nsTArray<nsTArray<nsString>> rowLineNames(capacity);
|
nsTArray<nsTArray<nsString>> rowLineNames(capacity);
|
||||||
for (row = 0; row <= gridReflowState.mRows.mSizes.Length(); row++) {
|
for (row = 0; row <= gridReflowInput.mRows.mSizes.Length(); row++) {
|
||||||
rowLineNames.AppendElement(
|
rowLineNames.AppendElement(
|
||||||
gridReflowState.mRows.GetLineNamesAtIndex(
|
gridReflowInput.mRows.GetLineNamesAtIndex(
|
||||||
gridReflowState.mGridStyle->mGridTemplateRows,
|
gridReflowInput.mGridStyle->mGridTemplateRows,
|
||||||
gridReflowState.mRowFunctions,
|
gridReflowInput.mRowFunctions,
|
||||||
row));
|
row));
|
||||||
}
|
}
|
||||||
ComputedGridLineInfo* rowLineInfo = new ComputedGridLineInfo(
|
ComputedGridLineInfo* rowLineInfo = new ComputedGridLineInfo(
|
||||||
@@ -5772,16 +5772,16 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
Properties().Set(SharedGridData::Prop(), sharedGridData);
|
Properties().Set(SharedGridData::Prop(), sharedGridData);
|
||||||
}
|
}
|
||||||
sharedGridData->mCols.mSizes.Clear();
|
sharedGridData->mCols.mSizes.Clear();
|
||||||
sharedGridData->mCols.mSizes.SwapElements(gridReflowState.mCols.mSizes);
|
sharedGridData->mCols.mSizes.SwapElements(gridReflowInput.mCols.mSizes);
|
||||||
sharedGridData->mCols.mContentBoxSize = gridReflowState.mCols.mContentBoxSize;
|
sharedGridData->mCols.mContentBoxSize = gridReflowInput.mCols.mContentBoxSize;
|
||||||
sharedGridData->mCols.mBaselineSubtreeAlign[0] =
|
sharedGridData->mCols.mBaselineSubtreeAlign[0] =
|
||||||
gridReflowState.mCols.mBaselineSubtreeAlign[0];
|
gridReflowInput.mCols.mBaselineSubtreeAlign[0];
|
||||||
sharedGridData->mCols.mBaselineSubtreeAlign[1] =
|
sharedGridData->mCols.mBaselineSubtreeAlign[1] =
|
||||||
gridReflowState.mCols.mBaselineSubtreeAlign[1];
|
gridReflowInput.mCols.mBaselineSubtreeAlign[1];
|
||||||
sharedGridData->mRows.mSizes.Clear();
|
sharedGridData->mRows.mSizes.Clear();
|
||||||
sharedGridData->mRows.mSizes.SwapElements(gridReflowState.mRows.mSizes);
|
sharedGridData->mRows.mSizes.SwapElements(gridReflowInput.mRows.mSizes);
|
||||||
// Save the original row grid sizes and gaps so we can restore them later
|
// Save the original row grid sizes and gaps so we can restore them later
|
||||||
// in GridReflowState::Initialize for the continuations.
|
// in GridReflowInput::Initialize for the continuations.
|
||||||
auto& origRowData = sharedGridData->mOriginalRowData;
|
auto& origRowData = sharedGridData->mOriginalRowData;
|
||||||
origRowData.ClearAndRetainStorage();
|
origRowData.ClearAndRetainStorage();
|
||||||
origRowData.SetCapacity(sharedGridData->mRows.mSizes.Length());
|
origRowData.SetCapacity(sharedGridData->mRows.mSizes.Length());
|
||||||
@@ -5791,15 +5791,15 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
origRowData.AppendElement(data);
|
origRowData.AppendElement(data);
|
||||||
prevTrackEnd = sz.mPosition + sz.mBase;
|
prevTrackEnd = sz.mPosition + sz.mBase;
|
||||||
}
|
}
|
||||||
sharedGridData->mRows.mContentBoxSize = gridReflowState.mRows.mContentBoxSize;
|
sharedGridData->mRows.mContentBoxSize = gridReflowInput.mRows.mContentBoxSize;
|
||||||
sharedGridData->mRows.mBaselineSubtreeAlign[0] =
|
sharedGridData->mRows.mBaselineSubtreeAlign[0] =
|
||||||
gridReflowState.mRows.mBaselineSubtreeAlign[0];
|
gridReflowInput.mRows.mBaselineSubtreeAlign[0];
|
||||||
sharedGridData->mRows.mBaselineSubtreeAlign[1] =
|
sharedGridData->mRows.mBaselineSubtreeAlign[1] =
|
||||||
gridReflowState.mRows.mBaselineSubtreeAlign[1];
|
gridReflowInput.mRows.mBaselineSubtreeAlign[1];
|
||||||
sharedGridData->mGridItems.Clear();
|
sharedGridData->mGridItems.Clear();
|
||||||
sharedGridData->mGridItems.SwapElements(gridReflowState.mGridItems);
|
sharedGridData->mGridItems.SwapElements(gridReflowInput.mGridItems);
|
||||||
sharedGridData->mAbsPosItems.Clear();
|
sharedGridData->mAbsPosItems.Clear();
|
||||||
sharedGridData->mAbsPosItems.SwapElements(gridReflowState.mAbsPosItems);
|
sharedGridData->mAbsPosItems.SwapElements(gridReflowInput.mAbsPosItems);
|
||||||
|
|
||||||
sharedGridData->mGenerateComputedGridInfo =
|
sharedGridData->mGenerateComputedGridInfo =
|
||||||
HasAnyStateBits(NS_STATE_GRID_GENERATE_COMPUTED_VALUES);
|
HasAnyStateBits(NS_STATE_GRID_GENERATE_COMPUTED_VALUES);
|
||||||
@@ -5809,7 +5809,7 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
FinishAndStoreOverflow(&aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
@@ -5818,7 +5818,7 @@ nsGridContainerFrame::IntrinsicISize(nsRenderingContext* aRenderingContext,
|
|||||||
{
|
{
|
||||||
// Calculate the sum of column sizes under aConstraint.
|
// Calculate the sum of column sizes under aConstraint.
|
||||||
// http://dev.w3.org/csswg/css-grid/#intrinsic-sizes
|
// http://dev.w3.org/csswg/css-grid/#intrinsic-sizes
|
||||||
GridReflowState state(this, *aRenderingContext);
|
GridReflowInput state(this, *aRenderingContext);
|
||||||
InitImplicitNamedAreas(state.mGridStyle); // XXX optimize
|
InitImplicitNamedAreas(state.mGridStyle); // XXX optimize
|
||||||
LogicalSize indefinite(state.mWM, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
LogicalSize indefinite(state.mWM, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
||||||
Grid grid;
|
Grid grid;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public:
|
|||||||
// nsIFrame overrides
|
// nsIFrame overrides
|
||||||
void Reflow(nsPresContext* aPresContext,
|
void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
nscoord GetMinISize(nsRenderingContext* aRenderingContext) override;
|
nscoord GetMinISize(nsRenderingContext* aRenderingContext) override;
|
||||||
nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override;
|
nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override;
|
||||||
@@ -160,7 +160,7 @@ public:
|
|||||||
|
|
||||||
struct TrackSize;
|
struct TrackSize;
|
||||||
struct GridItemInfo;
|
struct GridItemInfo;
|
||||||
struct GridReflowState;
|
struct GridReflowInput;
|
||||||
protected:
|
protected:
|
||||||
static const uint32_t kAutoLine;
|
static const uint32_t kAutoLine;
|
||||||
// The maximum line number, in the zero-based translated grid.
|
// The maximum line number, in the zero-based translated grid.
|
||||||
@@ -209,7 +209,7 @@ protected:
|
|||||||
* @return the consumed size of all of this grid container's continuations
|
* @return the consumed size of all of this grid container's continuations
|
||||||
* so far including this frame
|
* so far including this frame
|
||||||
*/
|
*/
|
||||||
nscoord ReflowChildren(GridReflowState& aState,
|
nscoord ReflowChildren(GridReflowInput& aState,
|
||||||
const LogicalRect& aContentArea,
|
const LogicalRect& aContentArea,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
@@ -259,10 +259,10 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
mozilla::Maybe<nsGridContainerFrame::Fragmentainer>
|
mozilla::Maybe<nsGridContainerFrame::Fragmentainer>
|
||||||
GetNearestFragmentainer(const GridReflowState& aState) const;
|
GetNearestFragmentainer(const GridReflowInput& aState) const;
|
||||||
|
|
||||||
// @return the consumed size of all continuations so far including this frame
|
// @return the consumed size of all continuations so far including this frame
|
||||||
nscoord ReflowInFragmentainer(GridReflowState& aState,
|
nscoord ReflowInFragmentainer(GridReflowInput& aState,
|
||||||
const LogicalRect& aContentArea,
|
const LogicalRect& aContentArea,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
@@ -271,7 +271,7 @@ private:
|
|||||||
|
|
||||||
// Helper for ReflowInFragmentainer
|
// Helper for ReflowInFragmentainer
|
||||||
// @return the consumed size of all continuations so far including this frame
|
// @return the consumed size of all continuations so far including this frame
|
||||||
nscoord ReflowRowsInFragmentainer(GridReflowState& aState,
|
nscoord ReflowRowsInFragmentainer(GridReflowInput& aState,
|
||||||
const LogicalRect& aContentArea,
|
const LogicalRect& aContentArea,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
nsReflowStatus& aStatus,
|
nsReflowStatus& aStatus,
|
||||||
@@ -289,7 +289,7 @@ private:
|
|||||||
nsSize aContainerSize,
|
nsSize aContainerSize,
|
||||||
mozilla::Maybe<nscoord> aStretchBSize,
|
mozilla::Maybe<nscoord> aStretchBSize,
|
||||||
const Fragmentainer* aFragmentainer,
|
const Fragmentainer* aFragmentainer,
|
||||||
const GridReflowState& aState,
|
const GridReflowInput& aState,
|
||||||
const LogicalRect& aContentArea,
|
const LogicalRect& aContentArea,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|||||||
@@ -249,27 +249,27 @@ nsHTMLCanvasFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
|||||||
void
|
void
|
||||||
nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
|
nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsHTMLCanvasFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsHTMLCanvasFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
|
||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("enter nsHTMLCanvasFrame::Reflow: availSize=%d,%d",
|
("enter nsHTMLCanvasFrame::Reflow: availSize=%d,%d",
|
||||||
aReflowState.AvailableWidth(), aReflowState.AvailableHeight()));
|
aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight()));
|
||||||
|
|
||||||
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
|
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
LogicalSize finalSize(wm,
|
LogicalSize finalSize(wm,
|
||||||
aReflowState.ComputedISize(),
|
aReflowInput.ComputedISize(),
|
||||||
aReflowState.ComputedBSize());
|
aReflowInput.ComputedBSize());
|
||||||
|
|
||||||
// stash this away so we can compute our inner area later
|
// stash this away so we can compute our inner area later
|
||||||
mBorderPadding = aReflowState.ComputedLogicalBorderPadding();
|
mBorderPadding = aReflowInput.ComputedLogicalBorderPadding();
|
||||||
|
|
||||||
finalSize.ISize(wm) += mBorderPadding.IStartEnd(wm);
|
finalSize.ISize(wm) += mBorderPadding.IStartEnd(wm);
|
||||||
finalSize.BSize(wm) += mBorderPadding.BStartEnd(wm);
|
finalSize.BSize(wm) += mBorderPadding.BStartEnd(wm);
|
||||||
@@ -288,21 +288,21 @@ nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsReflowStatus childStatus;
|
nsReflowStatus childStatus;
|
||||||
nsIFrame* childFrame = mFrames.FirstChild();
|
nsIFrame* childFrame = mFrames.FirstChild();
|
||||||
WritingMode childWM = childFrame->GetWritingMode();
|
WritingMode childWM = childFrame->GetWritingMode();
|
||||||
LogicalSize availSize = aReflowState.ComputedSize(childWM);
|
LogicalSize availSize = aReflowInput.ComputedSize(childWM);
|
||||||
availSize.BSize(childWM) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(childWM) = NS_UNCONSTRAINEDSIZE;
|
||||||
NS_ASSERTION(!childFrame->GetNextSibling(), "HTML canvas should have 1 kid");
|
NS_ASSERTION(!childFrame->GetNextSibling(), "HTML canvas should have 1 kid");
|
||||||
ReflowOutput childDesiredSize(aReflowState.GetWritingMode(), aMetrics.mFlags);
|
ReflowOutput childDesiredSize(aReflowInput.GetWritingMode(), aMetrics.mFlags);
|
||||||
ReflowInput childReflowState(aPresContext, aReflowState, childFrame,
|
ReflowInput childReflowInput(aPresContext, aReflowInput, childFrame,
|
||||||
availSize);
|
availSize);
|
||||||
ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowState,
|
ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowInput,
|
||||||
0, 0, 0, childStatus, nullptr);
|
0, 0, 0, childStatus, nullptr);
|
||||||
FinishReflowChild(childFrame, aPresContext, childDesiredSize,
|
FinishReflowChild(childFrame, aPresContext, childDesiredSize,
|
||||||
&childReflowState, 0, 0, 0);
|
&childReflowInput, 0, 0, 0);
|
||||||
|
|
||||||
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",
|
||||||
aMetrics.ISize(wm), aMetrics.BSize(wm)));
|
aMetrics.ISize(wm), aMetrics.BSize(wm)));
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME taken from nsImageFrame, but then had splittable frame stuff
|
// FIXME taken from nsImageFrame, but then had splittable frame stuff
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
nsRect GetInnerArea() const;
|
nsRect GetInnerArea() const;
|
||||||
|
|||||||
@@ -313,8 +313,8 @@ typedef uint32_t nsReflowStatus;
|
|||||||
#define NS_FRAME_TRUNCATED 0x0010
|
#define NS_FRAME_TRUNCATED 0x0010
|
||||||
#define NS_FRAME_IS_TRUNCATED(status) \
|
#define NS_FRAME_IS_TRUNCATED(status) \
|
||||||
(0 != ((status) & NS_FRAME_TRUNCATED))
|
(0 != ((status) & NS_FRAME_TRUNCATED))
|
||||||
#define NS_FRAME_SET_TRUNCATION(status, aReflowState, aMetrics) \
|
#define NS_FRAME_SET_TRUNCATION(status, aReflowInput, aMetrics) \
|
||||||
aReflowState.SetTruncated(aMetrics, &status);
|
aReflowInput.SetTruncated(aMetrics, &status);
|
||||||
|
|
||||||
// Merge the incompleteness, truncation and NS_FRAME_REFLOW_NEXTINFLOW
|
// Merge the incompleteness, truncation and NS_FRAME_REFLOW_NEXTINFLOW
|
||||||
// status from aSecondary into aPrimary.
|
// status from aSecondary into aPrimary.
|
||||||
@@ -2034,7 +2034,7 @@ public:
|
|||||||
* size, then your parent frame is responsible for making sure that
|
* size, then your parent frame is responsible for making sure that
|
||||||
* the difference between the two rects is repainted
|
* the difference between the two rects is repainted
|
||||||
*
|
*
|
||||||
* @param aReflowState information about your reflow including the reason
|
* @param aReflowInput information about your reflow including the reason
|
||||||
* for the reflow and the available space in which to lay out. Each
|
* for the reflow and the available space in which to lay out. Each
|
||||||
* dimension of the available space can either be constrained or
|
* dimension of the available space can either be constrained or
|
||||||
* unconstrained (a value of NS_UNCONSTRAINEDSIZE).
|
* unconstrained (a value of NS_UNCONSTRAINEDSIZE).
|
||||||
@@ -2049,7 +2049,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aReflowMetrics,
|
ReflowOutput& aReflowMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) = 0;
|
nsReflowStatus& aStatus) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2068,7 +2068,7 @@ public:
|
|||||||
* a given reflow?
|
* a given reflow?
|
||||||
*/
|
*/
|
||||||
virtual void DidReflow(nsPresContext* aPresContext,
|
virtual void DidReflow(nsPresContext* aPresContext,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
nsDidReflowStatus aStatus) = 0;
|
nsDidReflowStatus aStatus) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2669,9 +2669,9 @@ public:
|
|||||||
* passed in, indicating that it should be used to determine if sides
|
* passed in, indicating that it should be used to determine if sides
|
||||||
* should be skipped during reflow.
|
* should be skipped during reflow.
|
||||||
*/
|
*/
|
||||||
Sides GetSkipSides(const ReflowInput* aReflowState = nullptr) const;
|
Sides GetSkipSides(const ReflowInput* aReflowInput = nullptr) const;
|
||||||
virtual LogicalSides
|
virtual LogicalSides
|
||||||
GetLogicalSkipSides(const ReflowInput* aReflowState = nullptr) const {
|
GetLogicalSkipSides(const ReflowInput* aReflowInput = nullptr) const {
|
||||||
return LogicalSides();
|
return LogicalSides();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,14 +116,14 @@ static bool HaveSpecifiedSize(const nsStylePosition* aStylePosition)
|
|||||||
|
|
||||||
// Decide whether we can optimize away reflows that result from the
|
// Decide whether we can optimize away reflows that result from the
|
||||||
// image's intrinsic size changing.
|
// image's intrinsic size changing.
|
||||||
inline bool HaveFixedSize(const ReflowInput& aReflowState)
|
inline bool HaveFixedSize(const ReflowInput& aReflowInput)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(aReflowState.mStylePosition, "crappy reflowState - null stylePosition");
|
NS_ASSERTION(aReflowInput.mStylePosition, "crappy reflowInput - null stylePosition");
|
||||||
// Don't try to make this optimization when an image has percentages
|
// Don't try to make this optimization when an image has percentages
|
||||||
// in its 'width' or 'height'. The percentages might be treated like
|
// in its 'width' or 'height'. The percentages might be treated like
|
||||||
// auto (especially for intrinsic width calculations and for heights).
|
// auto (especially for intrinsic width calculations and for heights).
|
||||||
return aReflowState.mStylePosition->mHeight.ConvertsToLength() &&
|
return aReflowInput.mStylePosition->mHeight.ConvertsToLength() &&
|
||||||
aReflowState.mStylePosition->mWidth.ConvertsToLength();
|
aReflowInput.mStylePosition->mWidth.ConvertsToLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame*
|
nsIFrame*
|
||||||
@@ -949,22 +949,22 @@ nsImageFrame::GetIntrinsicRatio()
|
|||||||
void
|
void
|
||||||
nsImageFrame::Reflow(nsPresContext* aPresContext,
|
nsImageFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsImageFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsImageFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
|
||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("enter nsImageFrame::Reflow: availSize=%d,%d",
|
("enter nsImageFrame::Reflow: availSize=%d,%d",
|
||||||
aReflowState.AvailableWidth(), aReflowState.AvailableHeight()));
|
aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight()));
|
||||||
|
|
||||||
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
|
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// see if we have a frozen size (i.e. a fixed width and height)
|
// see if we have a frozen size (i.e. a fixed width and height)
|
||||||
if (HaveFixedSize(aReflowState)) {
|
if (HaveFixedSize(aReflowInput)) {
|
||||||
mState |= IMAGE_SIZECONSTRAINED;
|
mState |= IMAGE_SIZECONSTRAINED;
|
||||||
} else {
|
} else {
|
||||||
mState &= ~IMAGE_SIZECONSTRAINED;
|
mState &= ~IMAGE_SIZECONSTRAINED;
|
||||||
@@ -977,19 +977,19 @@ nsImageFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mComputedSize =
|
mComputedSize =
|
||||||
nsSize(aReflowState.ComputedWidth(), aReflowState.ComputedHeight());
|
nsSize(aReflowInput.ComputedWidth(), aReflowInput.ComputedHeight());
|
||||||
|
|
||||||
aMetrics.Width() = mComputedSize.width;
|
aMetrics.Width() = mComputedSize.width;
|
||||||
aMetrics.Height() = mComputedSize.height;
|
aMetrics.Height() = mComputedSize.height;
|
||||||
|
|
||||||
// add borders and padding
|
// add borders and padding
|
||||||
aMetrics.Width() += aReflowState.ComputedPhysicalBorderPadding().LeftRight();
|
aMetrics.Width() += aReflowInput.ComputedPhysicalBorderPadding().LeftRight();
|
||||||
aMetrics.Height() += aReflowState.ComputedPhysicalBorderPadding().TopBottom();
|
aMetrics.Height() += aReflowInput.ComputedPhysicalBorderPadding().TopBottom();
|
||||||
|
|
||||||
if (GetPrevInFlow()) {
|
if (GetPrevInFlow()) {
|
||||||
aMetrics.Width() = GetPrevInFlow()->GetSize().width;
|
aMetrics.Width() = GetPrevInFlow()->GetSize().width;
|
||||||
nscoord y = GetContinuationOffset();
|
nscoord y = GetContinuationOffset();
|
||||||
aMetrics.Height() -= y + aReflowState.ComputedPhysicalBorderPadding().top;
|
aMetrics.Height() -= y + aReflowInput.ComputedPhysicalBorderPadding().top;
|
||||||
aMetrics.Height() = std::max(0, aMetrics.Height());
|
aMetrics.Height() = std::max(0, aMetrics.Height());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1009,11 +1009,11 @@ nsImageFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
if (aPresContext->IsPaginated() &&
|
if (aPresContext->IsPaginated() &&
|
||||||
((loadStatus & imgIRequest::STATUS_SIZE_AVAILABLE) || (mState & IMAGE_SIZECONSTRAINED)) &&
|
((loadStatus & imgIRequest::STATUS_SIZE_AVAILABLE) || (mState & IMAGE_SIZECONSTRAINED)) &&
|
||||||
NS_UNCONSTRAINEDSIZE != aReflowState.AvailableHeight() &&
|
NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableHeight() &&
|
||||||
aMetrics.Height() > aReflowState.AvailableHeight()) {
|
aMetrics.Height() > aReflowInput.AvailableHeight()) {
|
||||||
// our desired height was greater than 0, so to avoid infinite
|
// our desired height was greater than 0, so to avoid infinite
|
||||||
// splitting, use 1 pixel as the min
|
// splitting, use 1 pixel as the min
|
||||||
aMetrics.Height() = std::max(nsPresContext::CSSPixelsToAppUnits(1), aReflowState.AvailableHeight());
|
aMetrics.Height() = std::max(nsPresContext::CSSPixelsToAppUnits(1), aReflowInput.AvailableHeight());
|
||||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1053,7 +1053,7 @@ nsImageFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("exit nsImageFrame::Reflow: size=%d,%d",
|
("exit nsImageFrame::Reflow: size=%d,%d",
|
||||||
aMetrics.Width(), aMetrics.Height()));
|
aMetrics.Width(), aMetrics.Height()));
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@@ -2152,7 +2152,7 @@ nsImageFrame::List(FILE* out, const char* aPrefix, uint32_t aFlags) const
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
nsIFrame::LogicalSides
|
||||||
nsImageFrame::GetLogicalSkipSides(const ReflowInput* aReflowState) const
|
nsImageFrame::GetLogicalSkipSides(const ReflowInput* aReflowInput) const
|
||||||
{
|
{
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public:
|
|||||||
virtual nsSize GetIntrinsicRatio() override;
|
virtual nsSize GetIntrinsicRatio() override;
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsresult GetContentForEvent(mozilla::WidgetEvent* aEvent,
|
virtual nsresult GetContentForEvent(mozilla::WidgetEvent* aEvent,
|
||||||
@@ -131,7 +131,7 @@ public:
|
|||||||
return NS_FRAME_SPLITTABLE;
|
return NS_FRAME_SPLITTABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowState = nullptr) const override;
|
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowInput = nullptr) const override;
|
||||||
|
|
||||||
nsresult GetIntrinsicImageSize(nsSize& aSize);
|
nsresult GetIntrinsicImageSize(nsSize& aSize);
|
||||||
|
|
||||||
|
|||||||
@@ -362,23 +362,23 @@ ReparentChildListStyle(nsPresContext* aPresContext,
|
|||||||
void
|
void
|
||||||
nsInlineFrame::Reflow(nsPresContext* aPresContext,
|
nsInlineFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsInlineFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsInlineFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
|
||||||
if (nullptr == aReflowState.mLineLayout) {
|
if (nullptr == aReflowInput.mLineLayout) {
|
||||||
NS_ERROR("must have non-null aReflowState.mLineLayout");
|
NS_ERROR("must have non-null aReflowInput.mLineLayout");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (IsFrameTreeTooDeep(aReflowState, aMetrics, aStatus)) {
|
if (IsFrameTreeTooDeep(aReflowInput, aMetrics, aStatus)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lazilySetParentPointer = false;
|
bool lazilySetParentPointer = false;
|
||||||
|
|
||||||
nsIFrame* lineContainer = aReflowState.mLineLayout->LineContainerFrame();
|
nsIFrame* lineContainer = aReflowInput.mLineLayout->LineContainerFrame();
|
||||||
|
|
||||||
// Check for an overflow list with our prev-in-flow
|
// Check for an overflow list with our prev-in-flow
|
||||||
nsInlineFrame* prevInFlow = (nsInlineFrame*)GetPrevInFlow();
|
nsInlineFrame* prevInFlow = (nsInlineFrame*)GetPrevInFlow();
|
||||||
@@ -420,7 +420,7 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// the special first-line styling. In the lazilySetParentPointer case
|
// the special first-line styling. In the lazilySetParentPointer case
|
||||||
// we reparent the style contexts when we set their parents in
|
// we reparent the style contexts when we set their parents in
|
||||||
// nsInlineFrame::ReflowFrames and nsInlineFrame::ReflowInlineFrame.
|
// nsInlineFrame::ReflowFrames and nsInlineFrame::ReflowInlineFrame.
|
||||||
if (aReflowState.mLineLayout->GetInFirstLine()) {
|
if (aReflowInput.mLineLayout->GetInFirstLine()) {
|
||||||
ReparentChildListStyle(aPresContext, newFrames, this);
|
ReparentChildListStyle(aPresContext, newFrames, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -441,18 +441,18 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||||
DrainFlags flags =
|
DrainFlags flags =
|
||||||
lazilySetParentPointer ? eDontReparentFrames : DrainFlags(0);
|
lazilySetParentPointer ? eDontReparentFrames : DrainFlags(0);
|
||||||
if (aReflowState.mLineLayout->GetInFirstLine()) {
|
if (aReflowInput.mLineLayout->GetInFirstLine()) {
|
||||||
flags = DrainFlags(flags | eInFirstLine);
|
flags = DrainFlags(flags | eInFirstLine);
|
||||||
}
|
}
|
||||||
DrainSelfOverflowListInternal(flags, lineContainer);
|
DrainSelfOverflowListInternal(flags, lineContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set our own reflow state (additional state above and beyond
|
// Set our own reflow state (additional state above and beyond
|
||||||
// aReflowState)
|
// aReflowInput)
|
||||||
InlineReflowState irs;
|
InlineReflowInput irs;
|
||||||
irs.mPrevFrame = nullptr;
|
irs.mPrevFrame = nullptr;
|
||||||
irs.mLineContainer = lineContainer;
|
irs.mLineContainer = lineContainer;
|
||||||
irs.mLineLayout = aReflowState.mLineLayout;
|
irs.mLineLayout = aReflowInput.mLineLayout;
|
||||||
irs.mNextInFlow = (nsInlineFrame*) GetNextInFlow();
|
irs.mNextInFlow = (nsInlineFrame*) GetNextInFlow();
|
||||||
irs.mSetParentPointer = lazilySetParentPointer;
|
irs.mSetParentPointer = lazilySetParentPointer;
|
||||||
|
|
||||||
@@ -463,14 +463,14 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
(void) PullOneFrame(aPresContext, irs, &complete);
|
(void) PullOneFrame(aPresContext, irs, &complete);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReflowFrames(aPresContext, aReflowState, irs, aMetrics, aStatus);
|
ReflowFrames(aPresContext, aReflowInput, irs, aMetrics, aStatus);
|
||||||
|
|
||||||
ReflowAbsoluteFrames(aPresContext, aMetrics, aReflowState, aStatus);
|
ReflowAbsoluteFrames(aPresContext, aMetrics, aReflowInput, aStatus);
|
||||||
|
|
||||||
// Note: the line layout code will properly compute our
|
// Note: the line layout code will properly compute our
|
||||||
// overflow-rect state for us.
|
// overflow-rect state for us.
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
@@ -569,19 +569,19 @@ nsInlineFrame::PullOverflowsFromPrevInFlow()
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
InlineReflowState& irs,
|
InlineReflowInput& irs,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
nsLineLayout* lineLayout = aReflowState.mLineLayout;
|
nsLineLayout* lineLayout = aReflowInput.mLineLayout;
|
||||||
bool inFirstLine = aReflowState.mLineLayout->GetInFirstLine();
|
bool inFirstLine = aReflowInput.mLineLayout->GetInFirstLine();
|
||||||
RestyleManagerHandle restyleManager = aPresContext->RestyleManager();
|
RestyleManagerHandle restyleManager = aPresContext->RestyleManager();
|
||||||
WritingMode frameWM = aReflowState.GetWritingMode();
|
WritingMode frameWM = aReflowInput.GetWritingMode();
|
||||||
WritingMode lineWM = aReflowState.mLineLayout->mRootSpan->mWritingMode;
|
WritingMode lineWM = aReflowInput.mLineLayout->mRootSpan->mWritingMode;
|
||||||
LogicalMargin framePadding = aReflowState.ComputedLogicalBorderPadding();
|
LogicalMargin framePadding = aReflowInput.ComputedLogicalBorderPadding();
|
||||||
nscoord startEdge = 0;
|
nscoord startEdge = 0;
|
||||||
const bool boxDecorationBreakClone =
|
const bool boxDecorationBreakClone =
|
||||||
MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
@@ -594,13 +594,13 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
|||||||
boxDecorationBreakClone) {
|
boxDecorationBreakClone) {
|
||||||
startEdge = framePadding.IStart(frameWM);
|
startEdge = framePadding.IStart(frameWM);
|
||||||
}
|
}
|
||||||
nscoord availableISize = aReflowState.AvailableISize();
|
nscoord availableISize = aReflowInput.AvailableISize();
|
||||||
NS_ASSERTION(availableISize != NS_UNCONSTRAINEDSIZE,
|
NS_ASSERTION(availableISize != NS_UNCONSTRAINEDSIZE,
|
||||||
"should no longer use available widths");
|
"should no longer use available widths");
|
||||||
// Subtract off inline axis border+padding from availableISize
|
// Subtract off inline axis border+padding from availableISize
|
||||||
availableISize -= startEdge;
|
availableISize -= startEdge;
|
||||||
availableISize -= framePadding.IEnd(frameWM);
|
availableISize -= framePadding.IEnd(frameWM);
|
||||||
lineLayout->BeginSpan(this, &aReflowState, startEdge,
|
lineLayout->BeginSpan(this, &aReflowInput, startEdge,
|
||||||
startEdge + availableISize, &mBaseline);
|
startEdge + availableISize, &mBaseline);
|
||||||
|
|
||||||
// First reflow our principal children.
|
// First reflow our principal children.
|
||||||
@@ -686,7 +686,7 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
if (!done) {
|
if (!done) {
|
||||||
bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();
|
bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();
|
||||||
ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus);
|
ReflowInlineFrame(aPresContext, aReflowInput, irs, frame, aStatus);
|
||||||
done = NS_INLINE_IS_BREAK(aStatus) ||
|
done = NS_INLINE_IS_BREAK(aStatus) ||
|
||||||
(!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus));
|
(!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus));
|
||||||
if (done) {
|
if (done) {
|
||||||
@@ -724,7 +724,7 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus);
|
ReflowInlineFrame(aPresContext, aReflowInput, irs, frame, aStatus);
|
||||||
if (NS_INLINE_IS_BREAK(aStatus) ||
|
if (NS_INLINE_IS_BREAK(aStatus) ||
|
||||||
(!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus))) {
|
(!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus))) {
|
||||||
break;
|
break;
|
||||||
@@ -794,12 +794,12 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
|
nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
InlineReflowState& irs,
|
InlineReflowInput& irs,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsLineLayout* lineLayout = aReflowState.mLineLayout;
|
nsLineLayout* lineLayout = aReflowInput.mLineLayout;
|
||||||
bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();
|
bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();
|
||||||
bool pushedFrame;
|
bool pushedFrame;
|
||||||
lineLayout->ReflowFrame(aFrame, aStatus, nullptr, pushedFrame);
|
lineLayout->ReflowFrame(aFrame, aStatus, nullptr, pushedFrame);
|
||||||
@@ -857,7 +857,7 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
nsIFrame*
|
nsIFrame*
|
||||||
nsInlineFrame::PullOneFrame(nsPresContext* aPresContext,
|
nsInlineFrame::PullOneFrame(nsPresContext* aPresContext,
|
||||||
InlineReflowState& irs,
|
InlineReflowInput& irs,
|
||||||
bool* aIsComplete)
|
bool* aIsComplete)
|
||||||
{
|
{
|
||||||
bool isComplete = true;
|
bool isComplete = true;
|
||||||
@@ -918,7 +918,7 @@ void
|
|||||||
nsInlineFrame::PushFrames(nsPresContext* aPresContext,
|
nsInlineFrame::PushFrames(nsPresContext* aPresContext,
|
||||||
nsIFrame* aFromChild,
|
nsIFrame* aFromChild,
|
||||||
nsIFrame* aPrevSibling,
|
nsIFrame* aPrevSibling,
|
||||||
InlineReflowState& aState)
|
InlineReflowInput& aState)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(aFromChild, "null pointer");
|
NS_PRECONDITION(aFromChild, "null pointer");
|
||||||
NS_PRECONDITION(aPrevSibling, "pushing first child");
|
NS_PRECONDITION(aPrevSibling, "pushing first child");
|
||||||
@@ -941,7 +941,7 @@ nsInlineFrame::PushFrames(nsPresContext* aPresContext,
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
nsIFrame::LogicalSides
|
||||||
nsInlineFrame::GetLogicalSkipSides(const ReflowInput* aReflowState) const
|
nsInlineFrame::GetLogicalSkipSides(const ReflowInput* aReflowInput) const
|
||||||
{
|
{
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
||||||
@@ -1076,7 +1076,7 @@ nsFirstLineFrame::GetType() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame*
|
nsIFrame*
|
||||||
nsFirstLineFrame::PullOneFrame(nsPresContext* aPresContext, InlineReflowState& irs,
|
nsFirstLineFrame::PullOneFrame(nsPresContext* aPresContext, InlineReflowInput& irs,
|
||||||
bool* aIsComplete)
|
bool* aIsComplete)
|
||||||
{
|
{
|
||||||
nsIFrame* frame = nsInlineFrame::PullOneFrame(aPresContext, irs, aIsComplete);
|
nsIFrame* frame = nsInlineFrame::PullOneFrame(aPresContext, irs, aIsComplete);
|
||||||
@@ -1093,15 +1093,15 @@ nsFirstLineFrame::PullOneFrame(nsPresContext* aPresContext, InlineReflowState& i
|
|||||||
void
|
void
|
||||||
nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
|
nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
if (nullptr == aReflowState.mLineLayout) {
|
if (nullptr == aReflowInput.mLineLayout) {
|
||||||
return; // XXX does this happen? why?
|
return; // XXX does this happen? why?
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame* lineContainer = aReflowState.mLineLayout->LineContainerFrame();
|
nsIFrame* lineContainer = aReflowInput.mLineLayout->LineContainerFrame();
|
||||||
|
|
||||||
// Check for an overflow list with our prev-in-flow
|
// Check for an overflow list with our prev-in-flow
|
||||||
nsFirstLineFrame* prevInFlow = (nsFirstLineFrame*)GetPrevInFlow();
|
nsFirstLineFrame* prevInFlow = (nsFirstLineFrame*)GetPrevInFlow();
|
||||||
@@ -1125,11 +1125,11 @@ nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
DrainSelfOverflowList();
|
DrainSelfOverflowList();
|
||||||
|
|
||||||
// Set our own reflow state (additional state above and beyond
|
// Set our own reflow state (additional state above and beyond
|
||||||
// aReflowState)
|
// aReflowInput)
|
||||||
InlineReflowState irs;
|
InlineReflowInput irs;
|
||||||
irs.mPrevFrame = nullptr;
|
irs.mPrevFrame = nullptr;
|
||||||
irs.mLineContainer = lineContainer;
|
irs.mLineContainer = lineContainer;
|
||||||
irs.mLineLayout = aReflowState.mLineLayout;
|
irs.mLineLayout = aReflowInput.mLineLayout;
|
||||||
irs.mNextInFlow = (nsInlineFrame*) GetNextInFlow();
|
irs.mNextInFlow = (nsInlineFrame*) GetNextInFlow();
|
||||||
|
|
||||||
bool wasEmpty = mFrames.IsEmpty();
|
bool wasEmpty = mFrames.IsEmpty();
|
||||||
@@ -1159,13 +1159,13 @@ nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
irs.mPrevFrame = nullptr;
|
irs.mPrevFrame = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_ASSERTION(!aReflowState.mLineLayout->GetInFirstLine(),
|
NS_ASSERTION(!aReflowInput.mLineLayout->GetInFirstLine(),
|
||||||
"Nested first-line frames? BOGUS");
|
"Nested first-line frames? BOGUS");
|
||||||
aReflowState.mLineLayout->SetInFirstLine(true);
|
aReflowInput.mLineLayout->SetInFirstLine(true);
|
||||||
ReflowFrames(aPresContext, aReflowState, irs, aMetrics, aStatus);
|
ReflowFrames(aPresContext, aReflowInput, irs, aMetrics, aStatus);
|
||||||
aReflowState.mLineLayout->SetInFirstLine(false);
|
aReflowInput.mLineLayout->SetInFirstLine(false);
|
||||||
|
|
||||||
ReflowAbsoluteFrames(aPresContext, aMetrics, aReflowState, aStatus);
|
ReflowAbsoluteFrames(aPresContext, aMetrics, aReflowInput, aStatus);
|
||||||
|
|
||||||
// Note: the line layout code will properly compute our overflow state for us
|
// Note: the line layout code will properly compute our overflow state for us
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public:
|
|||||||
virtual nsRect ComputeTightBounds(DrawTarget* aDrawTarget) const override;
|
virtual nsRect ComputeTightBounds(DrawTarget* aDrawTarget) const override;
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
||||||
@@ -118,7 +118,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Additional reflow state used during our reflow methods
|
// Additional reflow state used during our reflow methods
|
||||||
struct InlineReflowState {
|
struct InlineReflowInput {
|
||||||
nsIFrame* mPrevFrame;
|
nsIFrame* mPrevFrame;
|
||||||
nsInlineFrame* mNextInFlow;
|
nsInlineFrame* mNextInFlow;
|
||||||
nsIFrame* mLineContainer;
|
nsIFrame* mLineContainer;
|
||||||
@@ -126,7 +126,7 @@ protected:
|
|||||||
bool mSetParentPointer; // when reflowing child frame first set its
|
bool mSetParentPointer; // when reflowing child frame first set its
|
||||||
// parent frame pointer
|
// parent frame pointer
|
||||||
|
|
||||||
InlineReflowState() {
|
InlineReflowInput() {
|
||||||
mPrevFrame = nullptr;
|
mPrevFrame = nullptr;
|
||||||
mNextInFlow = nullptr;
|
mNextInFlow = nullptr;
|
||||||
mLineContainer = nullptr;
|
mLineContainer = nullptr;
|
||||||
@@ -137,17 +137,17 @@ protected:
|
|||||||
|
|
||||||
explicit nsInlineFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
|
explicit nsInlineFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
|
||||||
|
|
||||||
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowState = nullptr) const override;
|
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowInput = nullptr) const override;
|
||||||
|
|
||||||
void ReflowFrames(nsPresContext* aPresContext,
|
void ReflowFrames(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
InlineReflowState& rs,
|
InlineReflowInput& rs,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
void ReflowInlineFrame(nsPresContext* aPresContext,
|
void ReflowInlineFrame(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
InlineReflowState& rs,
|
InlineReflowInput& rs,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
@@ -161,13 +161,13 @@ protected:
|
|||||||
bool aReparentSiblings);
|
bool aReparentSiblings);
|
||||||
|
|
||||||
virtual nsIFrame* PullOneFrame(nsPresContext* aPresContext,
|
virtual nsIFrame* PullOneFrame(nsPresContext* aPresContext,
|
||||||
InlineReflowState& rs,
|
InlineReflowInput& rs,
|
||||||
bool* aIsComplete);
|
bool* aIsComplete);
|
||||||
|
|
||||||
virtual void PushFrames(nsPresContext* aPresContext,
|
virtual void PushFrames(nsPresContext* aPresContext,
|
||||||
nsIFrame* aFromChild,
|
nsIFrame* aFromChild,
|
||||||
nsIFrame* aPrevSibling,
|
nsIFrame* aPrevSibling,
|
||||||
InlineReflowState& aState);
|
InlineReflowInput& aState);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Helper method for DrainSelfOverflowList() to deal with lazy parenting
|
// Helper method for DrainSelfOverflowList() to deal with lazy parenting
|
||||||
@@ -210,7 +210,7 @@ public:
|
|||||||
virtual nsIAtom* GetType() const override;
|
virtual nsIAtom* GetType() const override;
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual void Init(nsIContent* aContent,
|
virtual void Init(nsIContent* aContent,
|
||||||
@@ -223,7 +223,7 @@ protected:
|
|||||||
explicit nsFirstLineFrame(nsStyleContext* aContext) : nsInlineFrame(aContext) {}
|
explicit nsFirstLineFrame(nsStyleContext* aContext) : nsInlineFrame(aContext) {}
|
||||||
|
|
||||||
virtual nsIFrame* PullOneFrame(nsPresContext* aPresContext,
|
virtual nsIFrame* PullOneFrame(nsPresContext* aPresContext,
|
||||||
InlineReflowState& rs,
|
InlineReflowInput& rs,
|
||||||
bool* aIsComplete) override;
|
bool* aIsComplete) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -51,18 +51,18 @@ nsLeafFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
|||||||
void
|
void
|
||||||
nsLeafFrame::Reflow(nsPresContext* aPresContext,
|
nsLeafFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsLeafFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsLeafFrame");
|
||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("enter nsLeafFrame::Reflow: aMaxSize=%d,%d",
|
("enter nsLeafFrame::Reflow: aMaxSize=%d,%d",
|
||||||
aReflowState.AvailableWidth(), aReflowState.AvailableHeight()));
|
aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight()));
|
||||||
|
|
||||||
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
|
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
|
||||||
|
|
||||||
DoReflow(aPresContext, aMetrics, aReflowState, aStatus);
|
DoReflow(aPresContext, aMetrics, aReflowInput, aStatus);
|
||||||
|
|
||||||
FinishAndStoreOverflow(&aMetrics);
|
FinishAndStoreOverflow(&aMetrics);
|
||||||
}
|
}
|
||||||
@@ -70,27 +70,27 @@ nsLeafFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
void
|
void
|
||||||
nsLeafFrame::DoReflow(nsPresContext* aPresContext,
|
nsLeafFrame::DoReflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(aReflowState.ComputedWidth() != NS_UNCONSTRAINEDSIZE,
|
NS_ASSERTION(aReflowInput.ComputedWidth() != NS_UNCONSTRAINEDSIZE,
|
||||||
"Shouldn't have unconstrained stuff here "
|
"Shouldn't have unconstrained stuff here "
|
||||||
"thanks to the rules of reflow");
|
"thanks to the rules of reflow");
|
||||||
NS_ASSERTION(NS_INTRINSICSIZE != aReflowState.ComputedHeight(),
|
NS_ASSERTION(NS_INTRINSICSIZE != aReflowInput.ComputedHeight(),
|
||||||
"Shouldn't have unconstrained stuff here "
|
"Shouldn't have unconstrained stuff here "
|
||||||
"thanks to ComputeAutoSize");
|
"thanks to ComputeAutoSize");
|
||||||
|
|
||||||
// XXX how should border&padding effect baseline alignment?
|
// XXX how should border&padding effect baseline alignment?
|
||||||
// => descent = borderPadding.bottom for example
|
// => descent = borderPadding.bottom for example
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
aMetrics.SetSize(wm, aReflowState.ComputedSizeWithBorderPadding());
|
aMetrics.SetSize(wm, aReflowInput.ComputedSizeWithBorderPadding());
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("exit nsLeafFrame::DoReflow: size=%d,%d",
|
("exit nsLeafFrame::DoReflow: size=%d,%d",
|
||||||
aMetrics.ISize(wm), aMetrics.BSize(wm)));
|
aMetrics.ISize(wm), aMetrics.BSize(wm)));
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
|
||||||
|
|
||||||
aMetrics.SetOverflowAreasToDesiredBounds();
|
aMetrics.SetOverflowAreasToDesiredBounds();
|
||||||
}
|
}
|
||||||
@@ -103,12 +103,12 @@ nsLeafFrame::GetIntrinsicBSize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsLeafFrame::SizeToAvailSize(const ReflowInput& aReflowState,
|
nsLeafFrame::SizeToAvailSize(const ReflowInput& aReflowInput,
|
||||||
ReflowOutput& aDesiredSize)
|
ReflowOutput& aDesiredSize)
|
||||||
{
|
{
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
LogicalSize size(wm, aReflowState.AvailableISize(), // FRAME
|
LogicalSize size(wm, aReflowInput.AvailableISize(), // FRAME
|
||||||
aReflowState.AvailableBSize());
|
aReflowInput.AvailableBSize());
|
||||||
aDesiredSize.SetSize(wm, size);
|
aDesiredSize.SetSize(wm, size);
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
FinishAndStoreOverflow(&aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,7 +66,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void DoReflow(nsPresContext* aPresContext,
|
virtual void DoReflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override
|
virtual bool IsFrameOfType(uint32_t aFlags) const override
|
||||||
@@ -99,7 +99,7 @@ protected:
|
|||||||
/**
|
/**
|
||||||
* Set aDesiredSize to be the available size
|
* Set aDesiredSize to be the available size
|
||||||
*/
|
*/
|
||||||
void SizeToAvailSize(const ReflowInput& aReflowState,
|
void SizeToAvailSize(const ReflowInput& aReflowInput,
|
||||||
ReflowOutput& aDesiredSize);
|
ReflowOutput& aDesiredSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -54,12 +54,12 @@ using namespace mozilla;
|
|||||||
|
|
||||||
nsLineLayout::nsLineLayout(nsPresContext* aPresContext,
|
nsLineLayout::nsLineLayout(nsPresContext* aPresContext,
|
||||||
nsFloatManager* aFloatManager,
|
nsFloatManager* aFloatManager,
|
||||||
const ReflowInput* aOuterReflowState,
|
const ReflowInput* aOuterReflowInput,
|
||||||
const nsLineList::iterator* aLine,
|
const nsLineList::iterator* aLine,
|
||||||
nsLineLayout* aBaseLineLayout)
|
nsLineLayout* aBaseLineLayout)
|
||||||
: mPresContext(aPresContext),
|
: mPresContext(aPresContext),
|
||||||
mFloatManager(aFloatManager),
|
mFloatManager(aFloatManager),
|
||||||
mBlockReflowState(aOuterReflowState),
|
mBlockReflowInput(aOuterReflowInput),
|
||||||
mBaseLineLayout(aBaseLineLayout),
|
mBaseLineLayout(aBaseLineLayout),
|
||||||
mLastOptionalBreakFrame(nullptr),
|
mLastOptionalBreakFrame(nullptr),
|
||||||
mForceBreakFrame(nullptr),
|
mForceBreakFrame(nullptr),
|
||||||
@@ -83,25 +83,25 @@ nsLineLayout::nsLineLayout(nsPresContext* aPresContext,
|
|||||||
mDirtyNextLine(false),
|
mDirtyNextLine(false),
|
||||||
mLineAtStart(false),
|
mLineAtStart(false),
|
||||||
mHasRuby(false),
|
mHasRuby(false),
|
||||||
mSuppressLineWrap(aOuterReflowState->mFrame->IsSVGText())
|
mSuppressLineWrap(aOuterReflowInput->mFrame->IsSVGText())
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aOuterReflowState, "aOuterReflowState must not be null");
|
MOZ_ASSERT(aOuterReflowInput, "aOuterReflowInput must not be null");
|
||||||
NS_ASSERTION(aFloatManager || aOuterReflowState->mFrame->GetType() ==
|
NS_ASSERTION(aFloatManager || aOuterReflowInput->mFrame->GetType() ==
|
||||||
nsGkAtoms::letterFrame,
|
nsGkAtoms::letterFrame,
|
||||||
"float manager should be present");
|
"float manager should be present");
|
||||||
MOZ_ASSERT((!!mBaseLineLayout) ==
|
MOZ_ASSERT((!!mBaseLineLayout) ==
|
||||||
(aOuterReflowState->mFrame->GetType() ==
|
(aOuterReflowInput->mFrame->GetType() ==
|
||||||
nsGkAtoms::rubyTextContainerFrame),
|
nsGkAtoms::rubyTextContainerFrame),
|
||||||
"Only ruby text container frames have "
|
"Only ruby text container frames have "
|
||||||
"a different base line layout");
|
"a different base line layout");
|
||||||
MOZ_COUNT_CTOR(nsLineLayout);
|
MOZ_COUNT_CTOR(nsLineLayout);
|
||||||
|
|
||||||
// Stash away some style data that we need
|
// Stash away some style data that we need
|
||||||
nsBlockFrame* blockFrame = do_QueryFrame(aOuterReflowState->mFrame);
|
nsBlockFrame* blockFrame = do_QueryFrame(aOuterReflowInput->mFrame);
|
||||||
if (blockFrame)
|
if (blockFrame)
|
||||||
mStyleText = blockFrame->StyleTextForLineLayout();
|
mStyleText = blockFrame->StyleTextForLineLayout();
|
||||||
else
|
else
|
||||||
mStyleText = aOuterReflowState->mFrame->StyleText();
|
mStyleText = aOuterReflowInput->mFrame->StyleText();
|
||||||
|
|
||||||
mLineNumber = 0;
|
mLineNumber = 0;
|
||||||
mTotalPlacedFrames = 0;
|
mTotalPlacedFrames = 0;
|
||||||
@@ -109,7 +109,7 @@ nsLineLayout::nsLineLayout(nsPresContext* aPresContext,
|
|||||||
mTrimmableISize = 0;
|
mTrimmableISize = 0;
|
||||||
|
|
||||||
mInflationMinFontSize =
|
mInflationMinFontSize =
|
||||||
nsLayoutUtils::InflationMinFontSizeFor(aOuterReflowState->mFrame);
|
nsLayoutUtils::InflationMinFontSizeFor(aOuterReflowInput->mFrame);
|
||||||
|
|
||||||
// Instead of always pre-initializing the free-lists for frames and
|
// Instead of always pre-initializing the free-lists for frames and
|
||||||
// spans, we do it on demand so that situations that only use a few
|
// spans, we do it on demand so that situations that only use a few
|
||||||
@@ -162,19 +162,19 @@ nsLineLayout::BeginLineReflow(nscoord aICoord, nscoord aBCoord,
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if ((aISize != NS_UNCONSTRAINEDSIZE) && CRAZY_SIZE(aISize) &&
|
if ((aISize != NS_UNCONSTRAINEDSIZE) && CRAZY_SIZE(aISize) &&
|
||||||
!LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
|
!LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
|
||||||
nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
|
nsFrame::ListTag(stdout, mBlockReflowInput->mFrame);
|
||||||
printf(": Init: bad caller: width WAS %d(0x%x)\n",
|
printf(": Init: bad caller: width WAS %d(0x%x)\n",
|
||||||
aISize, aISize);
|
aISize, aISize);
|
||||||
}
|
}
|
||||||
if ((aBSize != NS_UNCONSTRAINEDSIZE) && CRAZY_SIZE(aBSize) &&
|
if ((aBSize != NS_UNCONSTRAINEDSIZE) && CRAZY_SIZE(aBSize) &&
|
||||||
!LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
|
!LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
|
||||||
nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
|
nsFrame::ListTag(stdout, mBlockReflowInput->mFrame);
|
||||||
printf(": Init: bad caller: height WAS %d(0x%x)\n",
|
printf(": Init: bad caller: height WAS %d(0x%x)\n",
|
||||||
aBSize, aBSize);
|
aBSize, aBSize);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef NOISY_REFLOW
|
#ifdef NOISY_REFLOW
|
||||||
nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
|
nsFrame::ListTag(stdout, mBlockReflowInput->mFrame);
|
||||||
printf(": BeginLineReflow: %d,%d,%d,%d impacted=%s %s\n",
|
printf(": BeginLineReflow: %d,%d,%d,%d impacted=%s %s\n",
|
||||||
aICoord, aBCoord, aISize, aBSize,
|
aICoord, aBCoord, aISize, aBSize,
|
||||||
aImpactedByFloats?"true":"false",
|
aImpactedByFloats?"true":"false",
|
||||||
@@ -205,7 +205,7 @@ nsLineLayout::BeginLineReflow(nscoord aICoord, nscoord aBCoord,
|
|||||||
|
|
||||||
PerSpanData* psd = NewPerSpanData();
|
PerSpanData* psd = NewPerSpanData();
|
||||||
mCurrentSpan = mRootSpan = psd;
|
mCurrentSpan = mRootSpan = psd;
|
||||||
psd->mReflowState = mBlockReflowState;
|
psd->mReflowInput = mBlockReflowInput;
|
||||||
psd->mIStart = aICoord;
|
psd->mIStart = aICoord;
|
||||||
psd->mICoord = aICoord;
|
psd->mICoord = aICoord;
|
||||||
psd->mIEnd = aICoord + aISize;
|
psd->mIEnd = aICoord + aISize;
|
||||||
@@ -219,12 +219,12 @@ nsLineLayout::BeginLineReflow(nscoord aICoord, nscoord aBCoord,
|
|||||||
// If this is the first line of a block then see if the text-indent
|
// If this is the first line of a block then see if the text-indent
|
||||||
// property amounts to anything.
|
// property amounts to anything.
|
||||||
|
|
||||||
if (0 == mLineNumber && !HasPrevInFlow(mBlockReflowState->mFrame)) {
|
if (0 == mLineNumber && !HasPrevInFlow(mBlockReflowInput->mFrame)) {
|
||||||
const nsStyleCoord &textIndent = mStyleText->mTextIndent;
|
const nsStyleCoord &textIndent = mStyleText->mTextIndent;
|
||||||
nscoord pctBasis = 0;
|
nscoord pctBasis = 0;
|
||||||
if (textIndent.HasPercent()) {
|
if (textIndent.HasPercent()) {
|
||||||
pctBasis =
|
pctBasis =
|
||||||
mBlockReflowState->GetContainingBlockContentISize(aWritingMode);
|
mBlockReflowInput->GetContainingBlockContentISize(aWritingMode);
|
||||||
}
|
}
|
||||||
nscoord indent = nsRuleNode::ComputeCoordPercentCalc(textIndent, pctBasis);
|
nscoord indent = nsRuleNode::ComputeCoordPercentCalc(textIndent, pctBasis);
|
||||||
|
|
||||||
@@ -233,23 +233,23 @@ nsLineLayout::BeginLineReflow(nscoord aICoord, nscoord aBCoord,
|
|||||||
psd->mICoord += indent;
|
psd->mICoord += indent;
|
||||||
}
|
}
|
||||||
|
|
||||||
PerFrameData* pfd = NewPerFrameData(mBlockReflowState->mFrame);
|
PerFrameData* pfd = NewPerFrameData(mBlockReflowInput->mFrame);
|
||||||
pfd->mAscent = 0;
|
pfd->mAscent = 0;
|
||||||
pfd->mSpan = psd;
|
pfd->mSpan = psd;
|
||||||
psd->mFrame = pfd;
|
psd->mFrame = pfd;
|
||||||
nsIFrame* frame = mBlockReflowState->mFrame;
|
nsIFrame* frame = mBlockReflowInput->mFrame;
|
||||||
if (frame->GetType() == nsGkAtoms::rubyTextContainerFrame) {
|
if (frame->GetType() == nsGkAtoms::rubyTextContainerFrame) {
|
||||||
// Ruby text container won't be reflowed via ReflowFrame, hence the
|
// Ruby text container won't be reflowed via ReflowFrame, hence the
|
||||||
// relative positioning information should be recorded here.
|
// relative positioning information should be recorded here.
|
||||||
MOZ_ASSERT(mBaseLineLayout != this);
|
MOZ_ASSERT(mBaseLineLayout != this);
|
||||||
pfd->mRelativePos =
|
pfd->mRelativePos =
|
||||||
mBlockReflowState->mStyleDisplay->IsRelativelyPositionedStyle();
|
mBlockReflowInput->mStyleDisplay->IsRelativelyPositionedStyle();
|
||||||
if (pfd->mRelativePos) {
|
if (pfd->mRelativePos) {
|
||||||
MOZ_ASSERT(
|
MOZ_ASSERT(
|
||||||
mBlockReflowState->GetWritingMode() == pfd->mWritingMode,
|
mBlockReflowInput->GetWritingMode() == pfd->mWritingMode,
|
||||||
"mBlockReflowState->frame == frame, "
|
"mBlockReflowInput->frame == frame, "
|
||||||
"hence they should have identical writing mode");
|
"hence they should have identical writing mode");
|
||||||
pfd->mOffsets = mBlockReflowState->ComputedLogicalOffsets();
|
pfd->mOffsets = mBlockReflowInput->ComputedLogicalOffsets();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -258,7 +258,7 @@ void
|
|||||||
nsLineLayout::EndLineReflow()
|
nsLineLayout::EndLineReflow()
|
||||||
{
|
{
|
||||||
#ifdef NOISY_REFLOW
|
#ifdef NOISY_REFLOW
|
||||||
nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
|
nsFrame::ListTag(stdout, mBlockReflowInput->mFrame);
|
||||||
printf(": EndLineReflow: width=%d\n", mRootSpan->mICoord - mRootSpan->mIStart);
|
printf(": EndLineReflow: width=%d\n", mRootSpan->mICoord - mRootSpan->mIStart);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -314,14 +314,14 @@ nsLineLayout::UpdateBand(WritingMode aWM,
|
|||||||
if ((availSpace.ISize(lineWM) != NS_UNCONSTRAINEDSIZE) &&
|
if ((availSpace.ISize(lineWM) != NS_UNCONSTRAINEDSIZE) &&
|
||||||
CRAZY_SIZE(availSpace.ISize(lineWM)) &&
|
CRAZY_SIZE(availSpace.ISize(lineWM)) &&
|
||||||
!LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
|
!LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
|
||||||
nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
|
nsFrame::ListTag(stdout, mBlockReflowInput->mFrame);
|
||||||
printf(": UpdateBand: bad caller: ISize WAS %d(0x%x)\n",
|
printf(": UpdateBand: bad caller: ISize WAS %d(0x%x)\n",
|
||||||
availSpace.ISize(lineWM), availSpace.ISize(lineWM));
|
availSpace.ISize(lineWM), availSpace.ISize(lineWM));
|
||||||
}
|
}
|
||||||
if ((availSpace.BSize(lineWM) != NS_UNCONSTRAINEDSIZE) &&
|
if ((availSpace.BSize(lineWM) != NS_UNCONSTRAINEDSIZE) &&
|
||||||
CRAZY_SIZE(availSpace.BSize(lineWM)) &&
|
CRAZY_SIZE(availSpace.BSize(lineWM)) &&
|
||||||
!LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
|
!LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
|
||||||
nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
|
nsFrame::ListTag(stdout, mBlockReflowInput->mFrame);
|
||||||
printf(": UpdateBand: bad caller: BSize WAS %d(0x%x)\n",
|
printf(": UpdateBand: bad caller: BSize WAS %d(0x%x)\n",
|
||||||
availSpace.BSize(lineWM), availSpace.BSize(lineWM));
|
availSpace.BSize(lineWM), availSpace.BSize(lineWM));
|
||||||
}
|
}
|
||||||
@@ -340,7 +340,7 @@ nsLineLayout::UpdateBand(WritingMode aWM,
|
|||||||
nscoord deltaISize = availSpace.ISize(lineWM) -
|
nscoord deltaISize = availSpace.ISize(lineWM) -
|
||||||
(mRootSpan->mIEnd - mRootSpan->mIStart);
|
(mRootSpan->mIEnd - mRootSpan->mIStart);
|
||||||
#ifdef NOISY_REFLOW
|
#ifdef NOISY_REFLOW
|
||||||
nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
|
nsFrame::ListTag(stdout, mBlockReflowInput->mFrame);
|
||||||
printf(": UpdateBand: %d,%d,%d,%d deltaISize=%d deltaICoord=%d\n",
|
printf(": UpdateBand: %d,%d,%d,%d deltaISize=%d deltaICoord=%d\n",
|
||||||
availSpace.IStart(lineWM), availSpace.BStart(lineWM),
|
availSpace.IStart(lineWM), availSpace.BStart(lineWM),
|
||||||
availSpace.ISize(lineWM), availSpace.BSize(lineWM),
|
availSpace.ISize(lineWM), availSpace.BSize(lineWM),
|
||||||
@@ -416,7 +416,7 @@ nsLineLayout::NewPerSpanData()
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsLineLayout::BeginSpan(nsIFrame* aFrame,
|
nsLineLayout::BeginSpan(nsIFrame* aFrame,
|
||||||
const ReflowInput* aSpanReflowState,
|
const ReflowInput* aSpanReflowInput,
|
||||||
nscoord aIStart, nscoord aIEnd,
|
nscoord aIStart, nscoord aIEnd,
|
||||||
nscoord* aBaseline)
|
nscoord* aBaseline)
|
||||||
{
|
{
|
||||||
@@ -437,17 +437,17 @@ nsLineLayout::BeginSpan(nsIFrame* aFrame,
|
|||||||
// Init new span
|
// Init new span
|
||||||
psd->mFrame = pfd;
|
psd->mFrame = pfd;
|
||||||
psd->mParent = mCurrentSpan;
|
psd->mParent = mCurrentSpan;
|
||||||
psd->mReflowState = aSpanReflowState;
|
psd->mReflowInput = aSpanReflowInput;
|
||||||
psd->mIStart = aIStart;
|
psd->mIStart = aIStart;
|
||||||
psd->mICoord = aIStart;
|
psd->mICoord = aIStart;
|
||||||
psd->mIEnd = aIEnd;
|
psd->mIEnd = aIEnd;
|
||||||
psd->mBaseline = aBaseline;
|
psd->mBaseline = aBaseline;
|
||||||
|
|
||||||
nsIFrame* frame = aSpanReflowState->mFrame;
|
nsIFrame* frame = aSpanReflowInput->mFrame;
|
||||||
psd->mNoWrap = !frame->StyleText()->WhiteSpaceCanWrap(frame) ||
|
psd->mNoWrap = !frame->StyleText()->WhiteSpaceCanWrap(frame) ||
|
||||||
mSuppressLineWrap ||
|
mSuppressLineWrap ||
|
||||||
frame->StyleContext()->ShouldSuppressLineBreak();
|
frame->StyleContext()->ShouldSuppressLineBreak();
|
||||||
psd->mWritingMode = aSpanReflowState->GetWritingMode();
|
psd->mWritingMode = aSpanReflowInput->GetWritingMode();
|
||||||
|
|
||||||
// Switch to new span
|
// Switch to new span
|
||||||
mCurrentSpan = psd;
|
mCurrentSpan = psd;
|
||||||
@@ -467,7 +467,7 @@ nsLineLayout::EndSpan(nsIFrame* aFrame)
|
|||||||
nscoord iSizeResult = psd->mLastFrame ? (psd->mICoord - psd->mIStart) : 0;
|
nscoord iSizeResult = psd->mLastFrame ? (psd->mICoord - psd->mIStart) : 0;
|
||||||
|
|
||||||
mSpanDepth--;
|
mSpanDepth--;
|
||||||
mCurrentSpan->mReflowState = nullptr; // no longer valid so null it out!
|
mCurrentSpan->mReflowInput = nullptr; // no longer valid so null it out!
|
||||||
mCurrentSpan = mCurrentSpan->mParent;
|
mCurrentSpan = mCurrentSpan->mParent;
|
||||||
return iSizeResult;
|
return iSizeResult;
|
||||||
}
|
}
|
||||||
@@ -873,38 +873,38 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||||||
nscoord availableSpaceOnLine = psd->mIEnd - psd->mICoord;
|
nscoord availableSpaceOnLine = psd->mIEnd - psd->mICoord;
|
||||||
|
|
||||||
// Setup reflow state for reflowing the frame
|
// Setup reflow state for reflowing the frame
|
||||||
Maybe<ReflowInput> reflowStateHolder;
|
Maybe<ReflowInput> reflowInputHolder;
|
||||||
if (!isText) {
|
if (!isText) {
|
||||||
// Compute the available size for the frame. This available width
|
// Compute the available size for the frame. This available width
|
||||||
// includes room for the side margins.
|
// includes room for the side margins.
|
||||||
// For now, set the available block-size to unconstrained always.
|
// For now, set the available block-size to unconstrained always.
|
||||||
LogicalSize availSize = mBlockReflowState->ComputedSize(frameWM);
|
LogicalSize availSize = mBlockReflowInput->ComputedSize(frameWM);
|
||||||
availSize.BSize(frameWM) = NS_UNCONSTRAINEDSIZE;
|
availSize.BSize(frameWM) = NS_UNCONSTRAINEDSIZE;
|
||||||
reflowStateHolder.emplace(mPresContext, *psd->mReflowState,
|
reflowInputHolder.emplace(mPresContext, *psd->mReflowInput,
|
||||||
aFrame, availSize);
|
aFrame, availSize);
|
||||||
ReflowInput& reflowState = *reflowStateHolder;
|
ReflowInput& reflowInput = *reflowInputHolder;
|
||||||
reflowState.mLineLayout = this;
|
reflowInput.mLineLayout = this;
|
||||||
reflowState.mFlags.mIsTopOfPage = mIsTopOfPage;
|
reflowInput.mFlags.mIsTopOfPage = mIsTopOfPage;
|
||||||
if (reflowState.ComputedISize() == NS_UNCONSTRAINEDSIZE) {
|
if (reflowInput.ComputedISize() == NS_UNCONSTRAINEDSIZE) {
|
||||||
reflowState.AvailableISize() = availableSpaceOnLine;
|
reflowInput.AvailableISize() = availableSpaceOnLine;
|
||||||
}
|
}
|
||||||
WritingMode stateWM = reflowState.GetWritingMode();
|
WritingMode stateWM = reflowInput.GetWritingMode();
|
||||||
pfd->mMargin =
|
pfd->mMargin =
|
||||||
reflowState.ComputedLogicalMargin().ConvertTo(lineWM, stateWM);
|
reflowInput.ComputedLogicalMargin().ConvertTo(lineWM, stateWM);
|
||||||
pfd->mBorderPadding =
|
pfd->mBorderPadding =
|
||||||
reflowState.ComputedLogicalBorderPadding().ConvertTo(lineWM, stateWM);
|
reflowInput.ComputedLogicalBorderPadding().ConvertTo(lineWM, stateWM);
|
||||||
pfd->mRelativePos =
|
pfd->mRelativePos =
|
||||||
reflowState.mStyleDisplay->IsRelativelyPositionedStyle();
|
reflowInput.mStyleDisplay->IsRelativelyPositionedStyle();
|
||||||
if (pfd->mRelativePos) {
|
if (pfd->mRelativePos) {
|
||||||
pfd->mOffsets =
|
pfd->mOffsets =
|
||||||
reflowState.ComputedLogicalOffsets().ConvertTo(frameWM, stateWM);
|
reflowInput.ComputedLogicalOffsets().ConvertTo(frameWM, stateWM);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate whether the the frame should have a start margin and
|
// Calculate whether the the frame should have a start margin and
|
||||||
// subtract the margin from the available width if necessary.
|
// subtract the margin from the available width if necessary.
|
||||||
// The margin will be applied to the starting inline coordinates of
|
// The margin will be applied to the starting inline coordinates of
|
||||||
// the frame in CanPlaceFrame() after reflowing the frame.
|
// the frame in CanPlaceFrame() after reflowing the frame.
|
||||||
AllowForStartMargin(pfd, reflowState);
|
AllowForStartMargin(pfd, reflowInput);
|
||||||
}
|
}
|
||||||
// if isText(), no need to propagate NS_FRAME_IS_DIRTY from the parent,
|
// if isText(), no need to propagate NS_FRAME_IS_DIRTY from the parent,
|
||||||
// because reflow doesn't look at the dirty bits on the frame being reflowed.
|
// because reflow doesn't look at the dirty bits on the frame being reflowed.
|
||||||
@@ -940,11 +940,11 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||||||
&savedOptionalBreakPriority);
|
&savedOptionalBreakPriority);
|
||||||
|
|
||||||
if (!isText) {
|
if (!isText) {
|
||||||
aFrame->Reflow(mPresContext, metrics, *reflowStateHolder, aReflowStatus);
|
aFrame->Reflow(mPresContext, metrics, *reflowInputHolder, aReflowStatus);
|
||||||
} else {
|
} else {
|
||||||
static_cast<nsTextFrame*>(aFrame)->
|
static_cast<nsTextFrame*>(aFrame)->
|
||||||
ReflowText(*this, availableSpaceOnLine,
|
ReflowText(*this, availableSpaceOnLine,
|
||||||
psd->mReflowState->mRenderingContext->GetDrawTarget(),
|
psd->mReflowInput->mRenderingContext->GetDrawTarget(),
|
||||||
metrics, aReflowStatus);
|
metrics, aReflowStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1064,7 +1064,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||||||
|
|
||||||
// Tell the frame that we're done reflowing it
|
// Tell the frame that we're done reflowing it
|
||||||
aFrame->DidReflow(mPresContext,
|
aFrame->DidReflow(mPresContext,
|
||||||
isText ? nullptr : reflowStateHolder.ptr(),
|
isText ? nullptr : reflowInputHolder.ptr(),
|
||||||
nsDidReflowStatus::FINISHED);
|
nsDidReflowStatus::FINISHED);
|
||||||
|
|
||||||
if (aMetrics) {
|
if (aMetrics) {
|
||||||
@@ -1100,7 +1100,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||||||
// return now.
|
// return now.
|
||||||
bool optionalBreakAfterFits;
|
bool optionalBreakAfterFits;
|
||||||
NS_ASSERTION(isText ||
|
NS_ASSERTION(isText ||
|
||||||
!reflowStateHolder->IsFloating(),
|
!reflowInputHolder->IsFloating(),
|
||||||
"How'd we get a floated inline frame? "
|
"How'd we get a floated inline frame? "
|
||||||
"The frame ctor should've dealt with this.");
|
"The frame ctor should've dealt with this.");
|
||||||
if (CanPlaceFrame(pfd, notSafeToBreak, continuingTextRun,
|
if (CanPlaceFrame(pfd, notSafeToBreak, continuingTextRun,
|
||||||
@@ -1170,9 +1170,9 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsLineLayout::AllowForStartMargin(PerFrameData* pfd,
|
nsLineLayout::AllowForStartMargin(PerFrameData* pfd,
|
||||||
ReflowInput& aReflowState)
|
ReflowInput& aReflowInput)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(!aReflowState.IsFloating(),
|
NS_ASSERTION(!aReflowInput.IsFloating(),
|
||||||
"How'd we get a floated inline frame? "
|
"How'd we get a floated inline frame? "
|
||||||
"The frame ctor should've dealt with this.");
|
"The frame ctor should've dealt with this.");
|
||||||
|
|
||||||
@@ -1187,13 +1187,13 @@ nsLineLayout::AllowForStartMargin(PerFrameData* pfd,
|
|||||||
// on all continuations.
|
// on all continuations.
|
||||||
if ((pfd->mFrame->GetPrevContinuation() ||
|
if ((pfd->mFrame->GetPrevContinuation() ||
|
||||||
pfd->mFrame->FrameIsNonFirstInIBSplit()) &&
|
pfd->mFrame->FrameIsNonFirstInIBSplit()) &&
|
||||||
aReflowState.mStyleBorder->mBoxDecorationBreak ==
|
aReflowInput.mStyleBorder->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_SLICE) {
|
NS_STYLE_BOX_DECORATION_BREAK_SLICE) {
|
||||||
// Zero this out so that when we compute the max-element-width of
|
// Zero this out so that when we compute the max-element-width of
|
||||||
// the frame we will properly avoid adding in the starting margin.
|
// the frame we will properly avoid adding in the starting margin.
|
||||||
pfd->mMargin.IStart(lineWM) = 0;
|
pfd->mMargin.IStart(lineWM) = 0;
|
||||||
} else if (NS_UNCONSTRAINEDSIZE == aReflowState.ComputedISize()) {
|
} else if (NS_UNCONSTRAINEDSIZE == aReflowInput.ComputedISize()) {
|
||||||
NS_WARN_IF_FALSE(NS_UNCONSTRAINEDSIZE != aReflowState.AvailableISize(),
|
NS_WARN_IF_FALSE(NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableISize(),
|
||||||
"have unconstrained inline-size; this should only result "
|
"have unconstrained inline-size; this should only result "
|
||||||
"from very large sizes, not attempts at intrinsic "
|
"from very large sizes, not attempts at intrinsic "
|
||||||
"inline-size calculation");
|
"inline-size calculation");
|
||||||
@@ -1201,8 +1201,8 @@ nsLineLayout::AllowForStartMargin(PerFrameData* pfd,
|
|||||||
// in the reflow state), adjust available inline-size to account
|
// in the reflow state), adjust available inline-size to account
|
||||||
// for the start margin. The end margin will be accounted for when
|
// for the start margin. The end margin will be accounted for when
|
||||||
// we finish flowing the frame.
|
// we finish flowing the frame.
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
aReflowState.AvailableISize() -=
|
aReflowInput.AvailableISize() -=
|
||||||
pfd->mMargin.ConvertTo(wm, lineWM).IStart(wm);
|
pfd->mMargin.ConvertTo(wm, lineWM).IStart(wm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1470,7 +1470,7 @@ nsLineLayout::AddBulletFrame(nsIFrame* aFrame,
|
|||||||
NS_ASSERTION(mCurrentSpan == mRootSpan, "bad linelayout user");
|
NS_ASSERTION(mCurrentSpan == mRootSpan, "bad linelayout user");
|
||||||
NS_ASSERTION(mGotLineBox, "must have line box");
|
NS_ASSERTION(mGotLineBox, "must have line box");
|
||||||
|
|
||||||
nsIFrame *blockFrame = mBlockReflowState->mFrame;
|
nsIFrame *blockFrame = mBlockReflowInput->mFrame;
|
||||||
NS_ASSERTION(blockFrame->IsFrameOfType(nsIFrame::eBlockFrame),
|
NS_ASSERTION(blockFrame->IsFrameOfType(nsIFrame::eBlockFrame),
|
||||||
"must be for block");
|
"must be for block");
|
||||||
if (!static_cast<nsBlockFrame*>(blockFrame)->BulletIsEmpty()) {
|
if (!static_cast<nsBlockFrame*>(blockFrame)->BulletIsEmpty()) {
|
||||||
@@ -1904,7 +1904,7 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
|||||||
GetInflationForBlockDirAlignment(spanFrame, mInflationMinFontSize);
|
GetInflationForBlockDirAlignment(spanFrame, mInflationMinFontSize);
|
||||||
nscoord logicalBSize = ReflowInput::
|
nscoord logicalBSize = ReflowInput::
|
||||||
CalcLineHeight(spanFrame->GetContent(), spanFrame->StyleContext(),
|
CalcLineHeight(spanFrame->GetContent(), spanFrame->StyleContext(),
|
||||||
mBlockReflowState->ComputedHeight(),
|
mBlockReflowInput->ComputedHeight(),
|
||||||
inflation);
|
inflation);
|
||||||
nscoord contentBSize = spanFramePFD->mBounds.BSize(lineWM) -
|
nscoord contentBSize = spanFramePFD->mBounds.BSize(lineWM) -
|
||||||
spanFramePFD->mBorderPadding.BStartEnd(lineWM);
|
spanFramePFD->mBorderPadding.BStartEnd(lineWM);
|
||||||
@@ -2192,7 +2192,7 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
|||||||
float inflation =
|
float inflation =
|
||||||
GetInflationForBlockDirAlignment(frame, mInflationMinFontSize);
|
GetInflationForBlockDirAlignment(frame, mInflationMinFontSize);
|
||||||
pctBasis = ReflowInput::CalcLineHeight(frame->GetContent(),
|
pctBasis = ReflowInput::CalcLineHeight(frame->GetContent(),
|
||||||
frame->StyleContext(), mBlockReflowState->ComputedBSize(),
|
frame->StyleContext(), mBlockReflowInput->ComputedBSize(),
|
||||||
inflation);
|
inflation);
|
||||||
}
|
}
|
||||||
nscoord offset =
|
nscoord offset =
|
||||||
@@ -2588,7 +2588,7 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
|
|||||||
// might have a soft hyphen which should now appear, changing the frame's
|
// might have a soft hyphen which should now appear, changing the frame's
|
||||||
// width
|
// width
|
||||||
nsTextFrame::TrimOutput trimOutput = static_cast<nsTextFrame*>(pfd->mFrame)->
|
nsTextFrame::TrimOutput trimOutput = static_cast<nsTextFrame*>(pfd->mFrame)->
|
||||||
TrimTrailingWhiteSpace(mBlockReflowState->mRenderingContext->GetDrawTarget());
|
TrimTrailingWhiteSpace(mBlockReflowInput->mRenderingContext->GetDrawTarget());
|
||||||
#ifdef NOISY_TRIM
|
#ifdef NOISY_TRIM
|
||||||
nsFrame::ListTag(stdout, psd->mFrame->mFrame);
|
nsFrame::ListTag(stdout, psd->mFrame->mFrame);
|
||||||
printf(": trim of ");
|
printf(": trim of ");
|
||||||
@@ -3121,7 +3121,7 @@ nsLineLayout::TextAlignLine(nsLineBox* aLine,
|
|||||||
nscoord availISize = psd->mIEnd - psd->mIStart;
|
nscoord availISize = psd->mIEnd - psd->mIStart;
|
||||||
nscoord remainingISize = availISize - aLine->ISize();
|
nscoord remainingISize = availISize - aLine->ISize();
|
||||||
#ifdef NOISY_INLINEDIR_ALIGN
|
#ifdef NOISY_INLINEDIR_ALIGN
|
||||||
nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
|
nsFrame::ListTag(stdout, mBlockReflowInput->mFrame);
|
||||||
printf(": availISize=%d lineBounds.IStart=%d lineISize=%d delta=%d\n",
|
printf(": availISize=%d lineBounds.IStart=%d lineISize=%d delta=%d\n",
|
||||||
availISize, aLine->IStart(), aLine->ISize(), remainingISize);
|
availISize, aLine->IStart(), aLine->ISize(), remainingISize);
|
||||||
#endif
|
#endif
|
||||||
@@ -3146,7 +3146,7 @@ nsLineLayout::TextAlignLine(nsLineBox* aLine,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSVG = mBlockReflowState->mFrame->IsSVGText();
|
bool isSVG = mBlockReflowInput->mFrame->IsSVGText();
|
||||||
bool doTextAlign = remainingISize > 0 || textAlignTrue;
|
bool doTextAlign = remainingISize > 0 || textAlignTrue;
|
||||||
|
|
||||||
int32_t additionalGaps = 0;
|
int32_t additionalGaps = 0;
|
||||||
@@ -3363,7 +3363,7 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflo
|
|||||||
frame->StyleText()->HasTextEmphasis() ||
|
frame->StyleText()->HasTextEmphasis() ||
|
||||||
frame->StyleText()->HasWebkitTextStroke()) {
|
frame->StyleText()->HasWebkitTextStroke()) {
|
||||||
nsTextFrame* f = static_cast<nsTextFrame*>(frame);
|
nsTextFrame* f = static_cast<nsTextFrame*>(frame);
|
||||||
r = f->RecomputeOverflow(mBlockReflowState->mFrame);
|
r = f->RecomputeOverflow(mBlockReflowInput->mFrame);
|
||||||
}
|
}
|
||||||
frame->FinishAndStoreOverflow(r, frame->GetSize());
|
frame->FinishAndStoreOverflow(r, frame->GetSize());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
nsLineLayout(nsPresContext* aPresContext,
|
nsLineLayout(nsPresContext* aPresContext,
|
||||||
nsFloatManager* aFloatManager,
|
nsFloatManager* aFloatManager,
|
||||||
const ReflowInput* aOuterReflowState,
|
const ReflowInput* aOuterReflowInput,
|
||||||
const nsLineList::iterator* aLine,
|
const nsLineList::iterator* aLine,
|
||||||
nsLineLayout* aBaseLineLayout);
|
nsLineLayout* aBaseLineLayout);
|
||||||
~nsLineLayout();
|
~nsLineLayout();
|
||||||
@@ -76,7 +76,7 @@ public:
|
|||||||
const mozilla::LogicalRect& aNewAvailableSpace,
|
const mozilla::LogicalRect& aNewAvailableSpace,
|
||||||
nsIFrame* aFloatFrame);
|
nsIFrame* aFloatFrame);
|
||||||
|
|
||||||
void BeginSpan(nsIFrame* aFrame, const ReflowInput* aSpanReflowState,
|
void BeginSpan(nsIFrame* aFrame, const ReflowInput* aSpanReflowInput,
|
||||||
nscoord aLeftEdge, nscoord aRightEdge, nscoord* aBaseline);
|
nscoord aLeftEdge, nscoord aRightEdge, nscoord* aBaseline);
|
||||||
|
|
||||||
// Returns the width of the span
|
// Returns the width of the span
|
||||||
@@ -342,8 +342,8 @@ public:
|
|||||||
* some other kind of frame when inline frames are reflowed in a non-block
|
* some other kind of frame when inline frames are reflowed in a non-block
|
||||||
* context (e.g. MathML or floating first-letter).
|
* context (e.g. MathML or floating first-letter).
|
||||||
*/
|
*/
|
||||||
nsIFrame* LineContainerFrame() const { return mBlockReflowState->mFrame; }
|
nsIFrame* LineContainerFrame() const { return mBlockReflowInput->mFrame; }
|
||||||
const ReflowInput* LineContainerRS() const { return mBlockReflowState; }
|
const ReflowInput* LineContainerRS() const { return mBlockReflowInput; }
|
||||||
const nsLineList::iterator* GetLine() const {
|
const nsLineList::iterator* GetLine() const {
|
||||||
return mGotLineBox ? &mLineBox : nullptr;
|
return mGotLineBox ? &mLineBox : nullptr;
|
||||||
}
|
}
|
||||||
@@ -383,7 +383,7 @@ protected:
|
|||||||
// This state is constant for a given block frame doing line layout
|
// This state is constant for a given block frame doing line layout
|
||||||
nsFloatManager* mFloatManager;
|
nsFloatManager* mFloatManager;
|
||||||
const nsStyleText* mStyleText; // for the block
|
const nsStyleText* mStyleText; // for the block
|
||||||
const ReflowInput* mBlockReflowState;
|
const ReflowInput* mBlockReflowInput;
|
||||||
|
|
||||||
// The line layout for the base text. It is usually nullptr.
|
// The line layout for the base text. It is usually nullptr.
|
||||||
// It becomes not null when the current line layout is for ruby
|
// It becomes not null when the current line layout is for ruby
|
||||||
@@ -534,7 +534,7 @@ protected:
|
|||||||
// the next.
|
// the next.
|
||||||
PerFrameData* mLastFrame;
|
PerFrameData* mLastFrame;
|
||||||
|
|
||||||
const ReflowInput* mReflowState;
|
const ReflowInput* mReflowInput;
|
||||||
bool mNoWrap;
|
bool mNoWrap;
|
||||||
mozilla::WritingMode mWritingMode;
|
mozilla::WritingMode mWritingMode;
|
||||||
bool mContainsFloat;
|
bool mContainsFloat;
|
||||||
@@ -667,7 +667,7 @@ protected:
|
|||||||
void PushFrame(nsIFrame* aFrame);
|
void PushFrame(nsIFrame* aFrame);
|
||||||
|
|
||||||
void AllowForStartMargin(PerFrameData* pfd,
|
void AllowForStartMargin(PerFrameData* pfd,
|
||||||
ReflowInput& aReflowState);
|
ReflowInput& aReflowInput);
|
||||||
|
|
||||||
void SyncAnnotationBounds(PerFrameData* aRubyFrame);
|
void SyncAnnotationBounds(PerFrameData* aRubyFrame);
|
||||||
|
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ NS_IMPL_FRAMEARENA_HELPERS(nsPageContentFrame)
|
|||||||
void
|
void
|
||||||
nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsPageContentFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsPageContentFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
||||||
|
|
||||||
if (GetPrevInFlow() && (GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
if (GetPrevInFlow() && (GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||||
@@ -42,8 +42,8 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// Set our size up front, since some parts of reflow depend on it
|
// Set our size up front, since some parts of reflow depend on it
|
||||||
// being already set. Note that the computed height may be
|
// being already set. Note that the computed height may be
|
||||||
// unconstrained; that's ok. Consumers should watch out for that.
|
// unconstrained; that's ok. Consumers should watch out for that.
|
||||||
nsSize maxSize(aReflowState.ComputedWidth(),
|
nsSize maxSize(aReflowInput.ComputedWidth(),
|
||||||
aReflowState.ComputedHeight());
|
aReflowInput.ComputedHeight());
|
||||||
SetSize(maxSize);
|
SetSize(maxSize);
|
||||||
|
|
||||||
// A PageContentFrame must always have one child: the canvas frame.
|
// A PageContentFrame must always have one child: the canvas frame.
|
||||||
@@ -53,12 +53,12 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsIFrame* frame = mFrames.FirstChild();
|
nsIFrame* frame = mFrames.FirstChild();
|
||||||
WritingMode wm = frame->GetWritingMode();
|
WritingMode wm = frame->GetWritingMode();
|
||||||
LogicalSize logicalSize(wm, maxSize);
|
LogicalSize logicalSize(wm, maxSize);
|
||||||
ReflowInput kidReflowState(aPresContext, aReflowState,
|
ReflowInput kidReflowInput(aPresContext, aReflowInput,
|
||||||
frame, logicalSize);
|
frame, logicalSize);
|
||||||
kidReflowState.SetComputedBSize(logicalSize.BSize(wm));
|
kidReflowInput.SetComputedBSize(logicalSize.BSize(wm));
|
||||||
|
|
||||||
// Reflow the page content area
|
// Reflow the page content area
|
||||||
ReflowChild(frame, aPresContext, aDesiredSize, kidReflowState, 0, 0, 0, aStatus);
|
ReflowChild(frame, aPresContext, aDesiredSize, kidReflowInput, 0, 0, 0, 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
|
||||||
@@ -67,7 +67,7 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// 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)
|
||||||
kidReflowState.mStylePadding->GetPadding(padding);
|
kidReflowInput.mStylePadding->GetPadding(padding);
|
||||||
|
|
||||||
// This is for shrink-to-fit, and therefore we want to use the
|
// This is for shrink-to-fit, and therefore we want to use the
|
||||||
// scrollable overflow, since the purpose of shrink to fit is to
|
// scrollable overflow, since the purpose of shrink to fit is to
|
||||||
@@ -79,7 +79,7 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nscoord xmost = aDesiredSize.ScrollableOverflow().XMost();
|
nscoord xmost = aDesiredSize.ScrollableOverflow().XMost();
|
||||||
if (xmost > aDesiredSize.Width()) {
|
if (xmost > aDesiredSize.Width()) {
|
||||||
nscoord widthToFit = xmost + padding.right +
|
nscoord widthToFit = xmost + padding.right +
|
||||||
kidReflowState.mStyleBorder->GetComputedBorderWidth(NS_SIDE_RIGHT);
|
kidReflowInput.mStyleBorder->GetComputedBorderWidth(NS_SIDE_RIGHT);
|
||||||
float ratio = float(maxSize.width) / widthToFit;
|
float ratio = float(maxSize.width) / widthToFit;
|
||||||
NS_ASSERTION(ratio >= 0.0 && ratio < 1.0, "invalid shrink-to-fit ratio");
|
NS_ASSERTION(ratio >= 0.0 && ratio < 1.0, "invalid shrink-to-fit ratio");
|
||||||
mPD->mShrinkToFitRatio = std::min(mPD->mShrinkToFitRatio, ratio);
|
mPD->mShrinkToFitRatio = std::min(mPD->mShrinkToFitRatio, ratio);
|
||||||
@@ -87,7 +87,7 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Place and size the child
|
// Place and size the child
|
||||||
FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowState, 0, 0, 0);
|
FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, 0, 0, 0);
|
||||||
|
|
||||||
NS_ASSERTION(aPresContext->IsDynamic() || !NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
|
NS_ASSERTION(aPresContext->IsDynamic() || !NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
|
||||||
!frame->GetNextInFlow(), "bad child flow list");
|
!frame->GetNextInFlow(), "bad child flow list");
|
||||||
@@ -95,18 +95,18 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Reflow our fixed frames
|
// Reflow our fixed frames
|
||||||
nsReflowStatus fixedStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus fixedStatus = NS_FRAME_COMPLETE;
|
||||||
ReflowAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, fixedStatus);
|
ReflowAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, fixedStatus);
|
||||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(fixedStatus), "fixed frames can be truncated, but not incomplete");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(fixedStatus), "fixed frames can be truncated, but not incomplete");
|
||||||
|
|
||||||
// Return our desired size
|
// Return our desired size
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
aDesiredSize.ISize(wm) = aReflowState.ComputedISize();
|
aDesiredSize.ISize(wm) = aReflowInput.ComputedISize();
|
||||||
if (aReflowState.ComputedBSize() != NS_UNCONSTRAINEDSIZE) {
|
if (aReflowInput.ComputedBSize() != NS_UNCONSTRAINEDSIZE) {
|
||||||
aDesiredSize.BSize(wm) = aReflowState.ComputedBSize();
|
aDesiredSize.BSize(wm) = aReflowInput.ComputedBSize();
|
||||||
}
|
}
|
||||||
FinishAndStoreOverflow(&aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIAtom*
|
nsIAtom*
|
||||||
|
|||||||
@@ -52,12 +52,12 @@ nsPageFrame::~nsPageFrame()
|
|||||||
void
|
void
|
||||||
nsPageFrame::Reflow(nsPresContext* aPresContext,
|
nsPageFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsPageFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsPageFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
||||||
|
|
||||||
NS_ASSERTION(mFrames.FirstChild() &&
|
NS_ASSERTION(mFrames.FirstChild() &&
|
||||||
@@ -94,20 +94,20 @@ nsPageFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReflowInput kidReflowState(aPresContext, aReflowState, frame,
|
ReflowInput kidReflowInput(aPresContext, aReflowInput, frame,
|
||||||
LogicalSize(frame->GetWritingMode(),
|
LogicalSize(frame->GetWritingMode(),
|
||||||
maxSize));
|
maxSize));
|
||||||
kidReflowState.mFlags.mIsTopOfPage = true;
|
kidReflowInput.mFlags.mIsTopOfPage = true;
|
||||||
kidReflowState.mFlags.mTableIsSplittable = true;
|
kidReflowInput.mFlags.mTableIsSplittable = true;
|
||||||
|
|
||||||
// Use the margins given in the @page rule.
|
// Use the margins given in the @page rule.
|
||||||
// If a margin is 'auto', use the margin from the print settings for that side.
|
// If a margin is 'auto', use the margin from the print settings for that side.
|
||||||
const nsStyleSides& marginStyle = kidReflowState.mStyleMargin->mMargin;
|
const nsStyleSides& marginStyle = kidReflowInput.mStyleMargin->mMargin;
|
||||||
NS_FOR_CSS_SIDES(side) {
|
NS_FOR_CSS_SIDES(side) {
|
||||||
if (marginStyle.GetUnit(side) == eStyleUnit_Auto) {
|
if (marginStyle.GetUnit(side) == eStyleUnit_Auto) {
|
||||||
mPageContentMargin.Side(side) = mPD->mReflowMargin.Side(side);
|
mPageContentMargin.Side(side) = mPD->mReflowMargin.Side(side);
|
||||||
} else {
|
} else {
|
||||||
mPageContentMargin.Side(side) = kidReflowState.ComputedPhysicalMargin().Side(side);
|
mPageContentMargin.Side(side) = kidReflowInput.ComputedPhysicalMargin().Side(side);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,40 +133,40 @@ nsPageFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kidReflowState.SetComputedWidth(maxWidth);
|
kidReflowInput.SetComputedWidth(maxWidth);
|
||||||
kidReflowState.SetComputedHeight(maxHeight);
|
kidReflowInput.SetComputedHeight(maxHeight);
|
||||||
|
|
||||||
// calc location of frame
|
// calc location of frame
|
||||||
nscoord xc = mPageContentMargin.left;
|
nscoord xc = mPageContentMargin.left;
|
||||||
nscoord yc = mPageContentMargin.top;
|
nscoord yc = mPageContentMargin.top;
|
||||||
|
|
||||||
// Get the child's desired size
|
// Get the child's desired size
|
||||||
ReflowChild(frame, aPresContext, aDesiredSize, kidReflowState, xc, yc, 0, aStatus);
|
ReflowChild(frame, aPresContext, aDesiredSize, kidReflowInput, xc, yc, 0, aStatus);
|
||||||
|
|
||||||
// Place and size the child
|
// Place and size the child
|
||||||
FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowState, xc, yc, 0);
|
FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, xc, yc, 0);
|
||||||
|
|
||||||
NS_ASSERTION(!NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
|
NS_ASSERTION(!NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
|
||||||
!frame->GetNextInFlow(), "bad child flow list");
|
!frame->GetNextInFlow(), "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(),
|
||||||
aReflowState.AvailableWidth(), aReflowState.AvailableHeight()));
|
aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight()));
|
||||||
|
|
||||||
// Return our desired size
|
// Return our desired size
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
aDesiredSize.ISize(wm) = aReflowState.AvailableISize();
|
aDesiredSize.ISize(wm) = aReflowInput.AvailableISize();
|
||||||
if (aReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE) {
|
if (aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE) {
|
||||||
aDesiredSize.BSize(wm) = aReflowState.AvailableBSize();
|
aDesiredSize.BSize(wm) = aReflowInput.AvailableBSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
FinishAndStoreOverflow(&aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
|
|
||||||
PR_PL(("PageFrame::Reflow %p ", this));
|
PR_PL(("PageFrame::Reflow %p ", this));
|
||||||
PR_PL(("[%d,%d]\n", aReflowState.AvailableWidth(), aReflowState.AvailableHeight()));
|
PR_PL(("[%d,%d]\n", aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight()));
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIAtom*
|
nsIAtom*
|
||||||
@@ -709,18 +709,18 @@ nsPageBreakFrame::GetIntrinsicBSize()
|
|||||||
void
|
void
|
||||||
nsPageBreakFrame::Reflow(nsPresContext* aPresContext,
|
nsPageBreakFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsPageBreakFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsPageBreakFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
// Override reflow, since we don't want to deal with what our
|
// Override reflow, since we don't want to deal with what our
|
||||||
// computed values are.
|
// computed values are.
|
||||||
WritingMode wm = aReflowState.GetWritingMode();
|
WritingMode wm = aReflowInput.GetWritingMode();
|
||||||
LogicalSize finalSize(wm, GetIntrinsicISize(),
|
LogicalSize finalSize(wm, GetIntrinsicISize(),
|
||||||
aReflowState.AvailableBSize() == NS_UNCONSTRAINEDSIZE ?
|
aReflowInput.AvailableBSize() == NS_UNCONSTRAINEDSIZE ?
|
||||||
0 : aReflowState.AvailableBSize());
|
0 : aReflowInput.AvailableBSize());
|
||||||
// round the height down to the nearest pixel
|
// round the height down to the nearest pixel
|
||||||
finalSize.BSize(wm) -=
|
finalSize.BSize(wm) -=
|
||||||
finalSize.BSize(wm) % nsPresContext::CSSPixelsToAppUnits(1);
|
finalSize.BSize(wm) % nsPresContext::CSSPixelsToAppUnits(1);
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class nsPageBreakFrame : public nsLeafFrame
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nsIAtom* GetType() const override;
|
virtual nsIAtom* GetType() const override;
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ nsPlaceholderFrame::AddInlinePrefISize(nsRenderingContext* aRenderingContext,
|
|||||||
void
|
void
|
||||||
nsPlaceholderFrame::Reflow(nsPresContext* aPresContext,
|
nsPlaceholderFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@@ -143,11 +143,11 @@ nsPlaceholderFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsPlaceholderFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsPlaceholderFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
aDesiredSize.ClearSize();
|
aDesiredSize.ClearSize();
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ nsPluginFrame::GetWidgetConfiguration(nsTArray<nsIWidget::Configuration>* aConfi
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsPluginFrame::GetDesiredSize(nsPresContext* aPresContext,
|
nsPluginFrame::GetDesiredSize(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
ReflowOutput& aMetrics)
|
ReflowOutput& aMetrics)
|
||||||
{
|
{
|
||||||
// By default, we have no area
|
// By default, we have no area
|
||||||
@@ -435,21 +435,21 @@ nsPluginFrame::GetDesiredSize(nsPresContext* aPresContext,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
aMetrics.Width() = aReflowState.ComputedWidth();
|
aMetrics.Width() = aReflowInput.ComputedWidth();
|
||||||
aMetrics.Height() = aReflowState.ComputedHeight();
|
aMetrics.Height() = aReflowInput.ComputedHeight();
|
||||||
|
|
||||||
// for EMBED and APPLET, default to 240x200 for compatibility
|
// for EMBED and APPLET, default to 240x200 for compatibility
|
||||||
if (mContent->IsAnyOfHTMLElements(nsGkAtoms::applet,
|
if (mContent->IsAnyOfHTMLElements(nsGkAtoms::applet,
|
||||||
nsGkAtoms::embed)) {
|
nsGkAtoms::embed)) {
|
||||||
if (aMetrics.Width() == NS_UNCONSTRAINEDSIZE) {
|
if (aMetrics.Width() == NS_UNCONSTRAINEDSIZE) {
|
||||||
aMetrics.Width() = clamped(nsPresContext::CSSPixelsToAppUnits(EMBED_DEF_WIDTH),
|
aMetrics.Width() = clamped(nsPresContext::CSSPixelsToAppUnits(EMBED_DEF_WIDTH),
|
||||||
aReflowState.ComputedMinWidth(),
|
aReflowInput.ComputedMinWidth(),
|
||||||
aReflowState.ComputedMaxWidth());
|
aReflowInput.ComputedMaxWidth());
|
||||||
}
|
}
|
||||||
if (aMetrics.Height() == NS_UNCONSTRAINEDSIZE) {
|
if (aMetrics.Height() == NS_UNCONSTRAINEDSIZE) {
|
||||||
aMetrics.Height() = clamped(nsPresContext::CSSPixelsToAppUnits(EMBED_DEF_HEIGHT),
|
aMetrics.Height() = clamped(nsPresContext::CSSPixelsToAppUnits(EMBED_DEF_HEIGHT),
|
||||||
aReflowState.ComputedMinHeight(),
|
aReflowInput.ComputedMinHeight(),
|
||||||
aReflowState.ComputedMaxHeight());
|
aReflowInput.ComputedMaxHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_GTK)
|
#if defined(MOZ_WIDGET_GTK)
|
||||||
@@ -467,8 +467,8 @@ nsPluginFrame::GetDesiredSize(nsPresContext* aPresContext,
|
|||||||
// Make up a number.
|
// Make up a number.
|
||||||
if (aMetrics.Width() == NS_UNCONSTRAINEDSIZE) {
|
if (aMetrics.Width() == NS_UNCONSTRAINEDSIZE) {
|
||||||
aMetrics.Width() =
|
aMetrics.Width() =
|
||||||
(aReflowState.ComputedMinWidth() != NS_UNCONSTRAINEDSIZE) ?
|
(aReflowInput.ComputedMinWidth() != NS_UNCONSTRAINEDSIZE) ?
|
||||||
aReflowState.ComputedMinWidth() : 0;
|
aReflowInput.ComputedMinWidth() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// At this point, the height has an unconstrained value only in two cases:
|
// At this point, the height has an unconstrained value only in two cases:
|
||||||
@@ -477,8 +477,8 @@ nsPluginFrame::GetDesiredSize(nsPresContext* aPresContext,
|
|||||||
// In either case, we have to make up a number.
|
// In either case, we have to make up a number.
|
||||||
if (aMetrics.Height() == NS_UNCONSTRAINEDSIZE) {
|
if (aMetrics.Height() == NS_UNCONSTRAINEDSIZE) {
|
||||||
aMetrics.Height() =
|
aMetrics.Height() =
|
||||||
(aReflowState.ComputedMinHeight() != NS_UNCONSTRAINEDSIZE) ?
|
(aReflowInput.ComputedMinHeight() != NS_UNCONSTRAINEDSIZE) ?
|
||||||
aReflowState.ComputedMinHeight() : 0;
|
aReflowInput.ComputedMinHeight() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXXbz don't add in the border and padding, because we screw up our
|
// XXXbz don't add in the border and padding, because we screw up our
|
||||||
@@ -491,15 +491,15 @@ nsPluginFrame::GetDesiredSize(nsPresContext* aPresContext,
|
|||||||
void
|
void
|
||||||
nsPluginFrame::Reflow(nsPresContext* aPresContext,
|
nsPluginFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsPluginFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsPluginFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
|
||||||
|
|
||||||
// Get our desired size
|
// Get our desired size
|
||||||
GetDesiredSize(aPresContext, aReflowState, aMetrics);
|
GetDesiredSize(aPresContext, aReflowInput, aMetrics);
|
||||||
aMetrics.SetOverflowAreasToDesiredBounds();
|
aMetrics.SetOverflowAreasToDesiredBounds();
|
||||||
FinishAndStoreOverflow(&aMetrics);
|
FinishAndStoreOverflow(&aMetrics);
|
||||||
|
|
||||||
@@ -518,7 +518,7 @@ nsPluginFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsRect r(0, 0, aMetrics.Width(), aMetrics.Height());
|
nsRect r(0, 0, aMetrics.Width(), aMetrics.Height());
|
||||||
r.Deflate(aReflowState.ComputedPhysicalBorderPadding());
|
r.Deflate(aReflowInput.ComputedPhysicalBorderPadding());
|
||||||
|
|
||||||
if (mInnerView) {
|
if (mInnerView) {
|
||||||
nsViewManager* vm = mInnerView->GetViewManager();
|
nsViewManager* vm = mInnerView->GetViewManager();
|
||||||
@@ -534,7 +534,7 @@ nsPluginFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////// nsIReflowCallback ///////////////
|
///////////// nsIReflowCallback ///////////////
|
||||||
@@ -822,7 +822,7 @@ nsPluginFrame::GetWindowOriginInPixels(bool aWindowless)
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsPluginFrame::DidReflow(nsPresContext* aPresContext,
|
nsPluginFrame::DidReflow(nsPresContext* aPresContext,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
nsDidReflowStatus aStatus)
|
nsDidReflowStatus aStatus)
|
||||||
{
|
{
|
||||||
// Do this check before calling the superclass, as that clears
|
// Do this check before calling the superclass, as that clears
|
||||||
@@ -834,7 +834,7 @@ nsPluginFrame::DidReflow(nsPresContext* aPresContext,
|
|||||||
objContent->HasNewFrame(this);
|
objContent->HasNewFrame(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsFrame::DidReflow(aPresContext, aReflowState, aStatus);
|
nsFrame::DidReflow(aPresContext, aReflowInput, aStatus);
|
||||||
|
|
||||||
// The view is created hidden; once we have reflowed it and it has been
|
// The view is created hidden; once we have reflowed it and it has been
|
||||||
// positioned then we show it.
|
// positioned then we show it.
|
||||||
|
|||||||
@@ -74,10 +74,10 @@ public:
|
|||||||
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
|
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
virtual void DidReflow(nsPresContext* aPresContext,
|
virtual void DidReflow(nsPresContext* aPresContext,
|
||||||
const ReflowInput* aReflowState,
|
const ReflowInput* aReflowInput,
|
||||||
nsDidReflowStatus aStatus) override;
|
nsDidReflowStatus aStatus) override;
|
||||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsRect& aDirtyRect,
|
const nsRect& aDirtyRect,
|
||||||
@@ -233,7 +233,7 @@ protected:
|
|||||||
// NOTE: This frame class does not inherit from |nsLeafFrame|, so
|
// NOTE: This frame class does not inherit from |nsLeafFrame|, so
|
||||||
// this is not a virtual method implementation.
|
// this is not a virtual method implementation.
|
||||||
void GetDesiredSize(nsPresContext* aPresContext,
|
void GetDesiredSize(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
ReflowOutput& aDesiredSize);
|
ReflowOutput& aDesiredSize);
|
||||||
|
|
||||||
bool IsFocusable(int32_t *aTabIndex = nullptr,
|
bool IsFocusable(int32_t *aTabIndex = nullptr,
|
||||||
|
|||||||
@@ -293,24 +293,24 @@ struct nsRubyBaseContainerFrame::RubyReflowInput
|
|||||||
bool mAllowInitialLineBreak;
|
bool mAllowInitialLineBreak;
|
||||||
bool mAllowLineBreak;
|
bool mAllowLineBreak;
|
||||||
const AutoRubyTextContainerArray& mTextContainers;
|
const AutoRubyTextContainerArray& mTextContainers;
|
||||||
const ReflowInput& mBaseReflowState;
|
const ReflowInput& mBaseReflowInput;
|
||||||
const nsTArray<UniquePtr<ReflowInput>>& mTextReflowStates;
|
const nsTArray<UniquePtr<ReflowInput>>& mTextReflowInputs;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
|
nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsRubyBaseContainerFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsRubyBaseContainerFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
if (!aReflowState.mLineLayout) {
|
if (!aReflowInput.mLineLayout) {
|
||||||
NS_ASSERTION(
|
NS_ASSERTION(
|
||||||
aReflowState.mLineLayout,
|
aReflowInput.mLineLayout,
|
||||||
"No line layout provided to RubyBaseContainerFrame reflow method.");
|
"No line layout provided to RubyBaseContainerFrame reflow method.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -323,9 +323,9 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
textContainers[i]->MoveOverflowToChildList();
|
textContainers[i]->MoveOverflowToChildList();
|
||||||
}
|
}
|
||||||
|
|
||||||
WritingMode lineWM = aReflowState.mLineLayout->GetWritingMode();
|
WritingMode lineWM = aReflowInput.mLineLayout->GetWritingMode();
|
||||||
LogicalSize availSize(lineWM, aReflowState.AvailableISize(),
|
LogicalSize availSize(lineWM, aReflowInput.AvailableISize(),
|
||||||
aReflowState.AvailableBSize());
|
aReflowInput.AvailableBSize());
|
||||||
|
|
||||||
// We have a reflow state and a line layout for each RTC.
|
// We have a reflow state and a line layout for each RTC.
|
||||||
// They are conceptually the state of the RTCs, but we don't actually
|
// They are conceptually the state of the RTCs, but we don't actually
|
||||||
@@ -334,9 +334,9 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// Since there are pointers refer to reflow states and line layouts,
|
// Since there are pointers refer to reflow states and line layouts,
|
||||||
// it is necessary to guarantee that they won't be moved. For this
|
// it is necessary to guarantee that they won't be moved. For this
|
||||||
// reason, they are wrapped in UniquePtr here.
|
// reason, they are wrapped in UniquePtr here.
|
||||||
AutoTArray<UniquePtr<ReflowInput>, RTC_ARRAY_SIZE> reflowStates;
|
AutoTArray<UniquePtr<ReflowInput>, RTC_ARRAY_SIZE> reflowInputs;
|
||||||
AutoTArray<UniquePtr<nsLineLayout>, RTC_ARRAY_SIZE> lineLayouts;
|
AutoTArray<UniquePtr<nsLineLayout>, RTC_ARRAY_SIZE> lineLayouts;
|
||||||
reflowStates.SetCapacity(rtcCount);
|
reflowInputs.SetCapacity(rtcCount);
|
||||||
lineLayouts.SetCapacity(rtcCount);
|
lineLayouts.SetCapacity(rtcCount);
|
||||||
|
|
||||||
// Begin the line layout for each ruby text container in advance.
|
// Begin the line layout for each ruby text container in advance.
|
||||||
@@ -347,49 +347,49 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
hasSpan = true;
|
hasSpan = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReflowInput* reflowState = new ReflowInput(
|
ReflowInput* reflowInput = new ReflowInput(
|
||||||
aPresContext, *aReflowState.mParentReflowState, textContainer,
|
aPresContext, *aReflowInput.mParentReflowInput, textContainer,
|
||||||
availSize.ConvertTo(textContainer->GetWritingMode(), lineWM));
|
availSize.ConvertTo(textContainer->GetWritingMode(), lineWM));
|
||||||
reflowStates.AppendElement(reflowState);
|
reflowInputs.AppendElement(reflowInput);
|
||||||
nsLineLayout* lineLayout = new nsLineLayout(aPresContext,
|
nsLineLayout* lineLayout = new nsLineLayout(aPresContext,
|
||||||
reflowState->mFloatManager,
|
reflowInput->mFloatManager,
|
||||||
reflowState, nullptr,
|
reflowInput, nullptr,
|
||||||
aReflowState.mLineLayout);
|
aReflowInput.mLineLayout);
|
||||||
lineLayout->SetSuppressLineWrap(true);
|
lineLayout->SetSuppressLineWrap(true);
|
||||||
lineLayouts.AppendElement(lineLayout);
|
lineLayouts.AppendElement(lineLayout);
|
||||||
|
|
||||||
// Line number is useless for ruby text
|
// Line number is useless for ruby text
|
||||||
// XXX nullptr here may cause problem, see comments for
|
// XXX nullptr here may cause problem, see comments for
|
||||||
// nsLineLayout::mBlockRS and nsLineLayout::AddFloat
|
// nsLineLayout::mBlockRS and nsLineLayout::AddFloat
|
||||||
lineLayout->Init(nullptr, reflowState->CalcLineHeight(), -1);
|
lineLayout->Init(nullptr, reflowInput->CalcLineHeight(), -1);
|
||||||
reflowState->mLineLayout = lineLayout;
|
reflowInput->mLineLayout = lineLayout;
|
||||||
|
|
||||||
// Border and padding are suppressed on ruby text containers.
|
// Border and padding are suppressed on ruby text containers.
|
||||||
// If the writing mode is vertical-rl, the horizontal position of
|
// If the writing mode is vertical-rl, the horizontal position of
|
||||||
// rt frames will be updated when reflowing this text container,
|
// rt frames will be updated when reflowing this text container,
|
||||||
// hence leave container size 0 here for now.
|
// hence leave container size 0 here for now.
|
||||||
lineLayout->BeginLineReflow(0, 0, reflowState->ComputedISize(),
|
lineLayout->BeginLineReflow(0, 0, reflowInput->ComputedISize(),
|
||||||
NS_UNCONSTRAINEDSIZE,
|
NS_UNCONSTRAINEDSIZE,
|
||||||
false, false, lineWM, nsSize(0, 0));
|
false, false, lineWM, nsSize(0, 0));
|
||||||
lineLayout->AttachRootFrameToBaseLineLayout();
|
lineLayout->AttachRootFrameToBaseLineLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
aReflowState.mLineLayout->BeginSpan(this, &aReflowState,
|
aReflowInput.mLineLayout->BeginSpan(this, &aReflowInput,
|
||||||
0, aReflowState.AvailableISize(),
|
0, aReflowInput.AvailableISize(),
|
||||||
&mBaseline);
|
&mBaseline);
|
||||||
|
|
||||||
bool allowInitialLineBreak, allowLineBreak;
|
bool allowInitialLineBreak, allowLineBreak;
|
||||||
GetIsLineBreakAllowed(this, aReflowState.mLineLayout->LineIsBreakable(),
|
GetIsLineBreakAllowed(this, aReflowInput.mLineLayout->LineIsBreakable(),
|
||||||
&allowInitialLineBreak, &allowLineBreak);
|
&allowInitialLineBreak, &allowLineBreak);
|
||||||
|
|
||||||
nscoord isize = 0;
|
nscoord isize = 0;
|
||||||
// Reflow columns excluding any span
|
// Reflow columns excluding any span
|
||||||
RubyReflowInput reflowState = {
|
RubyReflowInput reflowInput = {
|
||||||
allowInitialLineBreak, allowLineBreak && !hasSpan,
|
allowInitialLineBreak, allowLineBreak && !hasSpan,
|
||||||
textContainers, aReflowState, reflowStates
|
textContainers, aReflowInput, reflowInputs
|
||||||
};
|
};
|
||||||
isize = ReflowColumns(reflowState, aStatus);
|
isize = ReflowColumns(reflowInput, aStatus);
|
||||||
DebugOnly<nscoord> lineSpanSize = aReflowState.mLineLayout->EndSpan(this);
|
DebugOnly<nscoord> lineSpanSize = aReflowInput.mLineLayout->EndSpan(this);
|
||||||
aDesiredSize.ISize(lineWM) = isize;
|
aDesiredSize.ISize(lineWM) = isize;
|
||||||
// When there are no frames inside the ruby base container, EndSpan
|
// When there are no frames inside the ruby base container, EndSpan
|
||||||
// will return 0. However, in this case, the actual width of the
|
// will return 0. However, in this case, the actual width of the
|
||||||
@@ -405,10 +405,10 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) &&
|
if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) &&
|
||||||
NS_FRAME_IS_COMPLETE(aStatus) && hasSpan) {
|
NS_FRAME_IS_COMPLETE(aStatus) && hasSpan) {
|
||||||
// Reflow spans
|
// Reflow spans
|
||||||
RubyReflowInput reflowState = {
|
RubyReflowInput reflowInput = {
|
||||||
false, false, textContainers, aReflowState, reflowStates
|
false, false, textContainers, aReflowInput, reflowInputs
|
||||||
};
|
};
|
||||||
nscoord spanISize = ReflowSpans(reflowState);
|
nscoord spanISize = ReflowSpans(reflowInput);
|
||||||
isize = std::max(isize, spanISize);
|
isize = std::max(isize, spanISize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,7 +437,7 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// Border and padding are suppressed on ruby base container,
|
// Border and padding are suppressed on ruby base container,
|
||||||
// create a fake borderPadding for setting BSize.
|
// create a fake borderPadding for setting BSize.
|
||||||
WritingMode frameWM = aReflowState.GetWritingMode();
|
WritingMode frameWM = aReflowInput.GetWritingMode();
|
||||||
LogicalMargin borderPadding(frameWM);
|
LogicalMargin borderPadding(frameWM);
|
||||||
nsLayoutUtils::SetBSizeFromFontMetrics(this, aDesiredSize,
|
nsLayoutUtils::SetBSizeFromFontMetrics(this, aDesiredSize,
|
||||||
borderPadding, lineWM, frameWM);
|
borderPadding, lineWM, frameWM);
|
||||||
@@ -459,11 +459,11 @@ struct MOZ_STACK_CLASS nsRubyBaseContainerFrame::PullFrameState
|
|||||||
};
|
};
|
||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
nsRubyBaseContainerFrame::ReflowColumns(const RubyReflowInput& aReflowState,
|
nsRubyBaseContainerFrame::ReflowColumns(const RubyReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsLineLayout* lineLayout = aReflowState.mBaseReflowState.mLineLayout;
|
nsLineLayout* lineLayout = aReflowInput.mBaseReflowInput.mLineLayout;
|
||||||
const uint32_t rtcCount = aReflowState.mTextContainers.Length();
|
const uint32_t rtcCount = aReflowInput.mTextContainers.Length();
|
||||||
nscoord icoord = lineLayout->GetCurrentICoord();
|
nscoord icoord = lineLayout->GetCurrentICoord();
|
||||||
MOZ_ASSERT(icoord == 0, "border/padding of rbc should have been suppressed");
|
MOZ_ASSERT(icoord == 0, "border/padding of rbc should have been suppressed");
|
||||||
nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
|
nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
|
||||||
@@ -472,10 +472,10 @@ nsRubyBaseContainerFrame::ReflowColumns(const RubyReflowInput& aReflowState,
|
|||||||
uint32_t columnIndex = 0;
|
uint32_t columnIndex = 0;
|
||||||
RubyColumn column;
|
RubyColumn column;
|
||||||
column.mTextFrames.SetCapacity(rtcCount);
|
column.mTextFrames.SetCapacity(rtcCount);
|
||||||
RubyColumnEnumerator e(this, aReflowState.mTextContainers);
|
RubyColumnEnumerator e(this, aReflowInput.mTextContainers);
|
||||||
for (; !e.AtEnd(); e.Next()) {
|
for (; !e.AtEnd(); e.Next()) {
|
||||||
e.GetColumn(column);
|
e.GetColumn(column);
|
||||||
icoord += ReflowOneColumn(aReflowState, columnIndex, column, reflowStatus);
|
icoord += ReflowOneColumn(aReflowInput, columnIndex, column, reflowStatus);
|
||||||
if (!NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
|
if (!NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
|
||||||
columnIndex++;
|
columnIndex++;
|
||||||
}
|
}
|
||||||
@@ -487,7 +487,7 @@ nsRubyBaseContainerFrame::ReflowColumns(const RubyReflowInput& aReflowState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isComplete = false;
|
bool isComplete = false;
|
||||||
PullFrameState pullFrameState(this, aReflowState.mTextContainers);
|
PullFrameState pullFrameState(this, aReflowInput.mTextContainers);
|
||||||
while (!NS_INLINE_IS_BREAK(reflowStatus)) {
|
while (!NS_INLINE_IS_BREAK(reflowStatus)) {
|
||||||
// We are not handling overflow here.
|
// We are not handling overflow here.
|
||||||
MOZ_ASSERT(reflowStatus == NS_FRAME_COMPLETE);
|
MOZ_ASSERT(reflowStatus == NS_FRAME_COMPLETE);
|
||||||
@@ -499,7 +499,7 @@ nsRubyBaseContainerFrame::ReflowColumns(const RubyReflowInput& aReflowState,
|
|||||||
// No more frames can be pulled.
|
// No more frames can be pulled.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
icoord += ReflowOneColumn(aReflowState, columnIndex, column, reflowStatus);
|
icoord += ReflowOneColumn(aReflowInput, columnIndex, column, reflowStatus);
|
||||||
if (!NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
|
if (!NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
|
||||||
columnIndex++;
|
columnIndex++;
|
||||||
}
|
}
|
||||||
@@ -517,14 +517,14 @@ nsRubyBaseContainerFrame::ReflowColumns(const RubyReflowInput& aReflowState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
|
if (NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
|
||||||
if (!columnIndex || !aReflowState.mAllowLineBreak) {
|
if (!columnIndex || !aReflowInput.mAllowLineBreak) {
|
||||||
// If no column has been placed yet, or we have any span,
|
// If no column has been placed yet, or we have any span,
|
||||||
// the whole container should be in the next line.
|
// the whole container should be in the next line.
|
||||||
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
aStatus = NS_INLINE_LINE_BREAK_AFTER(aStatus);
|
aStatus = NS_INLINE_LINE_BREAK_AFTER(aStatus);
|
||||||
MOZ_ASSERT(NS_FRAME_IS_COMPLETE(aStatus) || aReflowState.mAllowLineBreak);
|
MOZ_ASSERT(NS_FRAME_IS_COMPLETE(aStatus) || aReflowInput.mAllowLineBreak);
|
||||||
|
|
||||||
// If we are on an intra-level whitespace column, null values in
|
// If we are on an intra-level whitespace column, null values in
|
||||||
// column.mBaseFrame and column.mTextFrames don't represent the
|
// column.mBaseFrame and column.mTextFrames don't represent the
|
||||||
@@ -551,7 +551,7 @@ nsRubyBaseContainerFrame::ReflowColumns(const RubyReflowInput& aReflowState,
|
|||||||
textFrame = nextColumn->mTextFrames[i];
|
textFrame = nextColumn->mTextFrames[i];
|
||||||
}
|
}
|
||||||
if (textFrame) {
|
if (textFrame) {
|
||||||
aReflowState.mTextContainers[i]->PushChildren(
|
aReflowInput.mTextContainers[i]->PushChildren(
|
||||||
textFrame, textFrame->GetPrevSibling());
|
textFrame, textFrame->GetPrevSibling());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -568,31 +568,31 @@ nsRubyBaseContainerFrame::ReflowColumns(const RubyReflowInput& aReflowState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
nsRubyBaseContainerFrame::ReflowOneColumn(const RubyReflowInput& aReflowState,
|
nsRubyBaseContainerFrame::ReflowOneColumn(const RubyReflowInput& aReflowInput,
|
||||||
uint32_t aColumnIndex,
|
uint32_t aColumnIndex,
|
||||||
const RubyColumn& aColumn,
|
const RubyColumn& aColumn,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
const ReflowInput& baseReflowState = aReflowState.mBaseReflowState;
|
const ReflowInput& baseReflowInput = aReflowInput.mBaseReflowInput;
|
||||||
const auto& textReflowStates = aReflowState.mTextReflowStates;
|
const auto& textReflowInputs = aReflowInput.mTextReflowInputs;
|
||||||
nscoord istart = baseReflowState.mLineLayout->GetCurrentICoord();
|
nscoord istart = baseReflowInput.mLineLayout->GetCurrentICoord();
|
||||||
|
|
||||||
if (aColumn.mBaseFrame) {
|
if (aColumn.mBaseFrame) {
|
||||||
bool allowBreakBefore = aColumnIndex ?
|
bool allowBreakBefore = aColumnIndex ?
|
||||||
aReflowState.mAllowLineBreak : aReflowState.mAllowInitialLineBreak;
|
aReflowInput.mAllowLineBreak : aReflowInput.mAllowInitialLineBreak;
|
||||||
if (allowBreakBefore) {
|
if (allowBreakBefore) {
|
||||||
gfxBreakPriority breakPriority = LineBreakBefore(
|
gfxBreakPriority breakPriority = LineBreakBefore(
|
||||||
aColumn.mBaseFrame, baseReflowState.mRenderingContext->GetDrawTarget(),
|
aColumn.mBaseFrame, baseReflowInput.mRenderingContext->GetDrawTarget(),
|
||||||
baseReflowState.mLineLayout->LineContainerFrame(),
|
baseReflowInput.mLineLayout->LineContainerFrame(),
|
||||||
baseReflowState.mLineLayout->GetLine());
|
baseReflowInput.mLineLayout->GetLine());
|
||||||
if (breakPriority != gfxBreakPriority::eNoBreak) {
|
if (breakPriority != gfxBreakPriority::eNoBreak) {
|
||||||
gfxBreakPriority lastBreakPriority =
|
gfxBreakPriority lastBreakPriority =
|
||||||
baseReflowState.mLineLayout->LastOptionalBreakPriority();
|
baseReflowInput.mLineLayout->LastOptionalBreakPriority();
|
||||||
if (breakPriority >= lastBreakPriority) {
|
if (breakPriority >= lastBreakPriority) {
|
||||||
// Either we have been overflow, or we are forced
|
// Either we have been overflow, or we are forced
|
||||||
// to break here, do break before.
|
// to break here, do break before.
|
||||||
if (istart > baseReflowState.AvailableISize() ||
|
if (istart > baseReflowInput.AvailableISize() ||
|
||||||
baseReflowState.mLineLayout->NotifyOptionalBreakPosition(
|
baseReflowInput.mLineLayout->NotifyOptionalBreakPosition(
|
||||||
aColumn.mBaseFrame, 0, true, breakPriority)) {
|
aColumn.mBaseFrame, 0, true, breakPriority)) {
|
||||||
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
|
||||||
return 0;
|
return 0;
|
||||||
@@ -602,9 +602,9 @@ nsRubyBaseContainerFrame::ReflowOneColumn(const RubyReflowInput& aReflowState,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t rtcCount = aReflowState.mTextContainers.Length();
|
const uint32_t rtcCount = aReflowInput.mTextContainers.Length();
|
||||||
MOZ_ASSERT(aColumn.mTextFrames.Length() == rtcCount);
|
MOZ_ASSERT(aColumn.mTextFrames.Length() == rtcCount);
|
||||||
MOZ_ASSERT(textReflowStates.Length() == rtcCount);
|
MOZ_ASSERT(textReflowInputs.Length() == rtcCount);
|
||||||
nscoord columnISize = 0;
|
nscoord columnISize = 0;
|
||||||
|
|
||||||
nsAutoString baseText;
|
nsAutoString baseText;
|
||||||
@@ -633,7 +633,7 @@ nsRubyBaseContainerFrame::ReflowOneColumn(const RubyReflowInput& aReflowState,
|
|||||||
|
|
||||||
bool pushedFrame;
|
bool pushedFrame;
|
||||||
nsReflowStatus reflowStatus;
|
nsReflowStatus reflowStatus;
|
||||||
nsLineLayout* lineLayout = textReflowStates[i]->mLineLayout;
|
nsLineLayout* lineLayout = textReflowInputs[i]->mLineLayout;
|
||||||
nscoord textIStart = lineLayout->GetCurrentICoord();
|
nscoord textIStart = lineLayout->GetCurrentICoord();
|
||||||
lineLayout->ReflowFrame(textFrame, reflowStatus, nullptr, pushedFrame);
|
lineLayout->ReflowFrame(textFrame, reflowStatus, nullptr, pushedFrame);
|
||||||
if (MOZ_UNLIKELY(NS_INLINE_IS_BREAK(reflowStatus) || pushedFrame)) {
|
if (MOZ_UNLIKELY(NS_INLINE_IS_BREAK(reflowStatus) || pushedFrame)) {
|
||||||
@@ -654,7 +654,7 @@ nsRubyBaseContainerFrame::ReflowOneColumn(const RubyReflowInput& aReflowState,
|
|||||||
|
|
||||||
bool pushedFrame;
|
bool pushedFrame;
|
||||||
nsReflowStatus reflowStatus;
|
nsReflowStatus reflowStatus;
|
||||||
nsLineLayout* lineLayout = baseReflowState.mLineLayout;
|
nsLineLayout* lineLayout = baseReflowInput.mLineLayout;
|
||||||
nscoord baseIStart = lineLayout->GetCurrentICoord();
|
nscoord baseIStart = lineLayout->GetCurrentICoord();
|
||||||
lineLayout->ReflowFrame(aColumn.mBaseFrame, reflowStatus,
|
lineLayout->ReflowFrame(aColumn.mBaseFrame, reflowStatus,
|
||||||
nullptr, pushedFrame);
|
nullptr, pushedFrame);
|
||||||
@@ -671,18 +671,18 @@ nsRubyBaseContainerFrame::ReflowOneColumn(const RubyReflowInput& aReflowState,
|
|||||||
|
|
||||||
// Align all the line layout to the new coordinate.
|
// Align all the line layout to the new coordinate.
|
||||||
nscoord icoord = istart + columnISize;
|
nscoord icoord = istart + columnISize;
|
||||||
nscoord deltaISize = icoord - baseReflowState.mLineLayout->GetCurrentICoord();
|
nscoord deltaISize = icoord - baseReflowInput.mLineLayout->GetCurrentICoord();
|
||||||
if (deltaISize > 0) {
|
if (deltaISize > 0) {
|
||||||
baseReflowState.mLineLayout->AdvanceICoord(deltaISize);
|
baseReflowInput.mLineLayout->AdvanceICoord(deltaISize);
|
||||||
if (aColumn.mBaseFrame) {
|
if (aColumn.mBaseFrame) {
|
||||||
RubyUtils::SetReservedISize(aColumn.mBaseFrame, deltaISize);
|
RubyUtils::SetReservedISize(aColumn.mBaseFrame, deltaISize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (uint32_t i = 0; i < rtcCount; i++) {
|
for (uint32_t i = 0; i < rtcCount; i++) {
|
||||||
if (aReflowState.mTextContainers[i]->IsSpanContainer()) {
|
if (aReflowInput.mTextContainers[i]->IsSpanContainer()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
nsLineLayout* lineLayout = textReflowStates[i]->mLineLayout;
|
nsLineLayout* lineLayout = textReflowInputs[i]->mLineLayout;
|
||||||
nsRubyTextFrame* textFrame = aColumn.mTextFrames[i];
|
nsRubyTextFrame* textFrame = aColumn.mTextFrames[i];
|
||||||
nscoord deltaISize = icoord - lineLayout->GetCurrentICoord();
|
nscoord deltaISize = icoord - lineLayout->GetCurrentICoord();
|
||||||
if (deltaISize > 0) {
|
if (deltaISize > 0) {
|
||||||
@@ -808,12 +808,12 @@ nsRubyBaseContainerFrame::PullOneColumn(nsLineLayout* aLineLayout,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
nsRubyBaseContainerFrame::ReflowSpans(const RubyReflowInput& aReflowState)
|
nsRubyBaseContainerFrame::ReflowSpans(const RubyReflowInput& aReflowInput)
|
||||||
{
|
{
|
||||||
nscoord spanISize = 0;
|
nscoord spanISize = 0;
|
||||||
for (uint32_t i = 0, iend = aReflowState.mTextContainers.Length();
|
for (uint32_t i = 0, iend = aReflowInput.mTextContainers.Length();
|
||||||
i < iend; i++) {
|
i < iend; i++) {
|
||||||
nsRubyTextContainerFrame* container = aReflowState.mTextContainers[i];
|
nsRubyTextContainerFrame* container = aReflowInput.mTextContainers[i];
|
||||||
if (!container->IsSpanContainer()) {
|
if (!container->IsSpanContainer()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -821,7 +821,7 @@ nsRubyBaseContainerFrame::ReflowSpans(const RubyReflowInput& aReflowState)
|
|||||||
nsIFrame* rtFrame = container->PrincipalChildList().FirstChild();
|
nsIFrame* rtFrame = container->PrincipalChildList().FirstChild();
|
||||||
nsReflowStatus reflowStatus;
|
nsReflowStatus reflowStatus;
|
||||||
bool pushedFrame;
|
bool pushedFrame;
|
||||||
nsLineLayout* lineLayout = aReflowState.mTextReflowStates[i]->mLineLayout;
|
nsLineLayout* lineLayout = aReflowInput.mTextReflowInputs[i]->mLineLayout;
|
||||||
MOZ_ASSERT(lineLayout->GetCurrentICoord() == 0,
|
MOZ_ASSERT(lineLayout->GetCurrentICoord() == 0,
|
||||||
"border/padding of rtc should have been suppressed");
|
"border/padding of rtc should have been suppressed");
|
||||||
lineLayout->ReflowFrame(rtFrame, reflowStatus, nullptr, pushedFrame);
|
lineLayout->ReflowFrame(rtFrame, reflowStatus, nullptr, pushedFrame);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
ComputeSizeFlags aFlags) override;
|
ComputeSizeFlags aFlags) override;
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual nscoord
|
virtual nscoord
|
||||||
@@ -65,13 +65,13 @@ protected:
|
|||||||
explicit nsRubyBaseContainerFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
|
explicit nsRubyBaseContainerFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
|
||||||
|
|
||||||
struct RubyReflowInput;
|
struct RubyReflowInput;
|
||||||
nscoord ReflowColumns(const RubyReflowInput& aReflowState,
|
nscoord ReflowColumns(const RubyReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
nscoord ReflowOneColumn(const RubyReflowInput& aReflowState,
|
nscoord ReflowOneColumn(const RubyReflowInput& aReflowInput,
|
||||||
uint32_t aColumnIndex,
|
uint32_t aColumnIndex,
|
||||||
const mozilla::RubyColumn& aColumn,
|
const mozilla::RubyColumn& aColumn,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
nscoord ReflowSpans(const RubyReflowInput& aReflowState);
|
nscoord ReflowSpans(const RubyReflowInput& aReflowInput);
|
||||||
|
|
||||||
struct PullFrameState;
|
struct PullFrameState;
|
||||||
|
|
||||||
|
|||||||
@@ -92,15 +92,15 @@ nsRubyFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext,
|
|||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
nsRubyFrame::Reflow(nsPresContext* aPresContext,
|
nsRubyFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsRubyFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsRubyFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
if (!aReflowState.mLineLayout) {
|
if (!aReflowInput.mLineLayout) {
|
||||||
NS_ASSERTION(aReflowState.mLineLayout,
|
NS_ASSERTION(aReflowInput.mLineLayout,
|
||||||
"No line layout provided to RubyFrame reflow method.");
|
"No line layout provided to RubyFrame reflow method.");
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return;
|
return;
|
||||||
@@ -113,25 +113,25 @@ nsRubyFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
mBStartLeading = mBEndLeading = 0;
|
mBStartLeading = mBEndLeading = 0;
|
||||||
|
|
||||||
// Begin the span for the ruby frame
|
// Begin the span for the ruby frame
|
||||||
WritingMode frameWM = aReflowState.GetWritingMode();
|
WritingMode frameWM = aReflowInput.GetWritingMode();
|
||||||
WritingMode lineWM = aReflowState.mLineLayout->GetWritingMode();
|
WritingMode lineWM = aReflowInput.mLineLayout->GetWritingMode();
|
||||||
LogicalMargin borderPadding = aReflowState.ComputedLogicalBorderPadding();
|
LogicalMargin borderPadding = aReflowInput.ComputedLogicalBorderPadding();
|
||||||
nscoord startEdge = 0;
|
nscoord startEdge = 0;
|
||||||
const bool boxDecorationBreakClone =
|
const bool boxDecorationBreakClone =
|
||||||
StyleBorder()->mBoxDecorationBreak == NS_STYLE_BOX_DECORATION_BREAK_CLONE;
|
StyleBorder()->mBoxDecorationBreak == NS_STYLE_BOX_DECORATION_BREAK_CLONE;
|
||||||
if (boxDecorationBreakClone || !GetPrevContinuation()) {
|
if (boxDecorationBreakClone || !GetPrevContinuation()) {
|
||||||
startEdge = borderPadding.IStart(frameWM);
|
startEdge = borderPadding.IStart(frameWM);
|
||||||
}
|
}
|
||||||
NS_ASSERTION(aReflowState.AvailableISize() != NS_UNCONSTRAINEDSIZE,
|
NS_ASSERTION(aReflowInput.AvailableISize() != NS_UNCONSTRAINEDSIZE,
|
||||||
"should no longer use available widths");
|
"should no longer use available widths");
|
||||||
nscoord availableISize = aReflowState.AvailableISize();
|
nscoord availableISize = aReflowInput.AvailableISize();
|
||||||
availableISize -= startEdge + borderPadding.IEnd(frameWM);
|
availableISize -= startEdge + borderPadding.IEnd(frameWM);
|
||||||
aReflowState.mLineLayout->BeginSpan(this, &aReflowState,
|
aReflowInput.mLineLayout->BeginSpan(this, &aReflowInput,
|
||||||
startEdge, availableISize, &mBaseline);
|
startEdge, availableISize, &mBaseline);
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
for (RubySegmentEnumerator e(this); !e.AtEnd(); e.Next()) {
|
for (RubySegmentEnumerator e(this); !e.AtEnd(); e.Next()) {
|
||||||
ReflowSegment(aPresContext, aReflowState, e.GetBaseContainer(), aStatus);
|
ReflowSegment(aPresContext, aReflowInput, e.GetBaseContainer(), aStatus);
|
||||||
|
|
||||||
if (NS_INLINE_IS_BREAK(aStatus)) {
|
if (NS_INLINE_IS_BREAK(aStatus)) {
|
||||||
// A break occurs when reflowing the segment.
|
// A break occurs when reflowing the segment.
|
||||||
@@ -143,17 +143,17 @@ nsRubyFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
ContinuationTraversingState pullState(this);
|
ContinuationTraversingState pullState(this);
|
||||||
while (aStatus == NS_FRAME_COMPLETE) {
|
while (aStatus == NS_FRAME_COMPLETE) {
|
||||||
nsRubyBaseContainerFrame* baseContainer =
|
nsRubyBaseContainerFrame* baseContainer =
|
||||||
PullOneSegment(aReflowState.mLineLayout, pullState);
|
PullOneSegment(aReflowInput.mLineLayout, pullState);
|
||||||
if (!baseContainer) {
|
if (!baseContainer) {
|
||||||
// No more continuations after, finish now.
|
// No more continuations after, finish now.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ReflowSegment(aPresContext, aReflowState, baseContainer, aStatus);
|
ReflowSegment(aPresContext, aReflowInput, baseContainer, aStatus);
|
||||||
}
|
}
|
||||||
// We never handle overflow in ruby.
|
// We never handle overflow in ruby.
|
||||||
MOZ_ASSERT(!NS_FRAME_OVERFLOW_IS_INCOMPLETE(aStatus));
|
MOZ_ASSERT(!NS_FRAME_OVERFLOW_IS_INCOMPLETE(aStatus));
|
||||||
|
|
||||||
aDesiredSize.ISize(lineWM) = aReflowState.mLineLayout->EndSpan(this);
|
aDesiredSize.ISize(lineWM) = aReflowInput.mLineLayout->EndSpan(this);
|
||||||
if (boxDecorationBreakClone || !GetPrevContinuation()) {
|
if (boxDecorationBreakClone || !GetPrevContinuation()) {
|
||||||
aDesiredSize.ISize(lineWM) += borderPadding.IStart(frameWM);
|
aDesiredSize.ISize(lineWM) += borderPadding.IStart(frameWM);
|
||||||
}
|
}
|
||||||
@@ -167,13 +167,13 @@ nsRubyFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsRubyBaseContainerFrame* aBaseContainer,
|
nsRubyBaseContainerFrame* aBaseContainer,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
WritingMode lineWM = aReflowState.mLineLayout->GetWritingMode();
|
WritingMode lineWM = aReflowInput.mLineLayout->GetWritingMode();
|
||||||
LogicalSize availSize(lineWM, aReflowState.AvailableISize(),
|
LogicalSize availSize(lineWM, aReflowInput.AvailableISize(),
|
||||||
aReflowState.AvailableBSize());
|
aReflowInput.AvailableBSize());
|
||||||
WritingMode rubyWM = GetWritingMode();
|
WritingMode rubyWM = GetWritingMode();
|
||||||
NS_ASSERTION(!rubyWM.IsOrthogonalTo(lineWM),
|
NS_ASSERTION(!rubyWM.IsOrthogonalTo(lineWM),
|
||||||
"Ruby frame writing-mode shouldn't be orthogonal to its line");
|
"Ruby frame writing-mode shouldn't be orthogonal to its line");
|
||||||
@@ -181,9 +181,9 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
|||||||
AutoRubyTextContainerArray textContainers(aBaseContainer);
|
AutoRubyTextContainerArray textContainers(aBaseContainer);
|
||||||
const uint32_t rtcCount = textContainers.Length();
|
const uint32_t rtcCount = textContainers.Length();
|
||||||
|
|
||||||
ReflowOutput baseMetrics(aReflowState);
|
ReflowOutput baseMetrics(aReflowInput);
|
||||||
bool pushedFrame;
|
bool pushedFrame;
|
||||||
aReflowState.mLineLayout->ReflowFrame(aBaseContainer, aStatus,
|
aReflowInput.mLineLayout->ReflowFrame(aBaseContainer, aStatus,
|
||||||
&baseMetrics, pushedFrame);
|
&baseMetrics, pushedFrame);
|
||||||
|
|
||||||
if (NS_INLINE_IS_BREAK_BEFORE(aStatus)) {
|
if (NS_INLINE_IS_BREAK_BEFORE(aStatus)) {
|
||||||
@@ -192,7 +192,7 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
|||||||
// a break-before for the ruby container.
|
// a break-before for the ruby container.
|
||||||
aStatus = NS_INLINE_LINE_BREAK_AFTER(NS_FRAME_NOT_COMPLETE);
|
aStatus = NS_INLINE_LINE_BREAK_AFTER(NS_FRAME_NOT_COMPLETE);
|
||||||
PushChildren(aBaseContainer, aBaseContainer->GetPrevSibling());
|
PushChildren(aBaseContainer, aBaseContainer->GetPrevSibling());
|
||||||
aReflowState.mLineLayout->SetDirtyNextLine();
|
aReflowInput.mLineLayout->SetDirtyNextLine();
|
||||||
}
|
}
|
||||||
// This base container is not placed at all, we can skip all
|
// This base container is not placed at all, we can skip all
|
||||||
// text containers paired with it.
|
// text containers paired with it.
|
||||||
@@ -238,7 +238,7 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
|||||||
// It is possible that we pulled it back before our next-in-flow
|
// It is possible that we pulled it back before our next-in-flow
|
||||||
// drain our overflow.
|
// drain our overflow.
|
||||||
PushChildren(lastChild->GetNextSibling(), lastChild);
|
PushChildren(lastChild->GetNextSibling(), lastChild);
|
||||||
aReflowState.mLineLayout->SetDirtyNextLine();
|
aReflowInput.mLineLayout->SetDirtyNextLine();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If the ruby base container is reflowed completely, the line
|
// If the ruby base container is reflowed completely, the line
|
||||||
@@ -271,16 +271,16 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
|||||||
nsRubyTextContainerFrame* textContainer = textContainers[i];
|
nsRubyTextContainerFrame* textContainer = textContainers[i];
|
||||||
WritingMode rtcWM = textContainer->GetWritingMode();
|
WritingMode rtcWM = textContainer->GetWritingMode();
|
||||||
nsReflowStatus textReflowStatus;
|
nsReflowStatus textReflowStatus;
|
||||||
ReflowOutput textMetrics(aReflowState);
|
ReflowOutput textMetrics(aReflowInput);
|
||||||
ReflowInput textReflowState(aPresContext, aReflowState, textContainer,
|
ReflowInput textReflowInput(aPresContext, aReflowInput, textContainer,
|
||||||
availSize.ConvertTo(rtcWM, lineWM));
|
availSize.ConvertTo(rtcWM, lineWM));
|
||||||
// FIXME We probably shouldn't be using the same nsLineLayout for
|
// FIXME We probably shouldn't be using the same nsLineLayout for
|
||||||
// the text containers. But it should be fine now as we are
|
// the text containers. But it should be fine now as we are
|
||||||
// not actually using this line layout to reflow something,
|
// not actually using this line layout to reflow something,
|
||||||
// but just read the writing mode from it.
|
// but just read the writing mode from it.
|
||||||
textReflowState.mLineLayout = aReflowState.mLineLayout;
|
textReflowInput.mLineLayout = aReflowInput.mLineLayout;
|
||||||
textContainer->Reflow(aPresContext, textMetrics,
|
textContainer->Reflow(aPresContext, textMetrics,
|
||||||
textReflowState, textReflowStatus);
|
textReflowInput, textReflowStatus);
|
||||||
// Ruby text containers always return NS_FRAME_COMPLETE even when
|
// Ruby text containers always return NS_FRAME_COMPLETE even when
|
||||||
// they have continuations, because the breaking has already been
|
// they have continuations, because the breaking has already been
|
||||||
// handled when reflowing the base containers.
|
// handled when reflowing the base containers.
|
||||||
@@ -325,7 +325,7 @@ 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,
|
||||||
&textReflowState, lineWM, position, dummyContainerSize, 0);
|
&textReflowInput, lineWM, position, dummyContainerSize, 0);
|
||||||
}
|
}
|
||||||
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");
|
||||||
@@ -335,7 +335,7 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
|||||||
RubyUtils::ClearReservedISize(aBaseContainer);
|
RubyUtils::ClearReservedISize(aBaseContainer);
|
||||||
} else {
|
} else {
|
||||||
RubyUtils::SetReservedISize(aBaseContainer, deltaISize);
|
RubyUtils::SetReservedISize(aBaseContainer, deltaISize);
|
||||||
aReflowState.mLineLayout->AdvanceICoord(deltaISize);
|
aReflowInput.mLineLayout->AdvanceICoord(deltaISize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set block leadings of the base container
|
// Set block leadings of the base container
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public:
|
|||||||
InlinePrefISizeData *aData) override;
|
InlinePrefISizeData *aData) override;
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
@@ -56,7 +56,7 @@ protected:
|
|||||||
: nsInlineFrame(aContext) {}
|
: nsInlineFrame(aContext) {}
|
||||||
|
|
||||||
void ReflowSegment(nsPresContext* aPresContext,
|
void ReflowSegment(nsPresContext* aPresContext,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsRubyBaseContainerFrame* aBaseContainer,
|
nsRubyBaseContainerFrame* aBaseContainer,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
|
|||||||
@@ -122,19 +122,19 @@ nsRubyTextContainerFrame::UpdateSpanFlag()
|
|||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
nsRubyTextContainerFrame::Reflow(nsPresContext* aPresContext,
|
nsRubyTextContainerFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsRubyTextContainerFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsRubyTextContainerFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
|
|
||||||
// Although a ruby text container may have continuations, returning
|
// Although a ruby text container may have continuations, returning
|
||||||
// NS_FRAME_COMPLETE here is still safe, since its parent, ruby frame,
|
// NS_FRAME_COMPLETE here is still safe, since its parent, ruby frame,
|
||||||
// ignores the status, and continuations of the ruby base container
|
// ignores the status, and continuations of the ruby base container
|
||||||
// will take care of our continuations.
|
// will take care of our continuations.
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
WritingMode lineWM = aReflowState.mLineLayout->GetWritingMode();
|
WritingMode lineWM = aReflowInput.mLineLayout->GetWritingMode();
|
||||||
|
|
||||||
nscoord minBCoord = nscoord_MAX;
|
nscoord minBCoord = nscoord_MAX;
|
||||||
nscoord maxBCoord = nscoord_MIN;
|
nscoord maxBCoord = nscoord_MIN;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public:
|
|||||||
virtual bool IsFrameOfType(uint32_t aFlags) const override;
|
virtual bool IsFrameOfType(uint32_t aFlags) const override;
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ nsRubyTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
nsRubyTextFrame::Reflow(nsPresContext* aPresContext,
|
nsRubyTextFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// Even if we want to hide this frame, we have to reflow it first.
|
// Even if we want to hide this frame, we have to reflow it first.
|
||||||
@@ -85,12 +85,12 @@ nsRubyTextFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// the content is no longer the same, until next reflow triggered by
|
// the content is no longer the same, until next reflow triggered by
|
||||||
// some other change. In general, we always reflow all the frames we
|
// some other change. In general, we always reflow all the frames we
|
||||||
// created. There might be other problems if we don't do that.
|
// created. There might be other problems if we don't do that.
|
||||||
nsRubyContentFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
nsRubyContentFrame::Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
|
||||||
|
|
||||||
if (IsAutoHidden()) {
|
if (IsAutoHidden()) {
|
||||||
// Reset the ISize. The BSize is not changed so that it won't
|
// Reset the ISize. The BSize is not changed so that it won't
|
||||||
// affect vertical positioning in unexpected way.
|
// affect vertical positioning in unexpected way.
|
||||||
WritingMode lineWM = aReflowState.mLineLayout->GetWritingMode();
|
WritingMode lineWM = aReflowInput.mLineLayout->GetWritingMode();
|
||||||
aDesiredSize.ISize(lineWM) = 0;
|
aDesiredSize.ISize(lineWM) = 0;
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
bool IsAutoHidden() const
|
bool IsAutoHidden() const
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
|
|||||||
|
|
||||||
void
|
void
|
||||||
nsSimplePageSequenceFrame::SetDesiredSize(ReflowOutput& aDesiredSize,
|
nsSimplePageSequenceFrame::SetDesiredSize(ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nscoord aWidth,
|
nscoord aWidth,
|
||||||
nscoord aHeight)
|
nscoord aHeight)
|
||||||
{
|
{
|
||||||
@@ -99,9 +99,9 @@ nsSimplePageSequenceFrame::SetDesiredSize(ReflowOutput& aDesiredSize,
|
|||||||
// can act as a background in print preview but also handle overflow
|
// can act as a background in print preview but also handle overflow
|
||||||
// in child page frames correctly.
|
// in child page frames correctly.
|
||||||
// Use availableWidth so we don't cause a needless horizontal scrollbar.
|
// Use availableWidth so we don't cause a needless horizontal scrollbar.
|
||||||
aDesiredSize.Width() = std::max(aReflowState.AvailableWidth(),
|
aDesiredSize.Width() = std::max(aReflowInput.AvailableWidth(),
|
||||||
nscoord(aWidth * PresContext()->GetPrintPreviewScale()));
|
nscoord(aWidth * PresContext()->GetPrintPreviewScale()));
|
||||||
aDesiredSize.Height() = std::max(aReflowState.ComputedHeight(),
|
aDesiredSize.Height() = std::max(aReflowInput.ComputedHeight(),
|
||||||
nscoord(aHeight * PresContext()->GetPrintPreviewScale()));
|
nscoord(aHeight * PresContext()->GetPrintPreviewScale()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,14 +145,14 @@ nsSimplePageSequenceFrame::ComputeCenteringMargin(
|
|||||||
void
|
void
|
||||||
nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
NS_PRECONDITION(aPresContext->IsRootPaginatedDocument(),
|
NS_PRECONDITION(aPresContext->IsRootPaginatedDocument(),
|
||||||
"A Page Sequence is only for real pages");
|
"A Page Sequence is only for real pages");
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsSimplePageSequenceFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsSimplePageSequenceFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
NS_FRAME_TRACE_REFLOW_IN("nsSimplePageSequenceFrame::Reflow");
|
NS_FRAME_TRACE_REFLOW_IN("nsSimplePageSequenceFrame::Reflow");
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE; // we're always complete
|
aStatus = NS_FRAME_COMPLETE; // we're always complete
|
||||||
@@ -161,7 +161,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// it right in paginated mode.
|
// it right in paginated mode.
|
||||||
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||||
// Return our desired size
|
// Return our desired size
|
||||||
SetDesiredSize(aDesiredSize, aReflowState, mSize.width, mSize.height);
|
SetDesiredSize(aDesiredSize, aReflowInput, mSize.width, mSize.height);
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
FinishAndStoreOverflow(&aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nsIFrame* child = e.get();
|
nsIFrame* child = e.get();
|
||||||
nsMargin pageCSSMargin = child->GetUsedMargin();
|
nsMargin pageCSSMargin = child->GetUsedMargin();
|
||||||
nscoord centeringMargin =
|
nscoord centeringMargin =
|
||||||
ComputeCenteringMargin(aReflowState.ComputedWidth(),
|
ComputeCenteringMargin(aReflowInput.ComputedWidth(),
|
||||||
child->GetRect().width,
|
child->GetRect().width,
|
||||||
pageCSSMargin);
|
pageCSSMargin);
|
||||||
nscoord newX = pageCSSMargin.left + centeringMargin;
|
nscoord newX = pageCSSMargin.left + centeringMargin;
|
||||||
@@ -242,7 +242,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
nscoord maxXMost = 0;
|
nscoord maxXMost = 0;
|
||||||
|
|
||||||
// Tile the pages vertically
|
// Tile the pages vertically
|
||||||
ReflowOutput kidSize(aReflowState);
|
ReflowOutput kidSize(aReflowInput);
|
||||||
for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
|
for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
|
||||||
nsIFrame* kidFrame = e.get();
|
nsIFrame* kidFrame = e.get();
|
||||||
// Set the shared data into the page frame before reflow
|
// Set the shared data into the page frame before reflow
|
||||||
@@ -250,25 +250,25 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
pf->SetSharedPageData(mPageData);
|
pf->SetSharedPageData(mPageData);
|
||||||
|
|
||||||
// Reflow the page
|
// Reflow the page
|
||||||
ReflowInput kidReflowState(aPresContext, aReflowState, kidFrame,
|
ReflowInput kidReflowInput(aPresContext, aReflowInput, kidFrame,
|
||||||
LogicalSize(kidFrame->GetWritingMode(),
|
LogicalSize(kidFrame->GetWritingMode(),
|
||||||
pageSize));
|
pageSize));
|
||||||
nsReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
kidReflowState.SetComputedWidth(kidReflowState.AvailableWidth());
|
kidReflowInput.SetComputedWidth(kidReflowInput.AvailableWidth());
|
||||||
//kidReflowState.SetComputedHeight(kidReflowState.AvailableHeight());
|
//kidReflowInput.SetComputedHeight(kidReflowInput.AvailableHeight());
|
||||||
PR_PL(("AV W: %d H: %d\n", kidReflowState.AvailableWidth(), kidReflowState.AvailableHeight()));
|
PR_PL(("AV W: %d H: %d\n", kidReflowInput.AvailableWidth(), kidReflowInput.AvailableHeight()));
|
||||||
|
|
||||||
nsMargin pageCSSMargin = kidReflowState.ComputedPhysicalMargin();
|
nsMargin pageCSSMargin = kidReflowInput.ComputedPhysicalMargin();
|
||||||
y += pageCSSMargin.top;
|
y += pageCSSMargin.top;
|
||||||
|
|
||||||
nscoord x = pageCSSMargin.left;
|
nscoord x = pageCSSMargin.left;
|
||||||
|
|
||||||
// Place and size the page.
|
// Place and size the page.
|
||||||
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState, x, y, 0, status);
|
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, x, y, 0, 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(aReflowState.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, 0);
|
||||||
@@ -330,7 +330,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// Return our desired size
|
// Return our desired size
|
||||||
// Adjust the reflow size by PrintPreviewScale so the scrollbars end up the
|
// Adjust the reflow size by PrintPreviewScale so the scrollbars end up the
|
||||||
// correct size
|
// correct size
|
||||||
SetDesiredSize(aDesiredSize, aReflowState, maxXMost, y);
|
SetDesiredSize(aDesiredSize, aReflowInput, maxXMost, y);
|
||||||
|
|
||||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||||
FinishAndStoreOverflow(&aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
@@ -341,7 +341,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
mSize.height = y;
|
mSize.height = y;
|
||||||
|
|
||||||
NS_FRAME_TRACE_REFLOW_OUT("nsSimplePageSequeceFrame::Reflow", aStatus);
|
NS_FRAME_TRACE_REFLOW_OUT("nsSimplePageSequeceFrame::Reflow", aStatus);
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ protected:
|
|||||||
// Sets the frame desired size to the size of the viewport, or the given
|
// Sets the frame desired size to the size of the viewport, or the given
|
||||||
// nscoords, whichever is larger. Print scaling is applied in this function.
|
// nscoords, whichever is larger. Print scaling is applied in this function.
|
||||||
void SetDesiredSize(ReflowOutput& aDesiredSize,
|
void SetDesiredSize(ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nscoord aWidth, nscoord aHeight);
|
nscoord aWidth, nscoord aHeight);
|
||||||
|
|
||||||
// Helper function to compute the offset needed to center a child
|
// Helper function to compute the offset needed to center a child
|
||||||
|
|||||||
@@ -217,10 +217,10 @@ nsSplittableFrame::GetConsumedBSize() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
nscoord
|
nscoord
|
||||||
nsSplittableFrame::GetEffectiveComputedBSize(const ReflowInput& aReflowState,
|
nsSplittableFrame::GetEffectiveComputedBSize(const ReflowInput& aReflowInput,
|
||||||
nscoord aConsumedBSize) const
|
nscoord aConsumedBSize) const
|
||||||
{
|
{
|
||||||
nscoord bSize = aReflowState.ComputedBSize();
|
nscoord bSize = aReflowInput.ComputedBSize();
|
||||||
if (bSize == NS_INTRINSICSIZE) {
|
if (bSize == NS_INTRINSICSIZE) {
|
||||||
return NS_INTRINSICSIZE;
|
return NS_INTRINSICSIZE;
|
||||||
}
|
}
|
||||||
@@ -236,7 +236,7 @@ nsSplittableFrame::GetEffectiveComputedBSize(const ReflowInput& aReflowState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
nsIFrame::LogicalSides
|
||||||
nsSplittableFrame::GetLogicalSkipSides(const ReflowInput* aReflowState) const
|
nsSplittableFrame::GetLogicalSkipSides(const ReflowInput* aReflowInput) const
|
||||||
{
|
{
|
||||||
if (IS_TRUE_OVERFLOW_CONTAINER(this)) {
|
if (IS_TRUE_OVERFLOW_CONTAINER(this)) {
|
||||||
return LogicalSides(eLogicalSideBitsBBoth);
|
return LogicalSides(eLogicalSideBitsBBoth);
|
||||||
@@ -252,16 +252,16 @@ nsSplittableFrame::GetLogicalSkipSides(const ReflowInput* aReflowState) const
|
|||||||
skip |= eLogicalSideBitsBStart;
|
skip |= eLogicalSideBitsBStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aReflowState) {
|
if (aReflowInput) {
|
||||||
// We're in the midst of reflow right now, so it's possible that we haven't
|
// We're in the midst of reflow right now, so it's possible that we haven't
|
||||||
// created a nif yet. If our content height is going to exceed our available
|
// created a nif yet. If our content height is going to exceed our available
|
||||||
// height, though, then we're going to need a next-in-flow, it just hasn't
|
// height, though, then we're going to need a next-in-flow, it just hasn't
|
||||||
// been created yet.
|
// been created yet.
|
||||||
|
|
||||||
if (NS_UNCONSTRAINEDSIZE != aReflowState->AvailableBSize()) {
|
if (NS_UNCONSTRAINEDSIZE != aReflowInput->AvailableBSize()) {
|
||||||
nscoord effectiveCH = this->GetEffectiveComputedBSize(*aReflowState);
|
nscoord effectiveCH = this->GetEffectiveComputedBSize(*aReflowInput);
|
||||||
if (effectiveCH != NS_INTRINSICSIZE &&
|
if (effectiveCH != NS_INTRINSICSIZE &&
|
||||||
effectiveCH > aReflowState->AvailableBSize()) {
|
effectiveCH > aReflowInput->AvailableBSize()) {
|
||||||
// Our content height is going to exceed our available height, so we're
|
// Our content height is going to exceed our available height, so we're
|
||||||
// going to need a next-in-flow.
|
// going to need a next-in-flow.
|
||||||
skip |= eLogicalSideBitsBEnd;
|
skip |= eLogicalSideBitsBEnd;
|
||||||
|
|||||||
@@ -89,13 +89,13 @@ protected:
|
|||||||
* Retrieve the effective computed block size of this frame, which is the
|
* Retrieve the effective computed block size of this frame, which is the
|
||||||
* computed block size, minus the block size consumed by any previous in-flows.
|
* computed block size, minus the block size consumed by any previous in-flows.
|
||||||
*/
|
*/
|
||||||
nscoord GetEffectiveComputedBSize(const ReflowInput& aReflowState,
|
nscoord GetEffectiveComputedBSize(const ReflowInput& aReflowInput,
|
||||||
nscoord aConsumed = NS_INTRINSICSIZE) const;
|
nscoord aConsumed = NS_INTRINSICSIZE) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see nsIFrame::GetLogicalSkipSides()
|
* @see nsIFrame::GetLogicalSkipSides()
|
||||||
*/
|
*/
|
||||||
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowState = nullptr) const override;
|
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowInput = nullptr) const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A faster version of GetLogicalSkipSides() that is intended to be used
|
* A faster version of GetLogicalSkipSides() that is intended to be used
|
||||||
|
|||||||
@@ -760,20 +760,20 @@ nsSubDocumentFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
|||||||
void
|
void
|
||||||
nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
|
nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsSubDocumentFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsSubDocumentFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("enter nsSubDocumentFrame::Reflow: maxSize=%d,%d",
|
("enter nsSubDocumentFrame::Reflow: maxSize=%d,%d",
|
||||||
aReflowState.AvailableWidth(), aReflowState.AvailableHeight()));
|
aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight()));
|
||||||
|
|
||||||
NS_ASSERTION(aReflowState.ComputedWidth() != NS_UNCONSTRAINEDSIZE,
|
NS_ASSERTION(aReflowInput.ComputedWidth() != NS_UNCONSTRAINEDSIZE,
|
||||||
"Shouldn't have unconstrained stuff here "
|
"Shouldn't have unconstrained stuff here "
|
||||||
"thanks to the rules of reflow");
|
"thanks to the rules of reflow");
|
||||||
NS_ASSERTION(NS_INTRINSICSIZE != aReflowState.ComputedHeight(),
|
NS_ASSERTION(NS_INTRINSICSIZE != aReflowInput.ComputedHeight(),
|
||||||
"Shouldn't have unconstrained stuff here "
|
"Shouldn't have unconstrained stuff here "
|
||||||
"thanks to ComputeAutoSize");
|
"thanks to ComputeAutoSize");
|
||||||
|
|
||||||
@@ -783,16 +783,16 @@ nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
"Shouldn't happen");
|
"Shouldn't happen");
|
||||||
|
|
||||||
// XUL <iframe> or <browser>, or HTML <iframe>, <object> or <embed>
|
// XUL <iframe> or <browser>, or HTML <iframe>, <object> or <embed>
|
||||||
aDesiredSize.SetSize(aReflowState.GetWritingMode(),
|
aDesiredSize.SetSize(aReflowInput.GetWritingMode(),
|
||||||
aReflowState.ComputedSizeWithBorderPadding());
|
aReflowInput.ComputedSizeWithBorderPadding());
|
||||||
|
|
||||||
// "offset" is the offset of our content area from our frame's
|
// "offset" is the offset of our content area from our frame's
|
||||||
// top-left corner.
|
// top-left corner.
|
||||||
nsPoint offset = nsPoint(aReflowState.ComputedPhysicalBorderPadding().left,
|
nsPoint offset = nsPoint(aReflowInput.ComputedPhysicalBorderPadding().left,
|
||||||
aReflowState.ComputedPhysicalBorderPadding().top);
|
aReflowInput.ComputedPhysicalBorderPadding().top);
|
||||||
|
|
||||||
if (mInnerView) {
|
if (mInnerView) {
|
||||||
const nsMargin& bp = aReflowState.ComputedPhysicalBorderPadding();
|
const nsMargin& bp = aReflowInput.ComputedPhysicalBorderPadding();
|
||||||
nsSize innerSize(aDesiredSize.Width() - bp.LeftRight(),
|
nsSize innerSize(aDesiredSize.Width() - bp.LeftRight(),
|
||||||
aDesiredSize.Height() - bp.TopBottom());
|
aDesiredSize.Height() - bp.TopBottom());
|
||||||
|
|
||||||
@@ -833,7 +833,7 @@ nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
("exit nsSubDocumentFrame::Reflow: size=%d,%d status=%x",
|
("exit nsSubDocumentFrame::Reflow: size=%d,%d status=%x",
|
||||||
aDesiredSize.Width(), aDesiredSize.Height(), aStatus));
|
aDesiredSize.Width(), aDesiredSize.Height(), aStatus));
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
|
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aDesiredSize,
|
ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
|
|||||||
@@ -8650,26 +8650,26 @@ struct NewlineProperty {
|
|||||||
void
|
void
|
||||||
nsTextFrame::Reflow(nsPresContext* aPresContext,
|
nsTextFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsTextFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsTextFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
|
||||||
|
|
||||||
// XXX If there's no line layout, we shouldn't even have created this
|
// XXX If there's no line layout, we shouldn't even have created this
|
||||||
// frame. This may happen if, for example, this is text inside a table
|
// frame. This may happen if, for example, this is text inside a table
|
||||||
// but not inside a cell. For now, just don't reflow.
|
// but not inside a cell. For now, just don't reflow.
|
||||||
if (!aReflowState.mLineLayout) {
|
if (!aReflowInput.mLineLayout) {
|
||||||
ClearMetrics(aMetrics);
|
ClearMetrics(aMetrics);
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReflowText(*aReflowState.mLineLayout, aReflowState.AvailableWidth(),
|
ReflowText(*aReflowInput.mLineLayout, aReflowInput.AvailableWidth(),
|
||||||
aReflowState.mRenderingContext->GetDrawTarget(), aMetrics, aStatus);
|
aReflowInput.mRenderingContext->GetDrawTarget(), aMetrics, aStatus);
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ACCESSIBILITY
|
#ifdef ACCESSIBILITY
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ public:
|
|||||||
nscoord* aXMost) override;
|
nscoord* aXMost) override;
|
||||||
virtual void Reflow(nsPresContext* aPresContext,
|
virtual void Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
virtual bool CanContinueTextRun() const override;
|
virtual bool CanContinueTextRun() const override;
|
||||||
// Method that is called for a text frame that is logically
|
// Method that is called for a text frame that is logically
|
||||||
|
|||||||
@@ -283,25 +283,25 @@ public:
|
|||||||
void
|
void
|
||||||
nsVideoFrame::Reflow(nsPresContext* aPresContext,
|
nsVideoFrame::Reflow(nsPresContext* aPresContext,
|
||||||
ReflowOutput& aMetrics,
|
ReflowOutput& aMetrics,
|
||||||
const ReflowInput& aReflowState,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
MarkInReflow();
|
MarkInReflow();
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsVideoFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsVideoFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
|
||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("enter nsVideoFrame::Reflow: availSize=%d,%d",
|
("enter nsVideoFrame::Reflow: availSize=%d,%d",
|
||||||
aReflowState.AvailableWidth(), aReflowState.AvailableHeight()));
|
aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight()));
|
||||||
|
|
||||||
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
|
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
aMetrics.Width() = aReflowState.ComputedWidth();
|
aMetrics.Width() = aReflowInput.ComputedWidth();
|
||||||
aMetrics.Height() = aReflowState.ComputedHeight();
|
aMetrics.Height() = aReflowInput.ComputedHeight();
|
||||||
|
|
||||||
// stash this away so we can compute our inner area later
|
// stash this away so we can compute our inner area later
|
||||||
mBorderPadding = aReflowState.ComputedPhysicalBorderPadding();
|
mBorderPadding = aReflowInput.ComputedPhysicalBorderPadding();
|
||||||
|
|
||||||
aMetrics.Width() += mBorderPadding.left + mBorderPadding.right;
|
aMetrics.Width() += mBorderPadding.left + mBorderPadding.right;
|
||||||
aMetrics.Height() += mBorderPadding.top + mBorderPadding.bottom;
|
aMetrics.Height() += mBorderPadding.top + mBorderPadding.bottom;
|
||||||
@@ -312,13 +312,13 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
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);
|
||||||
ReflowOutput kidDesiredSize(aReflowState);
|
ReflowOutput kidDesiredSize(aReflowInput);
|
||||||
WritingMode wm = imageFrame->GetWritingMode();
|
WritingMode wm = imageFrame->GetWritingMode();
|
||||||
LogicalSize availableSize = aReflowState.AvailableSize(wm);
|
LogicalSize availableSize = aReflowInput.AvailableSize(wm);
|
||||||
LogicalSize cbSize = aMetrics.Size(aMetrics.GetWritingMode()).
|
LogicalSize cbSize = aMetrics.Size(aMetrics.GetWritingMode()).
|
||||||
ConvertTo(wm, aMetrics.GetWritingMode());
|
ConvertTo(wm, aMetrics.GetWritingMode());
|
||||||
ReflowInput kidReflowState(aPresContext,
|
ReflowInput kidReflowInput(aPresContext,
|
||||||
aReflowState,
|
aReflowInput,
|
||||||
imageFrame,
|
imageFrame,
|
||||||
availableSize,
|
availableSize,
|
||||||
&cbSize);
|
&cbSize);
|
||||||
@@ -327,53 +327,53 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
if (ShouldDisplayPoster()) {
|
if (ShouldDisplayPoster()) {
|
||||||
posterRenderRect =
|
posterRenderRect =
|
||||||
nsRect(nsPoint(mBorderPadding.left, mBorderPadding.top),
|
nsRect(nsPoint(mBorderPadding.left, mBorderPadding.top),
|
||||||
nsSize(aReflowState.ComputedWidth(),
|
nsSize(aReflowInput.ComputedWidth(),
|
||||||
aReflowState.ComputedHeight()));
|
aReflowInput.ComputedHeight()));
|
||||||
}
|
}
|
||||||
kidReflowState.SetComputedWidth(posterRenderRect.width);
|
kidReflowInput.SetComputedWidth(posterRenderRect.width);
|
||||||
kidReflowState.SetComputedHeight(posterRenderRect.height);
|
kidReflowInput.SetComputedHeight(posterRenderRect.height);
|
||||||
ReflowChild(imageFrame, aPresContext, kidDesiredSize, kidReflowState,
|
ReflowChild(imageFrame, aPresContext, kidDesiredSize, kidReflowInput,
|
||||||
posterRenderRect.x, posterRenderRect.y, 0, aStatus);
|
posterRenderRect.x, posterRenderRect.y, 0, aStatus);
|
||||||
FinishReflowChild(imageFrame, aPresContext,
|
FinishReflowChild(imageFrame, aPresContext,
|
||||||
kidDesiredSize, &kidReflowState,
|
kidDesiredSize, &kidReflowInput,
|
||||||
posterRenderRect.x, posterRenderRect.y, 0);
|
posterRenderRect.x, posterRenderRect.y, 0);
|
||||||
} else if (child->GetContent() == mVideoControls) {
|
} else if (child->GetContent() == mVideoControls) {
|
||||||
// Reflow the video controls frame.
|
// Reflow the video controls frame.
|
||||||
nsBoxLayoutState boxState(PresContext(), aReflowState.mRenderingContext);
|
nsBoxLayoutState boxState(PresContext(), aReflowInput.mRenderingContext);
|
||||||
nsSize size = child->GetSize();
|
nsSize size = child->GetSize();
|
||||||
nsBoxFrame::LayoutChildAt(boxState,
|
nsBoxFrame::LayoutChildAt(boxState,
|
||||||
child,
|
child,
|
||||||
nsRect(mBorderPadding.left,
|
nsRect(mBorderPadding.left,
|
||||||
mBorderPadding.top,
|
mBorderPadding.top,
|
||||||
aReflowState.ComputedWidth(),
|
aReflowInput.ComputedWidth(),
|
||||||
aReflowState.ComputedHeight()));
|
aReflowInput.ComputedHeight()));
|
||||||
if (child->GetSize() != size) {
|
if (child->GetSize() != size) {
|
||||||
RefPtr<Runnable> event = new DispatchResizeToControls(child->GetContent());
|
RefPtr<Runnable> event = new DispatchResizeToControls(child->GetContent());
|
||||||
nsContentUtils::AddScriptRunner(event);
|
nsContentUtils::AddScriptRunner(event);
|
||||||
}
|
}
|
||||||
} else if (child->GetContent() == mCaptionDiv) {
|
} else if (child->GetContent() == mCaptionDiv) {
|
||||||
// Reflow to caption div
|
// Reflow to caption div
|
||||||
ReflowOutput kidDesiredSize(aReflowState);
|
ReflowOutput kidDesiredSize(aReflowInput);
|
||||||
WritingMode wm = child->GetWritingMode();
|
WritingMode wm = child->GetWritingMode();
|
||||||
LogicalSize availableSize = aReflowState.AvailableSize(wm);
|
LogicalSize availableSize = aReflowInput.AvailableSize(wm);
|
||||||
LogicalSize cbSize = aMetrics.Size(aMetrics.GetWritingMode()).
|
LogicalSize cbSize = aMetrics.Size(aMetrics.GetWritingMode()).
|
||||||
ConvertTo(wm, aMetrics.GetWritingMode());
|
ConvertTo(wm, aMetrics.GetWritingMode());
|
||||||
ReflowInput kidReflowState(aPresContext,
|
ReflowInput kidReflowInput(aPresContext,
|
||||||
aReflowState,
|
aReflowInput,
|
||||||
child,
|
child,
|
||||||
availableSize,
|
availableSize,
|
||||||
&cbSize);
|
&cbSize);
|
||||||
nsSize size(aReflowState.ComputedWidth(), aReflowState.ComputedHeight());
|
nsSize size(aReflowInput.ComputedWidth(), aReflowInput.ComputedHeight());
|
||||||
size.width -= kidReflowState.ComputedPhysicalBorderPadding().LeftRight();
|
size.width -= kidReflowInput.ComputedPhysicalBorderPadding().LeftRight();
|
||||||
size.height -= kidReflowState.ComputedPhysicalBorderPadding().TopBottom();
|
size.height -= kidReflowInput.ComputedPhysicalBorderPadding().TopBottom();
|
||||||
|
|
||||||
kidReflowState.SetComputedWidth(std::max(size.width, 0));
|
kidReflowInput.SetComputedWidth(std::max(size.width, 0));
|
||||||
kidReflowState.SetComputedHeight(std::max(size.height, 0));
|
kidReflowInput.SetComputedHeight(std::max(size.height, 0));
|
||||||
|
|
||||||
ReflowChild(child, aPresContext, kidDesiredSize, kidReflowState,
|
ReflowChild(child, aPresContext, kidDesiredSize, kidReflowInput,
|
||||||
mBorderPadding.left, mBorderPadding.top, 0, aStatus);
|
mBorderPadding.left, mBorderPadding.top, 0, aStatus);
|
||||||
FinishReflowChild(child, aPresContext,
|
FinishReflowChild(child, aPresContext,
|
||||||
kidDesiredSize, &kidReflowState,
|
kidDesiredSize, &kidReflowInput,
|
||||||
mBorderPadding.left, mBorderPadding.top, 0);
|
mBorderPadding.left, mBorderPadding.top, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -384,7 +384,7 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("exit nsVideoFrame::Reflow: size=%d,%d",
|
("exit nsVideoFrame::Reflow: size=%d,%d",
|
||||||
aMetrics.Width(), aMetrics.Height()));
|
aMetrics.Width(), aMetrics.Height()));
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
class nsDisplayVideo : public nsDisplayItem {
|
class nsDisplayVideo : public nsDisplayItem {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user