Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cabfd5e07ad7f990f0a3f97c4bbb4c4479f34fa3
https://github.com/WebKit/WebKit/commit/cabfd5e07ad7f990f0a3f97c4bbb4c4479f34fa3
Author: Alan Baradlay <[email protected]>
Date: 2026-08-04 (Tue, 04 Aug 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/reference/text-align-justify-block-in-inline-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/reference/text-align-last-justify-block-in-inline-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-block-in-inline-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-block-in-inline.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-justify-block-in-inline-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-justify-block-in-inline.html
M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
Log Message:
-----------
[block-in-inline] text-align:justify shouldn't justify the last line
https://bugs.webkit.org/show_bug.cgi?id=320944
<rdar://problem/183976364>
Reviewed by Antti Koivisto.
<div style="text-align: justify; width: 200px">
<span>xx xx xx xx xx xx<div>item</div>yy yy</span>
</div>
The line right before the <div> should be start aligned. Instead it was
justified, stretched out to the full 200px.
A block level box inside an inline box starts a block, and CSS Text 3 counts
the start of a block as a forced line break, so the line before it is the last
line before a forced line break and follows text-align-last.
The justify check now treats ForcedLineBreakByBlockContent as a forced line
break too, mirroring layoutInlineContent.
This also lets text-align-last: justify justify the line before the block,
which it used to skip.
Tests:
imported/w3c/web-platform-tests/css/css-text/text-align/reference/text-align-justify-block-in-inline-ref.html
imported/w3c/web-platform-tests/css/css-text/text-align/reference/text-align-last-justify-block-in-inline-ref.html
imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-block-in-inline.html
imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-justify-block-in-inline.html
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/reference/text-align-justify-block-in-inline-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/reference/text-align-last-justify-block-in-inline-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-block-in-inline-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-block-in-inline.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-justify-block-in-inline-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-justify-block-in-inline.html:
Added.
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::placeInlineAndFloatContent):
Canonical link: https://commits.webkit.org/318562@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications