diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index e0f0430d74ae..141bcc779225 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -140,9 +140,6 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext, nsIFrame* aFrame, if (!aFlags.contains(InitFlag::CallerWillInit)) { Init(aPresContext); } - // If we encounter a PageContent frame, this will be flipped on and the pref - // layout.css.named-pages.enabled will be checked. - mFlags.mCanHaveClassABreakpoints = false; } // Initialize a reflow input for a child frame's reflow. Some state @@ -202,49 +199,6 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext, mFlags.mStaticPosIsCBOrigin = aFlags.contains(InitFlag::StaticPosIsCBOrigin); mFlags.mIOffsetsNeedCSSAlign = mFlags.mBOffsetsNeedCSSAlign = false; - // aPresContext->IsPaginated() and the named pages pref should have been - // checked when constructing the root ReflowInput. - if (aParentReflowInput.mFlags.mCanHaveClassABreakpoints) { - MOZ_ASSERT(aPresContext->IsPaginated(), - "mCanHaveClassABreakpoints set during non-paginated reflow."); - MOZ_ASSERT(StaticPrefs::layout_css_named_pages_enabled(), - "mCanHaveClassABreakpoints should not be set when " - "layout.css.named_pages.enabled is false"); - } - - { - using mozilla::LayoutFrameType; - switch (mFrame->Type()) { - case LayoutFrameType::PageContent: - // PageContent requires paginated reflow. - MOZ_ASSERT(aPresContext->IsPaginated(), - "nsPageContentFrame should not be in non-paginated reflow"); - MOZ_ASSERT(!mFlags.mCanHaveClassABreakpoints, - "mFlags.mCanHaveClassABreakpoints should have been " - "initalized to false before we found nsPageContentFrame"); - mFlags.mCanHaveClassABreakpoints = - StaticPrefs::layout_css_named_pages_enabled(); - break; - case LayoutFrameType::Block: // FALLTHROUGH - case LayoutFrameType::Canvas: // FALLTHROUGH - case LayoutFrameType::FlexContainer: // FALLTHROUGH - case LayoutFrameType::GridContainer: - // This frame type can have class A breakpoints, inherit this flag - // from the parent (this is done for all flags during construction). - // This also includes Canvas frames, as each PageContent frame always - // has exactly one child which is a Canvas frame. - // Do NOT include the subclasses of BlockFrame here, as the ones for - // which this could be applicable (ColumnSetWrapper and the MathML - // frames) cannot have class A breakpoints. - MOZ_ASSERT(mFlags.mCanHaveClassABreakpoints == - aParentReflowInput.mFlags.mCanHaveClassABreakpoints); - break; - default: - mFlags.mCanHaveClassABreakpoints = false; - break; - } - } - if (aFlags.contains(InitFlag::DummyParentReflowInput) || (mParentReflowInput->mFlags.mDummyParentReflowInput && mFrame->IsTableFrame())) { diff --git a/layout/generic/ReflowInput.h b/layout/generic/ReflowInput.h index 0b7f64b54360..b23c695203a4 100644 --- a/layout/generic/ReflowInput.h +++ b/layout/generic/ReflowInput.h @@ -562,10 +562,6 @@ struct ReflowInput : public SizeComputationInput { // children's block-size (after reflowing them). // https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum bool mIsBSizeSetByAspectRatio : 1; - - // If true, then children of this frame can generate class A breakpoints - // for paginated reflow. - bool mCanHaveClassABreakpoints : 1; }; Flags mFlags; diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 7cd8bc582ee8..fd70237f75a5 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -2647,23 +2647,11 @@ void nsBlockFrame::ReflowDirtyLines(BlockReflowState& aState) { // See: https://www.w3.org/TR/css-break-3/#btw-blocks const nsPresContext* const presCtx = aState.mPresContext; const bool canBreakForPageNames = - aState.mReflowInput.mFlags.mCanHaveClassABreakpoints && aState.mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE && + presCtx->IsPaginated() && StaticPrefs::layout_css_named_pages_enabled() && presCtx->GetPresShell()->GetRootFrame()->GetWritingMode().IsVertical() == GetWritingMode().IsVertical(); - // ReflowInput.mFlags.mCanHaveClassABreakpoints should respect the named - // pages pref and presCtx->IsPaginated, so we did not explicitly check these - // above when setting canBreakForPageNames. - if (canBreakForPageNames) { - MOZ_ASSERT(presCtx->IsPaginated(), - "canBreakForPageNames should not be set during non-paginated " - "reflow"); - MOZ_ASSERT(StaticPrefs::layout_css_named_pages_enabled(), - "canBreakForPageNames should not be set when " - "layout.css.named_pages.enabled is false"); - } - // Reflow the lines that are already ours for (; line != line_end; ++line, aState.AdvanceToNextLine()) { DumpLine(aState, line, deltaBCoord, 0); diff --git a/layout/printing/crashtests/1804794.html b/layout/printing/crashtests/1804794.html deleted file mode 100644 index e071b392a423..000000000000 --- a/layout/printing/crashtests/1804794.html +++ /dev/null @@ -1,10 +0,0 @@ - - -
-A diff --git a/layout/printing/crashtests/crashtests.list b/layout/printing/crashtests/crashtests.list index c905940f0458..40270c57f68f 100644 --- a/layout/printing/crashtests/crashtests.list +++ b/layout/printing/crashtests/crashtests.list @@ -9,4 +9,3 @@ load 1748277.html # Bug 1751260 load 1758199-1.html pref(layout.css.named-pages.enabled,true) load 1804571.html pref(layout.css.named-pages.enabled,true) load 1804798.html -pref(layout.css.named-pages.enabled,true) load 1804794.html diff --git a/layout/reftests/css-page/page-name-abspos-001-ref.html b/layout/reftests/css-page/page-name-abspos-001-ref.html deleted file mode 100644 index 15d9c5d18eff..000000000000 --- a/layout/reftests/css-page/page-name-abspos-001-ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - -
a
-
b
- - diff --git a/layout/reftests/css-page/page-name-abspos-001.html b/layout/reftests/css-page/page-name-abspos-001.html deleted file mode 100644 index 709df6a52c1d..000000000000 --- a/layout/reftests/css-page/page-name-abspos-001.html +++ /dev/null @@ -1,7 +0,0 @@ - - - -
a
-
b
- - diff --git a/layout/reftests/css-page/page-name-abspos-002-ref.html b/layout/reftests/css-page/page-name-abspos-002-ref.html deleted file mode 100644 index 145012fe8d79..000000000000 --- a/layout/reftests/css-page/page-name-abspos-002-ref.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -
-
a
-
b
-
- - diff --git a/layout/reftests/css-page/page-name-abspos-002.html b/layout/reftests/css-page/page-name-abspos-002.html deleted file mode 100644 index 23c324dac7a7..000000000000 --- a/layout/reftests/css-page/page-name-abspos-002.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -
-
a
-
b
-
- - diff --git a/layout/reftests/css-page/page-name-abspos-003-ref.html b/layout/reftests/css-page/page-name-abspos-003-ref.html deleted file mode 100644 index 918b1beeee69..000000000000 --- a/layout/reftests/css-page/page-name-abspos-003-ref.html +++ /dev/null @@ -1,8 +0,0 @@ - - - -
a
-
b
-
c
- - diff --git a/layout/reftests/css-page/page-name-abspos-003.html b/layout/reftests/css-page/page-name-abspos-003.html deleted file mode 100644 index b086a4aa7ab8..000000000000 --- a/layout/reftests/css-page/page-name-abspos-003.html +++ /dev/null @@ -1,8 +0,0 @@ - - - -
a
-
b
-
c
- - diff --git a/layout/reftests/css-page/page-name-float-001-ref.html b/layout/reftests/css-page/page-name-float-001-ref.html deleted file mode 100644 index ddeb51aa8b55..000000000000 --- a/layout/reftests/css-page/page-name-float-001-ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - -
a
-
b
- - diff --git a/layout/reftests/css-page/page-name-float-001.html b/layout/reftests/css-page/page-name-float-001.html deleted file mode 100644 index 76664bc9c6ce..000000000000 --- a/layout/reftests/css-page/page-name-float-001.html +++ /dev/null @@ -1,7 +0,0 @@ - - - -
a
-
b
- - diff --git a/layout/reftests/css-page/page-name-float-002-ref.html b/layout/reftests/css-page/page-name-float-002-ref.html deleted file mode 100644 index bb16cf15bce9..000000000000 --- a/layout/reftests/css-page/page-name-float-002-ref.html +++ /dev/null @@ -1,8 +0,0 @@ - - - -
a
-
b
-
c
- - diff --git a/layout/reftests/css-page/page-name-float-002.html b/layout/reftests/css-page/page-name-float-002.html deleted file mode 100644 index d0a3982ef64c..000000000000 --- a/layout/reftests/css-page/page-name-float-002.html +++ /dev/null @@ -1,8 +0,0 @@ - - - -
a
-
b
-
c
- - diff --git a/layout/reftests/css-page/reftest.list b/layout/reftests/css-page/reftest.list index ab11a6d8d03d..3a60ca63ae95 100644 --- a/layout/reftests/css-page/reftest.list +++ b/layout/reftests/css-page/reftest.list @@ -1,13 +1,11 @@ defaults pref(layout.css.named-pages.enabled,true) -== page-name-abspos-001.html page-name-abspos-001-ref.html -fails == page-name-abspos-002.html page-name-abspos-002-ref.html # bug 1816570 -fails == page-name-abspos-003.html page-name-abspos-003-ref.html # bug 1816570 +# https://bugzilla.mozilla.org/1764437 +== page-name-display-none-child.html page-name-display-none-child-ref.html == page-name-canvas-001.html page-name-canvas-001-ref.html == page-name-canvas-002.html page-name-canvas-002-ref.html == page-name-canvas-003.html page-name-canvas-003-ref.html == page-name-canvas-004.html page-name-canvas-004-ref.html -== page-name-display-none-child.html page-name-display-none-child-ref.html == page-name-fixed-pos-001.html page-name-fixed-pos-001-ref.html == page-name-flex-001.html page-name-flex-001-ref.html == page-name-flex-002.html page-name-flex-002-ref.html @@ -15,8 +13,6 @@ fails == page-name-abspos-003.html page-name-abspos-003-ref.html # bug 1816570 # This is affected by https://bugzilla.mozilla.org/1663079, however we can # still expect this to behave the same with break-after and page name breaks. == page-name-flex-004.html page-name-flex-004-ref.html -== page-name-float-001.html page-name-float-001-ref.html -fails == page-name-float-002.html page-name-float-002-ref.html # bug 1816570 == page-name-img-001.html page-name-img-001-ref.html == page-name-img-002.html page-name-img-002-ref.html == page-name-img-003.html page-name-img-003-ref.html