Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3dc39c349d541297eaa8319e9954a20a3864d82d
https://github.com/WebKit/WebKit/commit/3dc39c349d541297eaa8319e9954a20a3864d82d
Author: Alan Baradlay <[email protected]>
Date: 2026-04-16 (Thu, 16 Apr 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:
-----------
[IFC] Fix
imported/w3c/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-justify-003.html
https://bugs.webkit.org/show_bug.cgi?id=312478
Reviewed by Antti Koivisto.
Given:
<div style="white-space: pre-wrap; text-align: justify; width: 22ch">
one two three four five
</div>
Line 1 breaks as "one two three four " (with two trailing spaces
before "five"). With justify, the words should be evenly spaced so
"four" is flush with the right edge. Instead there was a visible gap.
The trailing whitespace (preserved by pre-wrap) was part of the
same text run as the content. When the text shaper received this
combined run, the expansion for justification wasn't being applied
to the inter-word spaces because the run included characters that
shouldn't receive expansion.
The fix detaches hanging trailing whitespace into its own run
before applying justification. This way the content run gets the
expansion applied correctly, and the trailing whitespace run hangs
after it without interfering.
* LayoutTests/TestExpectations:
* Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp:
(WebCore::Layout::Line::detachHangingTrailingWhitespace):
* Source/WebCore/layout/formattingContexts/inline/InlineLine.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
Canonical link: https://commits.webkit.org/311385@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications