Closed Bug 2089405 Opened 18 days ago Closed 10 days ago

[wpt-sync] Sync PR 64439 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=319534

Categories

(Core :: Layout: Block and Inline, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 64439 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/64439
Details from upstream follow.

Alan Baradlay <zalan@apple.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=319534

WebKit export from bug: [<!---->css-<!---->align]<!----> Support justify-<!---->self for out-<!---->of-<!---->flow block boxes at their static position

<pre>
[css-align] Support justify-self for out-of-flow boxes at the static position

 &lt;div style=&quot;position: relative; width: 500px&quot;&gt;
     &lt;div style=&quot;position: absolute; justify-self: center&quot;&gt;hi&lt;/div&gt;
 &lt;/div&gt;

The absolutely-positioned inner block has auto insets, so it is placed at its
static position and should be centered within the 500px containing block. Instead
justify-self was ignored: the box stayed pinned to the inline-start edge.

When both inline-axis insets are auto, an out-of-flow box is placed at its static
position. Per css-align-3, justify-self then aligns its margin box within the box's
static-position rectangle, resolving against the containing block's writing mode; a
justify-self of auto resolves to the parent's justify-items. (See
<a href="https://drafts.csswg.org/css-align-3/#justify-abspos">https://drafts.csswg.org/css-align-3/#justify-abspos</a> and Appendix A.)

Align the box within the remaining inline space at the static position when
justify-self asks for it, gating the behavior with
shouldAlignStaticPositionInInlineAxis() so it applies only where it is both correct
and covered by tests:

  • the box's own inline axis (non-orthogonal); orthogonal / block-axis static
    positioning keeps the existing static-position path,
  • justify-self resolves (against the parent) to something other than normal;
    normal / auto-resolving-to-normal keeps the box at its static position,
  • the static-position containing block is a plain block container -- flex and grid
    containers place their abspos children with their own alignment rules, and
    alignment does not apply to out-of-flow children of inline boxes.

Everything else falls back to the existing static-position placement, which already
resolves the correct edge for every writing-mode / direction / orthogonal
combination via the parent-relative static inset. This gating matters because the
existing path anchors to that parent-relative edge while resolveAlignmentShift()
reasons in the containing block's writing mode; the two diverge whenever the
parent's inline direction differs from the containing block's, so aligning
unconditionally mispositioned ordinary (justify-self: auto) abspos boxes. The
block-axis / align-self behavior is unchanged.

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=319534">https://bugs.webkit.org/show_bug.cgi?id=319534</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/317349@main">https://commits.webkit.org/317349@main</a>
</pre>

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Component: web-platform-tests → Layout: Block and Inline
Product: Testing → Core
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 88 tests and 8 subtests

Status Summary

Firefox

OK : 4[GitHub] 69[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 24[GitHub] 1084[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 1095[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 32[GitHub] 58[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 66[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

OK : 4
PASS: 52
FAIL: 4

Safari

OK : 4
PASS: 56

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 10 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.