Closed Bug 2089344 Opened 13 days ago Closed 5 days ago

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

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Alan Baradlay <zalan@apple.com> wrote:

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

WebKit export from bug: Fix imported/<!---->w3c/<!---->web-<!---->platform-<!---->tests/<!---->css/<!---->css-<!---->writing-<!---->modes/<!---->margin-<!---->collapse-<!---->vrl-<!---->022.<!---->xht

<pre>
Fix css/css-writing-modes/margin-collapse-vrl-022.xht

When an absolutely positioned element has auto inset (top/left/right/bottom),
we compute a "static position" - where the element would have been if it
weren't absolutely positioned. This works fine in most cases, but breaks when the
parent has an orthogonal writing mode with a flipped axis (vs. the real containing block).

For example, in vertical-rl the block axis runs right-to-left (flipped compared to
horizontal-tb's top-to-bottom). When an absolutely positioned child inside vertical-rl
uses static position, three things go wrong:

  1. The static position is placed at the min edge (left), but it should be at the max
    edge (right) because vertical-rl's block axis starts from the right.

  2. Margins are applied in the wrong direction - margin-right should push the element
    away from the right edge, but it's treated as a before-margin on the wrong side.

  3. After computing the position, there's an adjustment that subtracts the element's
    height (to convert from bottom-edge to top-edge positioning). This adjustment is
    wrong when we've already corrected the static position to come from the right edge.

The fix adds isOrthogonalWithParentFlippedAxis() which detects when the parent's axis
runs in the reverse direction. When it does: place the static position at the max edge,
swap the before/after margins, and skip the height adjustment.

The same logic handles direction:rtl (inline-flipped) with orthogonal children.

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

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

CI Results

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

Total 1248 tests and 3 subtests

Status Summary

Firefox

OK : 81
PASS: 1[GitHub] 13[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 390[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 1516[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] 1519[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 1523[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
FAIL: 25[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 46[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt] 48[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 53[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]

Chrome

PASS: 1

Safari

PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

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