Backed out changeset 07b27f0f7e21 (bug 1908826) for causing non unified build bustages on nsBlockReflowContext.h. CLOSED TREE
This commit is contained in:
@@ -361,7 +361,7 @@ class BlockReflowState {
|
|||||||
nsIFrame* mPrevChild;
|
nsIFrame* mPrevChild;
|
||||||
|
|
||||||
// The previous child frames collapsed bottom margin value.
|
// The previous child frames collapsed bottom margin value.
|
||||||
CollapsingMargin mPrevBEndMargin;
|
nsCollapsingMargin mPrevBEndMargin;
|
||||||
|
|
||||||
// The current next-in-flow for the block. When lines are pulled
|
// The current next-in-flow for the block. When lines are pulled
|
||||||
// from a next-in-flow, this is used to know which next-in-flow to
|
// from a next-in-flow, this is used to know which next-in-flow to
|
||||||
|
|||||||
@@ -108,40 +108,47 @@ struct OverflowAreas {
|
|||||||
nsRect mScrollable;
|
nsRect mScrollable;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace mozilla
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CollapsingMargin represents a vertical collapsing margin between
|
* An nsCollapsingMargin represents a vertical collapsing margin between
|
||||||
* blocks as described in section 8.3.1 of CSS2.
|
* blocks as described in section 8.3.1 of CSS2,
|
||||||
* <https://www.w3.org/TR/CSS22/box.html#collapsing-margins>
|
* <URL: http://www.w3.org/TR/REC-CSS2/box.html#collapsing-margins >.
|
||||||
*
|
*
|
||||||
* All adjacent vertical margins collapse, and the resulting margin is
|
* All adjacent vertical margins collapse, and the resulting margin is
|
||||||
* the sum of the largest positive margin included and the smallest (most
|
* the sum of the largest positive margin included and the smallest (most
|
||||||
* negative) negative margin included.
|
* negative) negative margin included.
|
||||||
*/
|
*/
|
||||||
class CollapsingMargin final {
|
struct nsCollapsingMargin {
|
||||||
|
private:
|
||||||
|
nscoord mMostPos; // the largest positive margin included
|
||||||
|
nscoord mMostNeg; // the smallest negative margin included
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool operator==(const CollapsingMargin& aOther) const {
|
nsCollapsingMargin() : mMostPos(0), mMostNeg(0) {}
|
||||||
|
|
||||||
|
nsCollapsingMargin(const nsCollapsingMargin& aOther) = default;
|
||||||
|
|
||||||
|
bool operator==(const nsCollapsingMargin& aOther) const {
|
||||||
return mMostPos == aOther.mMostPos && mMostNeg == aOther.mMostNeg;
|
return mMostPos == aOther.mMostPos && mMostNeg == aOther.mMostNeg;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const CollapsingMargin& aOther) const {
|
bool operator!=(const nsCollapsingMargin& aOther) const {
|
||||||
return !(*this == aOther);
|
return !(*this == aOther);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsCollapsingMargin& operator=(const nsCollapsingMargin& aOther) = default;
|
||||||
|
|
||||||
void Include(nscoord aCoord) {
|
void Include(nscoord aCoord) {
|
||||||
if (aCoord > mMostPos) {
|
if (aCoord > mMostPos)
|
||||||
mMostPos = aCoord;
|
mMostPos = aCoord;
|
||||||
} else if (aCoord < mMostNeg) {
|
else if (aCoord < mMostNeg)
|
||||||
mMostNeg = aCoord;
|
mMostNeg = aCoord;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Include(const CollapsingMargin& aOther) {
|
void Include(const nsCollapsingMargin& aOther) {
|
||||||
if (aOther.mMostPos > mMostPos) {
|
if (aOther.mMostPos > mMostPos) mMostPos = aOther.mMostPos;
|
||||||
mMostPos = aOther.mMostPos;
|
if (aOther.mMostNeg < mMostNeg) mMostNeg = aOther.mMostNeg;
|
||||||
}
|
|
||||||
if (aOther.mMostNeg < mMostNeg) {
|
|
||||||
mMostNeg = aOther.mMostNeg;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Zero() {
|
void Zero() {
|
||||||
@@ -149,18 +156,13 @@ class CollapsingMargin final {
|
|||||||
mMostNeg = 0;
|
mMostNeg = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsZero() const { return mMostPos == 0 && mMostNeg == 0; }
|
bool IsZero() const { return (mMostPos == 0) && (mMostNeg == 0); }
|
||||||
|
|
||||||
nscoord Get() const { return mMostPos + mMostNeg; }
|
nscoord get() const { return mMostPos + mMostNeg; }
|
||||||
|
|
||||||
private:
|
|
||||||
// The largest positive margin included.
|
|
||||||
nscoord mMostPos = 0;
|
|
||||||
|
|
||||||
// The smallest negative margin included.
|
|
||||||
nscoord mMostNeg = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ReflowOutput is initialized by a parent frame as a parameter passing to
|
* ReflowOutput is initialized by a parent frame as a parameter passing to
|
||||||
* Reflow() to allow a child frame to return its desired size and alignment
|
* Reflow() to allow a child frame to return its desired size and alignment
|
||||||
@@ -236,7 +238,7 @@ class ReflowOutput {
|
|||||||
|
|
||||||
// Carried out block-end margin values. This is the collapsed
|
// Carried out block-end margin values. This is the collapsed
|
||||||
// (generational) block-end margin value.
|
// (generational) block-end margin value.
|
||||||
CollapsingMargin mCarriedOutBEndMargin;
|
nsCollapsingMargin mCarriedOutBEndMargin;
|
||||||
|
|
||||||
// For frames that have content that overflow their content area
|
// For frames that have content that overflow their content area
|
||||||
// (HasOverflowAreas() is true) these rectangles represent the total
|
// (HasOverflowAreas() is true) these rectangles represent the total
|
||||||
|
|||||||
@@ -1792,7 +1792,7 @@ void nsBlockFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
|
|||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
printf(": status=%s metrics=%d,%d carriedMargin=%d",
|
printf(": status=%s metrics=%d,%d carriedMargin=%d",
|
||||||
ToString(aStatus).c_str(), aMetrics.ISize(parentWM),
|
ToString(aStatus).c_str(), aMetrics.ISize(parentWM),
|
||||||
aMetrics.BSize(parentWM), aMetrics.mCarriedOutBEndMargin.Get());
|
aMetrics.BSize(parentWM), aMetrics.mCarriedOutBEndMargin.get());
|
||||||
if (HasOverflowAreas()) {
|
if (HasOverflowAreas()) {
|
||||||
printf(" overflow-vis={%d,%d,%d,%d}", aMetrics.InkOverflow().x,
|
printf(" overflow-vis={%d,%d,%d,%d}", aMetrics.InkOverflow().x,
|
||||||
aMetrics.InkOverflow().y, aMetrics.InkOverflow().width,
|
aMetrics.InkOverflow().y, aMetrics.InkOverflow().width,
|
||||||
@@ -2145,7 +2145,7 @@ nscoord nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput,
|
|||||||
if (CheckForCollapsedBEndMarginFromClearanceLine()) {
|
if (CheckForCollapsedBEndMarginFromClearanceLine()) {
|
||||||
// Convert the children's carried out margin to something that
|
// Convert the children's carried out margin to something that
|
||||||
// we will include in our height
|
// we will include in our height
|
||||||
nonCarriedOutBDirMargin = aState.mPrevBEndMargin.Get();
|
nonCarriedOutBDirMargin = aState.mPrevBEndMargin.get();
|
||||||
aState.mPrevBEndMargin.Zero();
|
aState.mPrevBEndMargin.Zero();
|
||||||
}
|
}
|
||||||
aMetrics.mCarriedOutBEndMargin = aState.mPrevBEndMargin;
|
aMetrics.mCarriedOutBEndMargin = aState.mPrevBEndMargin;
|
||||||
@@ -2166,7 +2166,7 @@ nscoord nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput,
|
|||||||
if (blockEndEdgeOfChildren < aState.mReflowInput.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.mReflowInput.AvailableBSize());
|
aState.mReflowInput.AvailableBSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2868,7 +2868,7 @@ static void DumpLine(const BlockReflowState& aState, nsLineBox* aLine,
|
|||||||
aLine->IsDirty() ? "yes" : "no", aLine->IStart(), aLine->BStart(),
|
aLine->IsDirty() ? "yes" : "no", aLine->IStart(), aLine->BStart(),
|
||||||
aLine->ISize(), aLine->BSize(), ovis.x, ovis.y, ovis.width, ovis.height,
|
aLine->ISize(), aLine->BSize(), ovis.x, ovis.y, ovis.width, ovis.height,
|
||||||
oscr.x, oscr.y, oscr.width, oscr.height, aDeltaBCoord,
|
oscr.x, oscr.y, oscr.width, oscr.height, aDeltaBCoord,
|
||||||
aState.mPrevBEndMargin.Get(), aLine->GetChildCount());
|
aState.mPrevBEndMargin.get(), aLine->GetChildCount());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -4091,7 +4091,7 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowState& aState,
|
|||||||
// assumption.
|
// assumption.
|
||||||
if (!treatWithClearance && !applyBStartMargin && mightClearFloats &&
|
if (!treatWithClearance && !applyBStartMargin && mightClearFloats &&
|
||||||
aState.mReflowInput.mDiscoveredClearance) {
|
aState.mReflowInput.mDiscoveredClearance) {
|
||||||
nscoord curBCoord = aState.mBCoord + aState.mPrevBEndMargin.Get();
|
nscoord curBCoord = aState.mBCoord + aState.mPrevBEndMargin.get();
|
||||||
if (auto [clearBCoord, result] =
|
if (auto [clearBCoord, result] =
|
||||||
aState.ClearFloats(curBCoord, clearType, floatAvoidingBlock);
|
aState.ClearFloats(curBCoord, clearType, floatAvoidingBlock);
|
||||||
result != ClearFloatsResult::BCoordNoChange) {
|
result != ClearFloatsResult::BCoordNoChange) {
|
||||||
@@ -4113,7 +4113,7 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowState& aState,
|
|||||||
|
|
||||||
nsIFrame* clearanceFrame = nullptr;
|
nsIFrame* clearanceFrame = nullptr;
|
||||||
const nscoord startingBCoord = aState.mBCoord;
|
const nscoord startingBCoord = aState.mBCoord;
|
||||||
const CollapsingMargin incomingMargin = aState.mPrevBEndMargin;
|
const nsCollapsingMargin incomingMargin = aState.mPrevBEndMargin;
|
||||||
nscoord clearance;
|
nscoord clearance;
|
||||||
// Save the original position of the frame so that we can reposition
|
// Save the original position of the frame so that we can reposition
|
||||||
// its view as needed.
|
// its view as needed.
|
||||||
@@ -4144,7 +4144,7 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowState& aState,
|
|||||||
availSpace);
|
availSpace);
|
||||||
|
|
||||||
if (treatWithClearance) {
|
if (treatWithClearance) {
|
||||||
aState.mBCoord += aState.mPrevBEndMargin.Get();
|
aState.mBCoord += aState.mPrevBEndMargin.get();
|
||||||
aState.mPrevBEndMargin.Zero();
|
aState.mPrevBEndMargin.Zero();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4171,7 +4171,7 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowState& aState,
|
|||||||
// this block has clearance to change on the second pass; that
|
// this block has clearance to change on the second pass; that
|
||||||
// decision is only allowed to be made under the optimistic
|
// decision is only allowed to be made under the optimistic
|
||||||
// first pass.
|
// first pass.
|
||||||
nscoord curBCoord = aState.mBCoord + aState.mPrevBEndMargin.Get();
|
nscoord curBCoord = aState.mBCoord + aState.mPrevBEndMargin.get();
|
||||||
if (auto [clearBCoord, result] =
|
if (auto [clearBCoord, result] =
|
||||||
aState.ClearFloats(curBCoord, clearType, floatAvoidingBlock);
|
aState.ClearFloats(curBCoord, clearType, floatAvoidingBlock);
|
||||||
result != ClearFloatsResult::BCoordNoChange) {
|
result != ClearFloatsResult::BCoordNoChange) {
|
||||||
@@ -4184,7 +4184,7 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowState& aState,
|
|||||||
aLine->SetHasClearance();
|
aLine->SetHasClearance();
|
||||||
|
|
||||||
// Apply incoming margins
|
// Apply incoming margins
|
||||||
aState.mBCoord += aState.mPrevBEndMargin.Get();
|
aState.mBCoord += aState.mPrevBEndMargin.get();
|
||||||
aState.mPrevBEndMargin.Zero();
|
aState.mPrevBEndMargin.Zero();
|
||||||
|
|
||||||
// Compute the collapsed margin again, ignoring the incoming margin
|
// Compute the collapsed margin again, ignoring the incoming margin
|
||||||
@@ -4198,7 +4198,7 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowState& aState,
|
|||||||
// Temporarily advance the running block-direction value so that the
|
// Temporarily advance the running block-direction value so that the
|
||||||
// GetFloatAvailableSpace method will return the right available space.
|
// GetFloatAvailableSpace method will return the right available space.
|
||||||
// This undone as soon as the horizontal margins are computed.
|
// This undone as soon as the horizontal margins are computed.
|
||||||
bStartMargin = aState.mPrevBEndMargin.Get();
|
bStartMargin = aState.mPrevBEndMargin.get();
|
||||||
|
|
||||||
if (treatWithClearance) {
|
if (treatWithClearance) {
|
||||||
nscoord currentBCoord = aState.mBCoord;
|
nscoord currentBCoord = aState.mBCoord;
|
||||||
@@ -4517,7 +4517,7 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowState& aState,
|
|||||||
// isImpacted doesn't include impact from the block's own floats.
|
// isImpacted doesn't include impact from the block's own floats.
|
||||||
bool forceFit = aState.IsAdjacentWithBStart() && clearance <= 0 &&
|
bool forceFit = aState.IsAdjacentWithBStart() && clearance <= 0 &&
|
||||||
!floatAvailableSpace.HasFloats();
|
!floatAvailableSpace.HasFloats();
|
||||||
CollapsingMargin collapsedBEndMargin;
|
nsCollapsingMargin collapsedBEndMargin;
|
||||||
OverflowAreas overflowAreas;
|
OverflowAreas overflowAreas;
|
||||||
*aKeepReflowGoing =
|
*aKeepReflowGoing =
|
||||||
brc.PlaceBlock(*childReflowInput, forceFit, aLine.get(),
|
brc.PlaceBlock(*childReflowInput, forceFit, aLine.get(),
|
||||||
@@ -4708,7 +4708,7 @@ bool nsBlockFrame::ReflowInlineFrames(BlockReflowState& aState,
|
|||||||
// Setup initial coordinate system for reflowing the inline frames
|
// Setup initial coordinate system for reflowing the inline frames
|
||||||
// into. Apply a previous block frame's block-end margin first.
|
// into. Apply a previous block frame's block-end margin first.
|
||||||
if (ShouldApplyBStartMargin(aState, aLine)) {
|
if (ShouldApplyBStartMargin(aState, aLine)) {
|
||||||
aState.mBCoord += aState.mPrevBEndMargin.Get();
|
aState.mBCoord += aState.mPrevBEndMargin.get();
|
||||||
}
|
}
|
||||||
nsFlowAreaRect floatAvailableSpace = aState.GetFloatAvailableSpace();
|
nsFlowAreaRect floatAvailableSpace = aState.GetFloatAvailableSpace();
|
||||||
|
|
||||||
@@ -5539,7 +5539,7 @@ bool nsBlockFrame::PlaceLine(BlockReflowState& aState,
|
|||||||
// We already called |ShouldApplyBStartMargin|, and if we applied it
|
// We already called |ShouldApplyBStartMargin|, and if we applied it
|
||||||
// then mShouldApplyBStartMargin is set.
|
// then mShouldApplyBStartMargin is set.
|
||||||
nscoord dy = aState.mFlags.mShouldApplyBStartMargin
|
nscoord dy = aState.mFlags.mShouldApplyBStartMargin
|
||||||
? -aState.mPrevBEndMargin.Get()
|
? -aState.mPrevBEndMargin.get()
|
||||||
: 0;
|
: 0;
|
||||||
newBCoord = aState.mBCoord + dy;
|
newBCoord = aState.mBCoord + dy;
|
||||||
}
|
}
|
||||||
@@ -7263,7 +7263,7 @@ void nsBlockFrame::ReflowFloat(BlockReflowState& aState, ReflowInput& aFloatRI,
|
|||||||
|
|
||||||
nsIFrame* clearanceFrame = nullptr;
|
nsIFrame* clearanceFrame = nullptr;
|
||||||
do {
|
do {
|
||||||
CollapsingMargin margin;
|
nsCollapsingMargin margin;
|
||||||
bool mayNeedRetry = false;
|
bool mayNeedRetry = false;
|
||||||
aFloatRI.mDiscoveredClearance = nullptr;
|
aFloatRI.mDiscoveredClearance = nullptr;
|
||||||
// Only first in flow gets a block-start margin.
|
// Only first in flow gets a block-start margin.
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ static nsIFrame* DescendIntoBlockLevelFrame(nsIFrame* aFrame) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool nsBlockReflowContext::ComputeCollapsedBStartMargin(
|
bool nsBlockReflowContext::ComputeCollapsedBStartMargin(
|
||||||
const ReflowInput& aRI, CollapsingMargin* aMargin,
|
const ReflowInput& aRI, nsCollapsingMargin* aMargin,
|
||||||
nsIFrame* aClearanceFrame, bool* aMayNeedRetry, bool* aBlockIsEmpty) {
|
nsIFrame* aClearanceFrame, bool* aMayNeedRetry, bool* aBlockIsEmpty) {
|
||||||
WritingMode wm = aRI.GetWritingMode();
|
WritingMode wm = aRI.GetWritingMode();
|
||||||
WritingMode parentWM = mMetrics.GetWritingMode();
|
WritingMode parentWM = mMetrics.GetWritingMode();
|
||||||
@@ -211,7 +211,7 @@ done:
|
|||||||
|
|
||||||
void nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
void nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
||||||
bool aApplyBStartMargin,
|
bool aApplyBStartMargin,
|
||||||
CollapsingMargin& aPrevMargin,
|
nsCollapsingMargin& aPrevMargin,
|
||||||
nscoord aClearance, nsLineBox* aLine,
|
nscoord aClearance, nsLineBox* aLine,
|
||||||
ReflowInput& aFrameRI,
|
ReflowInput& aFrameRI,
|
||||||
nsReflowStatus& aFrameReflowStatus,
|
nsReflowStatus& aFrameReflowStatus,
|
||||||
@@ -240,12 +240,12 @@ void nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
|||||||
if (mWritingMode.IsOrthogonalTo(mFrame->GetWritingMode())) {
|
if (mWritingMode.IsOrthogonalTo(mFrame->GetWritingMode())) {
|
||||||
if (NS_UNCONSTRAINEDSIZE != aFrameRI.AvailableISize()) {
|
if (NS_UNCONSTRAINEDSIZE != aFrameRI.AvailableISize()) {
|
||||||
aFrameRI.SetAvailableISize(std::max(
|
aFrameRI.SetAvailableISize(std::max(
|
||||||
0, aFrameRI.AvailableISize() - mBStartMargin.Get() - aClearance));
|
0, aFrameRI.AvailableISize() - mBStartMargin.get() - aClearance));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (NS_UNCONSTRAINEDSIZE != aFrameRI.AvailableBSize()) {
|
if (NS_UNCONSTRAINEDSIZE != aFrameRI.AvailableBSize()) {
|
||||||
aFrameRI.SetAvailableBSize(std::max(
|
aFrameRI.SetAvailableBSize(std::max(
|
||||||
0, aFrameRI.AvailableBSize() - mBStartMargin.Get() - aClearance));
|
0, aFrameRI.AvailableBSize() - mBStartMargin.get() - aClearance));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -266,7 +266,7 @@ void nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
|||||||
// reflow auto inline-start/end margins will have a zero value.
|
// reflow auto inline-start/end margins will have a zero value.
|
||||||
LogicalMargin usedMargin = aFrameRI.ComputedLogicalMargin(mWritingMode);
|
LogicalMargin usedMargin = aFrameRI.ComputedLogicalMargin(mWritingMode);
|
||||||
mICoord = mSpace.IStart(mWritingMode) + usedMargin.IStart(mWritingMode);
|
mICoord = mSpace.IStart(mWritingMode) + usedMargin.IStart(mWritingMode);
|
||||||
mBCoord = mSpace.BStart(mWritingMode) + mBStartMargin.Get() + aClearance;
|
mBCoord = mSpace.BStart(mWritingMode) + mBStartMargin.get() + aClearance;
|
||||||
|
|
||||||
LogicalRect space(
|
LogicalRect space(
|
||||||
mWritingMode, mICoord, mBCoord,
|
mWritingMode, mICoord, mBCoord,
|
||||||
@@ -344,7 +344,7 @@ void nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
|||||||
*/
|
*/
|
||||||
bool nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowInput,
|
bool nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowInput,
|
||||||
bool aForceFit, nsLineBox* aLine,
|
bool aForceFit, nsLineBox* aLine,
|
||||||
CollapsingMargin& aBEndMarginResult,
|
nsCollapsingMargin& aBEndMarginResult,
|
||||||
OverflowAreas& aOverflowAreas,
|
OverflowAreas& aOverflowAreas,
|
||||||
const nsReflowStatus& aReflowStatus) {
|
const nsReflowStatus& aReflowStatus) {
|
||||||
// Compute collapsed block-end margin value.
|
// Compute collapsed block-end margin value.
|
||||||
@@ -405,7 +405,7 @@ bool nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowInput,
|
|||||||
// because the containing block will place the next line at the
|
// because the containing block will place the next line at the
|
||||||
// line's BEnd, and it must place the next line at a different
|
// line's BEnd, and it must place the next line at a different
|
||||||
// point from where this empty block will be.
|
// point from where this empty block will be.
|
||||||
backupContainingBlockAdvance = mBStartMargin.Get();
|
backupContainingBlockAdvance = mBStartMargin.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if the frame fit. If it's the first frame or empty then it
|
// See if the frame fit. If it's the first frame or empty then it
|
||||||
|
|||||||
@@ -33,17 +33,17 @@ class nsBlockReflowContext {
|
|||||||
~nsBlockReflowContext() = default;
|
~nsBlockReflowContext() = default;
|
||||||
|
|
||||||
void ReflowBlock(const mozilla::LogicalRect& aSpace, bool aApplyBStartMargin,
|
void ReflowBlock(const mozilla::LogicalRect& aSpace, bool aApplyBStartMargin,
|
||||||
mozilla::CollapsingMargin& aPrevMargin, nscoord aClearance,
|
nsCollapsingMargin& aPrevMargin, nscoord aClearance,
|
||||||
nsLineBox* aLine, ReflowInput& aReflowInput,
|
nsLineBox* aLine, ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aReflowStatus, BlockReflowState& aState);
|
nsReflowStatus& aReflowStatus, BlockReflowState& aState);
|
||||||
|
|
||||||
bool PlaceBlock(const ReflowInput& aReflowInput, bool aForceFit,
|
bool PlaceBlock(const ReflowInput& aReflowInput, bool aForceFit,
|
||||||
nsLineBox* aLine,
|
nsLineBox* aLine,
|
||||||
mozilla::CollapsingMargin& aBEndMarginResult /* out */,
|
nsCollapsingMargin& aBEndMarginResult /* out */,
|
||||||
mozilla::OverflowAreas& aOverflowAreas,
|
mozilla::OverflowAreas& aOverflowAreas,
|
||||||
const nsReflowStatus& aReflowStatus);
|
const nsReflowStatus& aReflowStatus);
|
||||||
|
|
||||||
mozilla::CollapsingMargin& GetCarriedOutBEndMargin() {
|
nsCollapsingMargin& GetCarriedOutBEndMargin() {
|
||||||
return mMetrics.mCarriedOutBEndMargin;
|
return mMetrics.mCarriedOutBEndMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ class nsBlockReflowContext {
|
|||||||
* dirty.
|
* dirty.
|
||||||
*/
|
*/
|
||||||
bool ComputeCollapsedBStartMargin(const ReflowInput& aRI,
|
bool ComputeCollapsedBStartMargin(const ReflowInput& aRI,
|
||||||
CollapsingMargin* aMargin,
|
nsCollapsingMargin* aMargin,
|
||||||
nsIFrame* aClearanceFrame,
|
nsIFrame* aClearanceFrame,
|
||||||
bool* aMayNeedRetry,
|
bool* aMayNeedRetry,
|
||||||
bool* aIsEmpty = nullptr);
|
bool* aIsEmpty = nullptr);
|
||||||
@@ -85,7 +85,7 @@ class nsBlockReflowContext {
|
|||||||
nsSize mContainerSize;
|
nsSize mContainerSize;
|
||||||
mozilla::WritingMode mWritingMode;
|
mozilla::WritingMode mWritingMode;
|
||||||
ReflowOutput mMetrics;
|
ReflowOutput mMetrics;
|
||||||
CollapsingMargin mBStartMargin;
|
nsCollapsingMargin mBStartMargin;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* nsBlockReflowContext_h___ */
|
#endif /* nsBlockReflowContext_h___ */
|
||||||
|
|||||||
@@ -746,7 +746,7 @@ nsColumnSetFrame::ColumnBalanceData nsColumnSetFrame::ReflowColumns(
|
|||||||
"childContentBEnd=%d, CarriedOutBEndMargin=%d (ignored)",
|
"childContentBEnd=%d, CarriedOutBEndMargin=%d (ignored)",
|
||||||
__func__, colData.mColCount, child, ToString(aStatus).c_str(),
|
__func__, colData.mColCount, child, ToString(aStatus).c_str(),
|
||||||
kidDesiredSize.ISize(wm), kidDesiredSize.BSize(wm), childContentBEnd,
|
kidDesiredSize.ISize(wm), kidDesiredSize.BSize(wm), childContentBEnd,
|
||||||
kidDesiredSize.mCarriedOutBEndMargin.Get());
|
kidDesiredSize.mCarriedOutBEndMargin.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
contentRect.UnionRect(contentRect, child->GetRect());
|
contentRect.UnionRect(contentRect, child->GetRect());
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ void nsLineBox::List(FILE* out, const char* aPrefix,
|
|||||||
StyleClearToString(FloatClearTypeAfter()));
|
StyleClearToString(FloatClearTypeAfter()));
|
||||||
|
|
||||||
if (IsBlock() && !GetCarriedOutBEndMargin().IsZero()) {
|
if (IsBlock() && !GetCarriedOutBEndMargin().IsZero()) {
|
||||||
const nscoord bm = GetCarriedOutBEndMargin().Get();
|
const nscoord bm = GetCarriedOutBEndMargin().get();
|
||||||
str += nsPrintfCString("bm=%s ",
|
str += nsPrintfCString("bm=%s ",
|
||||||
nsIFrame::ConvertToString(bm, aFlags).c_str());
|
nsIFrame::ConvertToString(bm, aFlags).c_str());
|
||||||
}
|
}
|
||||||
@@ -409,13 +409,13 @@ bool nsLineBox::RFindLineContaining(nsIFrame* aFrame,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CollapsingMargin nsLineBox::GetCarriedOutBEndMargin() const {
|
nsCollapsingMargin nsLineBox::GetCarriedOutBEndMargin() const {
|
||||||
NS_ASSERTION(IsBlock(), "GetCarriedOutBEndMargin called on non-block line.");
|
NS_ASSERTION(IsBlock(), "GetCarriedOutBEndMargin called on non-block line.");
|
||||||
return (IsBlock() && mBlockData) ? mBlockData->mCarriedOutBEndMargin
|
return (IsBlock() && mBlockData) ? mBlockData->mCarriedOutBEndMargin
|
||||||
: CollapsingMargin();
|
: nsCollapsingMargin();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nsLineBox::SetCarriedOutBEndMargin(CollapsingMargin aValue) {
|
bool nsLineBox::SetCarriedOutBEndMargin(nsCollapsingMargin aValue) {
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
if (IsBlock()) {
|
if (IsBlock()) {
|
||||||
if (!aValue.IsZero()) {
|
if (!aValue.IsZero()) {
|
||||||
|
|||||||
@@ -275,9 +275,9 @@ class nsLineBox final : public nsLineLink {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// mCarriedOutBEndMargin value
|
// mCarriedOutBEndMargin value
|
||||||
mozilla::CollapsingMargin GetCarriedOutBEndMargin() const;
|
nsCollapsingMargin GetCarriedOutBEndMargin() const;
|
||||||
// Returns true if the margin changed
|
// Returns true if the margin changed
|
||||||
bool SetCarriedOutBEndMargin(mozilla::CollapsingMargin aValue);
|
bool SetCarriedOutBEndMargin(nsCollapsingMargin aValue);
|
||||||
|
|
||||||
// mFloats
|
// mFloats
|
||||||
bool HasFloats() const {
|
bool HasFloats() const {
|
||||||
@@ -538,7 +538,7 @@ class nsLineBox final : public nsLineLink {
|
|||||||
|
|
||||||
struct ExtraBlockData : public ExtraData {
|
struct ExtraBlockData : public ExtraData {
|
||||||
explicit ExtraBlockData(const nsRect& aBounds) : ExtraData(aBounds) {}
|
explicit ExtraBlockData(const nsRect& aBounds) : ExtraData(aBounds) {}
|
||||||
mozilla::CollapsingMargin mCarriedOutBEndMargin;
|
nsCollapsingMargin mCarriedOutBEndMargin;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ExtraInlineData : public ExtraData {
|
struct ExtraInlineData : public ExtraData {
|
||||||
|
|||||||
Reference in New Issue
Block a user