SIGN IN SIGN UP

[line-clamp] The block ellipsis does not hang with hanging-punctuation

https://bugs.webkit.org/show_bug.cgi?id=326227
<rdar://problem/189105782>

Reviewed by Antti Koivisto.

<div style="line-clamp: 1 ')'; hanging-punctuation: last; width: 5ch; font-family: monospace">12345 678</div>

The first line should show "12345)" with the closing parenthesis hanging past the end of the line, as
"the ellipsis is subject to the effects of the 'hanging punctuation' property". Instead the ellipsis took its
full width from the line and displaced "12345".
Now the hangable trailing punctuation of the ellipsis does not take space from the line, and it is painted past
the end of the line.

* LayoutTests/TestExpectations: block-ellipsis-035 passes now.
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.cpp:
(WebCore::Layout::InlineFormattingUtils::blockEllipsisForLine const):
* Source/WebCore/layout/formattingContexts/inline/InlineLineTypes.h:
* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp:
(WebCore::Layout::trailingBlockEllipsis):
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::hangablePunctuationEndWidth):
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h:

Canonical link: https://commits.webkit.org/322772@main
A
Alan Baradlay committed
13742271d0ff8cab540c25a4f80d9e49dd200bcf
Parent: 97f5429