Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: eb69db24a6c4089bee0fd3fa68e1b1ffef721740
https://github.com/WebKit/WebKit/commit/eb69db24a6c4089bee0fd3fa68e1b1ffef721740
Author: Alan Baradlay <[email protected]>
Date: 2026-08-12 (Wed, 12 Aug 2026)
Changed paths:
A
LayoutTests/printing/page-break-after-block-level-box-on-a-line-expected.txt
A LayoutTests/printing/page-break-after-block-level-box-on-a-line.html
M
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp
Log Message:
-----------
[block-in-inline] A forced page break after a block level box on a line does
not move the following content to the next page
https://bugs.webkit.org/show_bug.cgi?id=321413
Reviewed by Antti Koivisto.
applyAfterBreak answers a forced break by moving the container's logical height
to the top of the next page.
That is what puts the content after a block level sibling there, since the next
block child starts from the
container's height. A block level box on a line is laid out through the same
layoutBlockChild, so the break is
taken, but what comes after the box is a line, and a line takes its position
from the line before it in
logicalTopForNextLine. Nothing reads the height the break moved, and the
content stays on the first page.
The distance the break moved the height is already at hand:
layoutBlockChildFromInlineLayout returns it as
containerLogicalBottom. Take it as the margin after the box, so the line after
it starts at the top of the
next page.
Only a forced break may contribute here. The collapsed margin after the box is
carried by the margin state a
few lines below, and counting it in both places grows the container by that
margin.
* LayoutTests/printing/page-break-after-block-level-box-on-a-line.html: Added.
* LayoutTests/printing/page-break-after-block-level-box-on-a-line-expected.txt:
Added.
*
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp:
(WebCore::LayoutIntegration::layoutWithFormattingContextForBlockInInline):
Canonical link: https://commits.webkit.org/319029@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications