web-platform-tests / web-platform-tests/interop

CSS Anchor Positioning: Allow shadow trees elements to reference anchor names defined in “higher” trees.

Open
#1,351 1 comment 24 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

focus-area-proposal
Dominant language
JavaScript
Stars
524
Forks
35
Avg merge
1d 4h
Merged PRs (30d)
10

Description

Description
Description

Interop 2026 already covers CSS Anchor Positioning.

For Interop 2027, this is quite a specific ask but it would be great to have the ability for shadow elements to reference anchor names defined in higher trees implemented across all browser engines reducing the need for ::part().

Currently no browsers ship this behaviour despite it being part of the specification. It would drastically reduce some of the current friction.

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.

  <style>
    #host {
      anchor-name: --higher-anchor;
      background: lightgray;
      block-size: 100px;
      inline-size: 200px;
      margin: 50px;
    }
  </style>

  <div id="host">
    <template shadowrootmode="open">
      <style>
        #anchored {
          background: green;
          block-size: 50px;
          inline-size: 50px;
          inset-block-start: anchor(--higher-anchor start, 37px);
          inset-inline-start: anchor(--higher-anchor end, 37px);
          position: absolute;
        }
      </style>
      <div id="anchored"></div>
    </template>
  </div>
Specification

W3C

web-feature

No response

Test Links

https://wpt.fyi/results/css/css-anchor-position/anchor-name-shadow-higher-tree.html?label=experimental&label=master&aligned

Additional Signals

Spec:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CSS Anchor Positioning §2.1 and the linked WPT result for anchor-name-shadow-higher-tree.html. Compare behavior across browser engines and follow the linked Chromium, WebKit, and Mozilla issues. Done means shadow-tree elements can reference anchor names in higher trees consistently across the engines covered by Interop.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.