Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 68122f6dfc1256627bdbfca6d5dd69650fdf69b4
https://github.com/WebKit/WebKit/commit/68122f6dfc1256627bdbfca6d5dd69650fdf69b4
Author: Alan Baradlay <[email protected]>
Date: 2026-10-03 (Sat, 03 Oct 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h
M Source/WebCore/rendering/LineClampUpdater.h
M Source/WebCore/rendering/RenderBlockFlow.cpp
Log Message:
-----------
[line-clamp] line-clamp: auto does not clamp at the container's block size
https://bugs.webkit.org/show_bug.cgi?id=325529
<rdar://problem/188621599>
Reviewed by Antti Koivisto.
<div style="line-clamp: auto; max-height: 3lh">Line 1<br>Line 2<br>Line
3<br>Line 4</div>
Line 3 should end with an ellipsis and Line 4 should not show. With max-lines
left at auto, the clamp point is the
last line that still fits the block size the container would have if its
automatic block size were infinite, but we
never looked for it. Now the line-clamp root lays out its content without
clamping, counts the lines that fit, and
relayouts it clamped at that many lines. Clamp points between block boxes
(without an ellipsis) are not
supported yet.
https://drafts.csswg.org/css-overflow-4/#line-clamp-containers
* LayoutTests/TestExpectations: 34 tests pass now.
* Source/WebCore/rendering/LineClampUpdater.h:
(WebCore::LineClampUpdater::setMaximumLines):
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::maximumLinesForAutoClampPoint): Count the lines whose bottom (plus
what their enclosing blocks still add below) fits the limit.
(WebCore::RenderBlockFlow::layoutInFlowChildren):
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::lineCountForHeight const):
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h:
Canonical link: https://commits.webkit.org/322603@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications