Closed Bug 2060552 Opened 3 months ago Closed 3 months ago

[wpt-sync] Sync PR 61720 - [css-anchor-position] Add tests for referencing anchor-name across shadow trees

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Jack Holden <75576058+jackholden@users.noreply.github.com> wrote:

[css-anchor-position] Add tests for referencing anchor-name across shadow trees

Hello,

I was working on a custom element that needed CSS Anchor Positioning and asked in a Discord whether a cleaner approach exists instead of using ::part(). They pointed me to the note in the specification about referencing anchor names across shadow trees. The behaviour I was seeing didn’t match that note, so I have written some tests for it.

Description

This PR adds tests based on the note in CSS Anchor Positioning §2.1:

Note: Positioned elements in shadow trees can reference anchor names defined in “higher” trees. Currently, they cannot reference anchor names defined in “lower” shadow trees, though.

Tests added

  • anchor-name-shadow-higher-tree.html
    Checks that a positioned element inside a shadow tree can reference an anchor-name defined in a higher tree.

  • anchor-name-shadow-lower-tree.html
    Checks that a positioned element outside a shadow tree cannot reference an anchor-name defined in a lower shadow tree.

Notes

The higher-tree test currently fails in all browsers (the behaviour is not yet implemented), while the lower-tree test already passes. I considered using the .tentative label but decided against it since the behaviour is already described in the specification.

This is my first (hopeful) contribution to WPT, please let me know if anything needs changing :)

Many thanks!

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

CI Results

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

Total 511 tests

Status Summary

Firefox

OK : 2[GitHub] 255[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: 1[GitHub] 39[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 13582[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 13746[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] 13761[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 13764[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
FAIL: 1[GitHub] 103[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 136[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt] 139[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 153[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

OK : 2
PASS: 1
FAIL: 1

Safari

OK : 2
PASS: 1
FAIL: 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: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
You need to log in before you can comment on or make changes to this bug.