Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 90ce1cd277808c7ee2aff9a5f6361029ecd0746e
https://github.com/WebKit/WebKit/commit/90ce1cd277808c7ee2aff9a5f6361029ecd0746e
Author: Alan Baradlay <[email protected]>
Date: 2026-08-10 (Mon, 10 Aug 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-with-block-in-inline-001-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-with-block-in-inline-001.html
M
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp
Log Message:
-----------
[block-in-inline] line-clamp does not count the lines of a block level box on
a line
https://bugs.webkit.org/show_bug.cgi?id=321394
Reviewed by Antti Koivisto.
The two helpers around a block level box's layout in
layoutWithFormattingContextForBlockInInline both
return early unless the legacy line clamp state exists, so for line-clamp and
max-lines neither runs.
Two things follow from that. The block lays out against the container's whole
maximumLines, as if the
lines already on the container's own lines did not exist. And the lines the
block produces are never
added to the container's count, so the content after it is counted from where
the block started.
Take the modern line clamp down the same two steps the legacy one takes. Before
the block lays out,
drop the lines taken so far from maximumLines in the render tree's line clamp
state, which is what
LineClampUpdater hands a block level box; it does the same for a block level
sibling by dropping each
preceding sibling's line count as it goes. After the block lays out, add the
lines it produced to the
container's count, read from the block's own lineCount().
*
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-with-block-in-inline-001.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-with-block-in-inline-001-expected.html:
Added.
*
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp:
(WebCore::LayoutIntegration::updateRenderTreeLineClampBeforeLayout):
(WebCore::LayoutIntegration::updateIFCLineClampAfterLayout):
(WebCore::LayoutIntegration::layoutWithFormattingContextForBlockInInline):
(WebCore::LayoutIntegration::updateRenderTreeLegacyLineClamp): Deleted.
(WebCore::LayoutIntegration::updateIFCLineClamp): Deleted.
Canonical link: https://commits.webkit.org/318921@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications