Skip to content
Permalink
Browse files
[css-contain] Fix contain-layout-breaks-002.html
https://bugs.webkit.org/show_bug.cgi?id=245023

Reviewed by Alan Bujtas.

Do not propagate forced break to parent within layout containment [1].

[1] https://drafts.csswg.org/css-contain-1/#containment-layout (See item 6/forced breaks)

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::applyBeforeBreak):

Canonical link: https://commits.webkit.org/254432@main
  • Loading branch information
rwlbuis committed Sep 13, 2022
1 parent ea76c52 commit 4b8892b1ab9c9ad7c1230dedae2ef57828e7dc15
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
@@ -4858,7 +4858,6 @@ webanimations/translate-property-and-translate-animation-with-delay-on-forced-la
# CSS containment tests that fail
imported/w3c/web-platform-tests/css/css-contain/contain-inline-size-bfc-floats-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-contain/contain-inline-size-intrinsic.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-contain/contain-layout-breaks-002.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-003.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-004.html [ ImageOnlyFailure ]
@@ -1457,7 +1457,7 @@ LayoutUnit RenderBlockFlow::applyBeforeBreak(RenderBox& child, LayoutUnit logica
// FIXME: Add page break checking here when we support printing.
RenderFragmentedFlow* fragmentedFlow = enclosingFragmentedFlow();
bool isInsideMulticolFlow = fragmentedFlow;
bool checkColumnBreaks = fragmentedFlow && fragmentedFlow->shouldCheckColumnBreaks();
bool checkColumnBreaks = fragmentedFlow && fragmentedFlow->shouldCheckColumnBreaks() && (!shouldApplyLayoutContainment() || child.previousSibling());
bool checkPageBreaks = !checkColumnBreaks && view().frameView().layoutContext().layoutState()->pageLogicalHeight(); // FIXME: Once columns can print we have to check this.
bool checkFragmentBreaks = false;
bool checkBeforeAlways = (checkColumnBreaks && child.style().breakBefore() == BreakBetween::Column)

0 comments on commit 4b8892b

Please sign in to comment.