зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset b2da4b644dd9 (bug 1677917) for perma failures on break-at-end-container-edge-000.html. CLOSED TREE
This commit is contained in:
Родитель
e69e249773
Коммит
00226db676
|
@ -42,7 +42,9 @@ BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowInput,
|
|||
mBorderPadding(
|
||||
mReflowInput
|
||||
.ComputedLogicalBorderPadding(mReflowInput.GetWritingMode())
|
||||
.ApplySkipSides(aFrame->PreReflowBlockLevelLogicalSkipSides())),
|
||||
.ApplySkipSides(aFrame->GetLogicalSkipSides(
|
||||
Some(nsIFrame::SkipSidesDuringReflow{aReflowInput,
|
||||
aConsumedBSize})))),
|
||||
mPrevBEndMargin(),
|
||||
mLineNumber(0),
|
||||
mFloatBreakType(StyleClear::None),
|
||||
|
@ -118,11 +120,8 @@ BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowInput,
|
|||
// We are in a paginated situation. The block-end edge is just inside the
|
||||
// block-end border and padding. The content area block-size doesn't include
|
||||
// either border or padding edge.
|
||||
auto bp = aFrame->StyleBorder()->mBoxDecorationBreak ==
|
||||
StyleBoxDecorationBreak::Clone
|
||||
? mBorderPadding.BStartEnd(wm)
|
||||
: mBorderPadding.BStart(wm);
|
||||
mContentArea.BSize(wm) = std::max(0, aReflowInput.AvailableBSize() - bp);
|
||||
mContentArea.BSize(wm) = std::max(
|
||||
0, aReflowInput.AvailableBSize() - mBorderPadding.BStartEnd(wm));
|
||||
} else {
|
||||
// When we are not in a paginated situation, then we always use a
|
||||
// unconstrained block-size.
|
||||
|
|
|
@ -1879,8 +1879,8 @@ void nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput,
|
|||
}
|
||||
|
||||
if (NS_UNCONSTRAINEDSIZE != aReflowInput.ComputedBSize()) {
|
||||
// Note: We don't use blockEndEdgeOfChildren because it includes the
|
||||
// previous margin.
|
||||
// Note: We don't use blockEndEdgeOfChildren because it inclues the previous
|
||||
// margin.
|
||||
nscoord contentBSize = aState.mBCoord + nonCarriedOutBDirMargin;
|
||||
finalSize.BSize(wm) =
|
||||
ComputeFinalBSize(aReflowInput, aState.mReflowStatus, contentBSize,
|
||||
|
@ -3769,12 +3769,9 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
|||
// input for ColumnSet so that ColumnSet can use it to compute its max
|
||||
// column block size.
|
||||
if (frame->IsColumnSetFrame()) {
|
||||
if (availSize.BSize(wm) != NS_UNCONSTRAINEDSIZE &&
|
||||
StyleBorder()->mBoxDecorationBreak ==
|
||||
StyleBoxDecorationBreak::Clone) {
|
||||
if (availSize.BSize(wm) != NS_UNCONSTRAINEDSIZE) {
|
||||
// If the available size is constrained, we need to subtract
|
||||
// ColumnSetWrapper's block-end border and padding, if we know we're
|
||||
// going to use it.
|
||||
// ColumnSetWrapper's block-end border and padding.
|
||||
availSize.BSize(wm) -= aState.BorderPadding().BEnd(wm);
|
||||
}
|
||||
|
||||
|
@ -7668,12 +7665,13 @@ nscoord nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
|
|||
NS_ASSERTION(!(IsTrueOverflowContainer() && computedBSizeLeftOver),
|
||||
"overflow container must not have computedBSizeLeftOver");
|
||||
|
||||
const nsReflowStatus statusFromChildren = aStatus;
|
||||
const nscoord availBSize = aReflowInput.AvailableBSize();
|
||||
nscoord finalBSize = NSCoordSaturatingAdd(
|
||||
NSCoordSaturatingAdd(aBorderPadding.BStart(wm), computedBSizeLeftOver),
|
||||
aBorderPadding.BEnd(wm));
|
||||
|
||||
if (aStatus.IsIncomplete() && finalBSize <= availBSize) {
|
||||
if (statusFromChildren.IsIncomplete() && finalBSize <= availBSize) {
|
||||
// We used up all of our element's remaining computed block-size on this
|
||||
// page/column, but our children are incomplete. Set aStatus to
|
||||
// overflow-incomplete.
|
||||
|
@ -7696,7 +7694,7 @@ nscoord nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
|
|||
return std::min(finalBSize, aBEndEdgeOfChildren);
|
||||
}
|
||||
|
||||
if (aStatus.IsComplete()) {
|
||||
if (statusFromChildren.IsComplete()) {
|
||||
if (computedBSizeLeftOver > 0 && NS_UNCONSTRAINEDSIZE != availBSize &&
|
||||
finalBSize > availBSize) {
|
||||
if (ShouldAvoidBreakInside(aReflowInput)) {
|
||||
|
|
|
@ -379,7 +379,8 @@ nscoord nsFirstLetterFrame::GetLogicalBaseline(WritingMode aWritingMode) const {
|
|||
return mBaseline;
|
||||
}
|
||||
|
||||
LogicalSides nsFirstLetterFrame::GetLogicalSkipSides() const {
|
||||
nsIFrame::LogicalSides nsFirstLetterFrame::GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const {
|
||||
if (GetPrevContinuation()) {
|
||||
// We shouldn't get calls to GetSkipSides for later continuations since
|
||||
// they have separate ComputedStyles with initial values for all the
|
||||
|
|
|
@ -62,7 +62,8 @@ class nsFirstLetterFrame final : public nsContainerFrame {
|
|||
virtual bool CanContinueTextRun() const override;
|
||||
virtual nscoord GetLogicalBaseline(
|
||||
mozilla::WritingMode aWritingMode) const override;
|
||||
virtual LogicalSides GetLogicalSkipSides() const override;
|
||||
virtual LogicalSides GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const override;
|
||||
|
||||
// override of nsFrame method
|
||||
virtual nsresult GetChildFrameContainingOffset(
|
||||
|
|
|
@ -3664,12 +3664,23 @@ class nsIFrame : public nsQueryFrame {
|
|||
* @note (See also bug 743402, comment 11) GetSkipSides() checks to see
|
||||
* if this frame has a previous or next continuation to determine
|
||||
* if a side should be skipped.
|
||||
* So this only works after the entire frame tree has been reflowed.
|
||||
* During reflow, if this frame can be split in the block axis, you
|
||||
* should use nsSplittableFrame::PreReflowBlockLevelLogicalSkipSides().
|
||||
* Unfortunately, this only works after reflow has been completed. In
|
||||
* lieu of this, during reflow, a SkipSidesDuringReflow parameter can
|
||||
* be passed in, indicating that it should be used to determine if sides
|
||||
* should be skipped during reflow.
|
||||
*
|
||||
* FIXME(emilio, bug 1677917): That's wrong, fix BlockReflowInput and remove
|
||||
* SkipSidesDuringReflow and related code.
|
||||
*/
|
||||
Sides GetSkipSides() const;
|
||||
virtual LogicalSides GetLogicalSkipSides() const {
|
||||
|
||||
struct SkipSidesDuringReflow {
|
||||
const ReflowInput& mReflowInput;
|
||||
const nscoord mConsumedBSize = NS_UNCONSTRAINEDSIZE;
|
||||
};
|
||||
|
||||
virtual LogicalSides GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>& = Nothing()) const {
|
||||
return LogicalSides(mWritingMode);
|
||||
}
|
||||
|
||||
|
|
|
@ -2457,7 +2457,8 @@ void nsImageFrame::List(FILE* out, const char* aPrefix,
|
|||
}
|
||||
#endif
|
||||
|
||||
LogicalSides nsImageFrame::GetLogicalSkipSides() const {
|
||||
nsIFrame::LogicalSides nsImageFrame::GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const {
|
||||
LogicalSides skip(mWritingMode);
|
||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||
StyleBoxDecorationBreak::Clone)) {
|
||||
|
|
|
@ -118,7 +118,8 @@ class nsImageFrame : public nsAtomicContainerFrame, public nsIReflowCallback {
|
|||
ListFlags aFlags = ListFlags()) const final;
|
||||
#endif
|
||||
|
||||
LogicalSides GetLogicalSkipSides() const final;
|
||||
LogicalSides GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const final;
|
||||
|
||||
static void ReleaseGlobals() {
|
||||
if (gIconLoad) {
|
||||
|
|
|
@ -791,7 +791,8 @@ void nsInlineFrame::PushFrames(nsPresContext* aPresContext,
|
|||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
LogicalSides nsInlineFrame::GetLogicalSkipSides() const {
|
||||
nsIFrame::LogicalSides nsInlineFrame::GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const {
|
||||
LogicalSides skip(mWritingMode);
|
||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||
StyleBoxDecorationBreak::Clone)) {
|
||||
|
|
|
@ -148,7 +148,8 @@ class nsInlineFrame : public nsContainerFrame {
|
|||
: nsContainerFrame(aStyle, aPresContext, aID),
|
||||
mBaseline(NS_INTRINSIC_ISIZE_UNKNOWN) {}
|
||||
|
||||
LogicalSides GetLogicalSkipSides() const override;
|
||||
LogicalSides GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const override;
|
||||
|
||||
void ReflowFrames(nsPresContext* aPresContext,
|
||||
const ReflowInput& aReflowInput, InlineReflowInput& rs,
|
||||
|
|
|
@ -234,10 +234,10 @@ nscoord nsSplittableFrame::GetEffectiveComputedBSize(
|
|||
return std::max(0, bSize);
|
||||
}
|
||||
|
||||
LogicalSides nsSplittableFrame::GetBlockLevelLogicalSkipSides(
|
||||
bool aAfterReflow) const {
|
||||
nsIFrame::LogicalSides nsSplittableFrame::GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>& aDuringReflow) const {
|
||||
LogicalSides skip(mWritingMode);
|
||||
if (MOZ_UNLIKELY(IsTrueOverflowContainer())) {
|
||||
if (IsTrueOverflowContainer()) {
|
||||
skip |= eLogicalSideBitsBBoth;
|
||||
return skip;
|
||||
}
|
||||
|
@ -251,18 +251,49 @@ LogicalSides nsSplittableFrame::GetBlockLevelLogicalSkipSides(
|
|||
skip |= eLogicalSideBitsBStart;
|
||||
}
|
||||
|
||||
// Always skip block-end side if we have a *later* sibling across column-span
|
||||
// split.
|
||||
if (HasColumnSpanSiblings()) {
|
||||
skip |= eLogicalSideBitsBEnd;
|
||||
}
|
||||
|
||||
if (aAfterReflow) {
|
||||
if (aDuringReflow) {
|
||||
nscoord availBSize = aDuringReflow->mReflowInput.AvailableBSize();
|
||||
// We're in the midst of reflow right now, so it's possible that we haven't
|
||||
// created a next-in-flow yet. If our content block-size is going to exceed
|
||||
// our available block-size, though, then we're going to need a
|
||||
// next-in-flow, it just hasn't been created yet.
|
||||
if (NS_UNCONSTRAINEDSIZE != availBSize) {
|
||||
nscoord effectiveBSize = GetEffectiveComputedBSize(
|
||||
aDuringReflow->mReflowInput, aDuringReflow->mConsumedBSize);
|
||||
if (effectiveBSize != NS_UNCONSTRAINEDSIZE &&
|
||||
effectiveBSize > availBSize) {
|
||||
// Our computed block-size is going to exceed our available block-size,
|
||||
// so we're going to need a next-in-flow.
|
||||
skip |= eLogicalSideBitsBEnd;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
nsIFrame* nif = GetNextContinuation();
|
||||
if (nif && !nif->IsTrueOverflowContainer()) {
|
||||
skip |= eLogicalSideBitsBEnd;
|
||||
}
|
||||
}
|
||||
|
||||
// Always skip block-end side if we have a *later* sibling across column-span
|
||||
// split.
|
||||
if (HasColumnSpanSiblings()) {
|
||||
skip |= eLogicalSideBitsBEnd;
|
||||
}
|
||||
|
||||
return skip;
|
||||
}
|
||||
|
||||
LogicalSides nsSplittableFrame::PreReflowBlockLevelLogicalSkipSides() const {
|
||||
LogicalSides skip(mWritingMode);
|
||||
if (MOZ_UNLIKELY(IsTrueOverflowContainer())) {
|
||||
skip |= mozilla::eLogicalSideBitsBBoth;
|
||||
return skip;
|
||||
}
|
||||
if (MOZ_LIKELY(StyleBorder()->mBoxDecorationBreak !=
|
||||
StyleBoxDecorationBreak::Clone) &&
|
||||
GetPrevInFlow()) {
|
||||
skip |= mozilla::eLogicalSideBitsBStart;
|
||||
return skip;
|
||||
}
|
||||
return skip;
|
||||
}
|
||||
|
|
|
@ -107,25 +107,20 @@ class nsSplittableFrame : public nsIFrame {
|
|||
/**
|
||||
* @see nsIFrame::GetLogicalSkipSides()
|
||||
*/
|
||||
LogicalSides GetLogicalSkipSides() const override {
|
||||
return GetBlockLevelLogicalSkipSides(true);
|
||||
}
|
||||
|
||||
LogicalSides GetBlockLevelLogicalSkipSides(bool aAfterReflow) const;
|
||||
LogicalSides GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>& = Nothing()) const override;
|
||||
|
||||
/**
|
||||
* A version of GetLogicalSkipSides() that is intended to be used inside
|
||||
* Reflow before it's known if |this| frame will be COMPLETE or not.
|
||||
* A faster version of GetLogicalSkipSides() that is intended to be used
|
||||
* inside Reflow before it's known if |this| frame will be COMPLETE or not.
|
||||
* It returns a result that assumes this fragment is the last and thus
|
||||
* should apply the block-end border/padding etc (except for "true" overflow
|
||||
* containers which always skip block sides). You're then expected to
|
||||
* recalculate the block-end side (as needed) when you know |this| frame's
|
||||
* reflow status is INCOMPLETE.
|
||||
* This method is intended for frames that break in the block axis.
|
||||
* This method is intended for frames that breaks in the block axis.
|
||||
*/
|
||||
LogicalSides PreReflowBlockLevelLogicalSkipSides() const {
|
||||
return GetBlockLevelLogicalSkipSides(false);
|
||||
};
|
||||
LogicalSides PreReflowBlockLevelLogicalSkipSides() const;
|
||||
|
||||
nsIFrame* mPrevContinuation;
|
||||
nsIFrame* mNextContinuation;
|
||||
|
|
|
@ -27,5 +27,6 @@ legend {
|
|||
</head>
|
||||
<body>
|
||||
<fieldset><legend></legend></fieldset>
|
||||
<br style="page-break-before: always">
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -209,9 +209,9 @@ load large_border_image_width.html
|
|||
load link-transition-before.html
|
||||
skip-if(winWidget&&isDebugBuild&&/^Windows\x20NT\x206\.1/.test(http.oscpu)) load long-url-list-stack-overflow.html #Bug 1525117
|
||||
load scale-on-block-continuation.html
|
||||
skip-if((/^Windows\x20NT\x2010\.0/.test(http.oscpu))&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI))) load 1383981.html # Very sensitive to stack size.
|
||||
skip-if((/^Windows\x20NT\x2010\.0/.test(http.oscpu))&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI))) load 1383981-2.html
|
||||
skip-if((/^Windows\x20NT\x2010\.0/.test(http.oscpu))&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI))) load 1383981-3.html
|
||||
skip-if((/^Windows\x20NT\x2010\.0/.test(http.oscpu))&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI))) skip-if(AddressSanitizer) load 1383981.html # Very sensitive to stack size.
|
||||
skip-if((/^Windows\x20NT\x2010\.0/.test(http.oscpu))&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI))) skip-if(AddressSanitizer) load 1383981-2.html
|
||||
skip-if((/^Windows\x20NT\x2010\.0/.test(http.oscpu))&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI))) skip-if(AddressSanitizer) load 1383981-3.html
|
||||
load 1384824-1.html
|
||||
load 1384824-2.html
|
||||
load 1386773.html
|
||||
|
|
|
@ -522,7 +522,8 @@ void nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
BuildDisplayListForChild(aBuilder, kid, aLists);
|
||||
}
|
||||
|
||||
LogicalSides nsTableCellFrame::GetLogicalSkipSides() const {
|
||||
nsIFrame::LogicalSides nsTableCellFrame::GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const {
|
||||
LogicalSides skip(mWritingMode);
|
||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||
StyleBoxDecorationBreak::Clone)) {
|
||||
|
|
|
@ -252,7 +252,8 @@ class nsTableCellFrame : public nsContainerFrame,
|
|||
ClassID aID);
|
||||
~nsTableCellFrame();
|
||||
|
||||
LogicalSides GetLogicalSkipSides() const override;
|
||||
LogicalSides GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>& aConsumed = Nothing()) const override;
|
||||
|
||||
/**
|
||||
* GetBorderOverflow says how far the cell's own borders extend
|
||||
|
|
|
@ -297,7 +297,8 @@ void nsTableColGroupFrame::RemoveFrame(ChildListID aListID,
|
|||
}
|
||||
}
|
||||
|
||||
nsIFrame::LogicalSides nsTableColGroupFrame::GetLogicalSkipSides() const {
|
||||
nsIFrame::LogicalSides nsTableColGroupFrame::GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const {
|
||||
LogicalSides skip(mWritingMode);
|
||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||
StyleBoxDecorationBreak::Clone)) {
|
||||
|
|
|
@ -214,7 +214,8 @@ class nsTableColGroupFrame final : public nsContainerFrame {
|
|||
|
||||
void InsertColsReflow(int32_t aColIndex, const nsFrameList::Slice& aCols);
|
||||
|
||||
LogicalSides GetLogicalSkipSides() const override;
|
||||
LogicalSides GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>& = Nothing()) const override;
|
||||
|
||||
// data members
|
||||
int32_t mColCount;
|
||||
|
|
|
@ -1359,7 +1359,8 @@ nsMargin nsTableFrame::GetDeflationForBackground(
|
|||
return GetOuterBCBorder(wm).GetPhysicalMargin(wm);
|
||||
}
|
||||
|
||||
LogicalSides nsTableFrame::GetLogicalSkipSides() const {
|
||||
nsIFrame::LogicalSides nsTableFrame::GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const {
|
||||
LogicalSides skip(mWritingMode);
|
||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||
StyleBoxDecorationBreak::Clone)) {
|
||||
|
|
|
@ -570,7 +570,8 @@ class nsTableFrame : public nsContainerFrame {
|
|||
|
||||
void InitChildReflowInput(ReflowInput& aReflowInput);
|
||||
|
||||
LogicalSides GetLogicalSkipSides() const override;
|
||||
LogicalSides GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>& = Nothing()) const override;
|
||||
|
||||
void IterateBCBorders(BCPaintBorderAction& aAction, const nsRect& aDirtyRect);
|
||||
|
||||
|
|
|
@ -549,7 +549,8 @@ void nsTableRowFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
}
|
||||
|
||||
LogicalSides nsTableRowFrame::GetLogicalSkipSides() const {
|
||||
nsIFrame::LogicalSides nsTableRowFrame::GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const {
|
||||
LogicalSides skip(mWritingMode);
|
||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||
StyleBoxDecorationBreak::Clone)) {
|
||||
|
|
|
@ -269,7 +269,8 @@ class nsTableRowFrame : public nsContainerFrame {
|
|||
bool aBorderCollapse,
|
||||
TableCellReflowInput& aReflowInput);
|
||||
|
||||
LogicalSides GetLogicalSkipSides() const override;
|
||||
LogicalSides GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const override;
|
||||
|
||||
// row-specific methods
|
||||
|
||||
|
|
|
@ -257,7 +257,8 @@ void nsTableRowGroupFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
DisplayRows(aBuilder, this, aLists);
|
||||
}
|
||||
|
||||
LogicalSides nsTableRowGroupFrame::GetLogicalSkipSides() const {
|
||||
nsIFrame::LogicalSides nsTableRowGroupFrame::GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const {
|
||||
LogicalSides skip(mWritingMode);
|
||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||
StyleBoxDecorationBreak::Clone)) {
|
||||
|
|
|
@ -328,7 +328,8 @@ class nsTableRowGroupFrame final : public nsContainerFrame,
|
|||
void InitChildReflowInput(nsPresContext& aPresContext, bool aBorderCollapse,
|
||||
ReflowInput& aReflowInput);
|
||||
|
||||
LogicalSides GetLogicalSkipSides() const override;
|
||||
LogicalSides GetLogicalSkipSides(
|
||||
const Maybe<SkipSidesDuringReflow>&) const override;
|
||||
|
||||
void PlaceChild(nsPresContext* aPresContext,
|
||||
TableRowGroupReflowInput& aReflowInput, nsIFrame* aKidFrame,
|
||||
|
|
Загрузка…
Ссылка в новой задаче