Closed Bug 2091092 Opened 8 days ago Closed 4 days ago

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

Categories

(Core :: CSS Parsing and Computation, 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 64466 into mozilla-central (this bug is closed when the sync is complete).

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

Alan Baradlay <zalan@apple.com> wrote:

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

WebKit export from bug: Element Position is incorrect with regards to the ancestor box

<pre>
Element Position is incorrect with regards to the ancestor box

Given:

<div style="height: 500px">
<span style="position: relative; top: -5%"><img></span>
<div></div>
</div>

The image should be shifted up by 25px (5% of the 500px container).
Instead it stays at its normal position -- the percentage is ignored.

The sibling <div> is the trigger. Without it, the span sits directly
inside the 500px container and the offset works. With the sibling,
the render tree wraps the inline content in an anonymous block:

container (500px)
anonymous block (auto height)
span (position: relative, top: -5%)
img
div

relativePositionOffset() resolves percentage top against the
containing block's height. The containing block for the span is the
anonymous block, which has auto height. Percentage offsets against
auto height resolve to 0, so the offset is lost.

Anonymous blocks are a render tree implementation detail -- the
author never created one. The fix skips them when looking up the
containing block for relative position offset resolution, so the
percentage resolves against the authored container (500px) instead.

This is a workaround until anonymous block construction is avoided
entirely (webkit.org/b/307004).

This includes the lint fixes from <a href="https://commits.webkit.org/325383@main.">https://commits.webkit.org/325383@main.</a>

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

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

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

Total 529 tests and 1 subtests

Status Summary

Firefox

OK : 1[GitHub] 9[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: 5[GitHub] 18[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 520[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 533[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] 537[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
FAIL: 1[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt] 5[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] 18[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

OK : 1
PASS: 5

Safari

OK : 1
PASS: 5

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /css/CSS2/positioning/absolute-replaced-height-001.xht [wpt.fyi]: FAIL [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], PASS [Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
  • /css/CSS2/positioning/absolute-replaced-height-002.xht [wpt.fyi]: FAIL [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], PASS [Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
  • /css/CSS2/positioning/abspos-013.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-014.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-015.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-016.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-017.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-018.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-019.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-020.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-022.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-float-with-inline-container.html [wpt.fyi]: FAIL [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-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
  • /css/CSS2/positioning/abspos-inline-007.xht [wpt.fyi]: FAIL
  • /css/CSS2/positioning/abspos-overflow-002.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-overflow-003.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-overflow-005.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-overflow-006.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-overflow-008.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/abspos-overflow-009.xht [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [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]
  • /css/CSS2/positioning/position-relative-035.xht [wpt.fyi]: FAIL [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-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
Status: NEW → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.