Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7c9b0b516ec7133768146703b11bef16a34be825
      
https://github.com/WebKit/WebKit/commit/7c9b0b516ec7133768146703b11bef16a34be825
  Author: Alan Baradlay <[email protected]>
  Date:   2026-09-29 (Tue, 29 Sep 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-justify-005-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-justify-005-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-justify-005.html
    M Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp

  Log Message:
  -----------
  [IFC] Justified line comes up short when its hanging trailing whitespace is 
inside an inline box
https://bugs.webkit.org/show_bug.cgi?id=325449
<rdar://problem/188548682>

Reviewed by Elika Etemad.

<div style="width: 110px; font: 20px monospace; white-space: pre-wrap; 
text-align: justify"><span>aa bb cc   </span>dd</div>

The spaces after "cc" hang at the end of the first line, so justification 
should only stretch the gaps
between the words. FontCascade spreads a run's expansion over every space in 
its text, so we split the
hanging spaces off into their own run, but only when they ended the very last 
run: with the </span> after
them they got stretched too and "cc" fell short of the right edge. Now we split 
them off the last text run.

Tests: 
imported/w3c/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-justify-005-ref.html
       
imported/w3c/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-justify-005.html

* Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp:
(WebCore::Layout::Line::detachHangingTrailingWhitespaceIfApplicable):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::placeInlineAndFloatContent):
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-justify-005-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-justify-005-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-justify-005.html:
 Added.

Canonical link: https://commits.webkit.org/322224@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to