Bug 1432853 - Disable 'page-break-inside:avoid' on abs.pos. frames for now. r=dholbert

This commit is contained in:
Mats Palmgren 2018-02-15 18:38:03 +01:00
Родитель 7d4ce72d01
Коммит c7688ac21f
3 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -167,17 +167,11 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
nsReflowStatus kidStatus;
ReflowAbsoluteFrame(aDelegatingFrame, aPresContext, aReflowInput, cb,
aFlags, kidFrame, kidStatus, aOverflowAreas);
MOZ_ASSERT(!kidStatus.IsInlineBreakBefore(),
"ShouldAvoidBreakInside should prevent this from happening");
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
if ((kidStatus.IsInlineBreakBefore() ||
!kidStatus.IsFullyComplete()) &&
if (!kidStatus.IsFullyComplete() &&
aDelegatingFrame->IsFrameOfType(nsIFrame::eCanContainOverflowContainers)) {
// XXX it's unclear how we should handle 'page-break-inside:avoid' on
// abs.pos. boxes -- ignore it for now by setting the status to
// Incomplete (which will probably fragment it).
if (kidStatus.IsInlineBreakBefore()) {
kidStatus.Reset();
kidStatus.SetIncomplete();
}
// Need a continuation
if (!nextFrame) {
nextFrame =

Просмотреть файл

@ -9704,6 +9704,16 @@ nsFrame::ConsiderChildOverflow(nsOverflowAreas& aOverflowAreas,
aChildFrame->GetPosition());
}
bool
nsFrame::ShouldAvoidBreakInside(const ReflowInput& aReflowInput) const
{
const auto* disp = StyleDisplay();
return !aReflowInput.mFlags.mIsTopOfPage &&
NS_STYLE_PAGE_BREAK_AVOID == disp->mBreakInside &&
!(HasAnyStateBits(NS_FRAME_OUT_OF_FLOW) && IsAbsolutelyPositioned(disp)) &&
!GetPrevInFlow();
}
/**
* This function takes a frame that is part of a block-in-inline split,
* and _if_ that frame is an anonymous block created by an ib split it

Просмотреть файл

@ -473,11 +473,7 @@ public:
/**
* @return true if we should avoid a page/column break in this frame.
*/
bool ShouldAvoidBreakInside(const ReflowInput& aReflowInput) const {
return !aReflowInput.mFlags.mIsTopOfPage &&
NS_STYLE_PAGE_BREAK_AVOID == StyleDisplay()->mBreakInside &&
!GetPrevInFlow();
}
bool ShouldAvoidBreakInside(const ReflowInput& aReflowInput) const;
#ifdef DEBUG
/**