Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f5de4242f2ed9308a3a09534fe4288ad2f34f7b1
https://github.com/WebKit/WebKit/commit/f5de4242f2ed9308a3a09534fe4288ad2f34f7b1
Author: Alan Baradlay <[email protected]>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
M Source/WebCore/layout/formattingContexts/inline/InlineLine.h
M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
Log Message:
-----------
[line-clamp] Remove hanging trailing whitespace before the block ellipsis
https://bugs.webkit.org/show_bug.cgi?id=325451
<rdar://problem/188551752>
Reviewed by Antti Koivisto.
<div style="line-clamp: 1; width: 29ch; font-family: monospace">
This text is left-aligned<span style="white-space: pre-wrap;
background-color: red"> </span>Clamped
</div>
The pre-wrap spaces hang at the end of the clamped line: they are left out when
measuring the line, but still painted. The ellipsis went right after
"left-aligned" and the spaces (with their red inline box background)
were painted after it. Now they are removed before the ellipsis is inserted.
https://drafts.csswg.org/css-overflow-4/#block-ellipsis
* LayoutTests/TestExpectations: block-ellipsis-032 passes now.
* Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp:
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::detachHangingTrailingWhitespaceIfApplicable): Return
the index of the hanging whitespace run.
(WebCore::Layout::Line::removeHangingTrailingWhitespace):
* Source/WebCore/layout/formattingContexts/inline/InlineLine.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::layoutInlineContent):
Canonical link: https://commits.webkit.org/322531@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications