Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a26dd722fd134bfcafda90f1166e30142163c652
      
https://github.com/WebKit/WebKit/commit/a26dd722fd134bfcafda90f1166e30142163c652
  Author: Alan Baradlay <[email protected]>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/fast/css/justify-items-legacy-not-modern-alignment-expected.txt
    A LayoutTests/fast/css/justify-items-legacy-not-modern-alignment.html
    M LayoutTests/fast/repaint/justify-items-legacy-change-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-block-in-inline-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-ltr-htb-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-ltr-vlr-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-ltr-vrl-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-rtl-htb-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-rtl-vlr-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-rtl-vrl-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-text-align-2-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-ltr-htb-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-ltr-vlr-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-ltr-vrl-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-rtl-htb-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-rtl-vlr-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-rtl-vrl-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-ltr-htb-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-ltr-vlr-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-ltr-vrl-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-rtl-htb-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-rtl-vlr-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-rtl-vrl-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/safe-justify-self-htb-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/safe-justify-self-vlr-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/safe-justify-self-vrl-expected.txt
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/style/StyleSelfAlignmentData.h

  Log Message:
  -----------
  [css-align] Support justify-self for block-level boxes
https://bugs.webkit.org/show_bug.cgi?id=319108
rdar://problem/181926245

Reviewed by Antti Koivisto.

    <div style="width: 500px">
        <div style="justify-self: center">hi</div>
    </div>

The inner block should shrink to its contents and be centered in the 500px
container. Instead justify-self was ignored: the block stretched to fill the
container and stayed at the inline-start edge.

justify-self and justify-items were only honored for grid and flex items, so a
block-level box always kept its normal auto-width stretch behavior and never
moved from the start.

Size a block-level box whose justify-self is not normal or stretch as
fit-content, skip the CSS2.1 over-constrained margin fill so its used margins
keep their specified values, and apply the resolved alignment as a separate
inline offset when placing the child, which also supersedes the legacy
-webkit-* text-align values.

(See https://drafts.csswg.org/css-align-3/#justify-block)

* LayoutTests/TestExpectations:
* LayoutTests/fast/css/justify-items-legacy-not-modern-alignment-expected.txt: 
Added.
* LayoutTests/fast/css/justify-items-legacy-not-modern-alignment.html: Added.
* LayoutTests/fast/repaint/justify-items-legacy-change-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-block-in-inline-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-ltr-htb-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-ltr-vlr-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-ltr-vrl-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-rtl-htb-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-rtl-vlr-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-htb-rtl-vrl-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-text-align-2-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-ltr-htb-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-ltr-vlr-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-ltr-vrl-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-rtl-htb-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-rtl-vlr-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vlr-rtl-vrl-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-ltr-htb-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-ltr-vlr-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-ltr-vrl-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-rtl-htb-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-rtl-vlr-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/justify-self-vrl-rtl-vrl-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/safe-justify-self-htb-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/safe-justify-self-vlr-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/safe-justify-self-vrl-expected.txt:
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidth const):
(WebCore::RenderBox::sizesLogicalWidthToFitContent const):
(WebCore::RenderBox::computeInlineDirectionMargins const):
* Source/WebCore/rendering/style/StyleSelfAlignmentData.h:
(WebCore::StyleSelfAlignmentData::isNormalStretchOrLegacy const):

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



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

Reply via email to