oddbird / oddbird/css-anchor-positioning

Track top layer order

Open
#95 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
493
Forks
18
Avg merge
12h 37m
Merged PRs (30d)
5

Description

As of #90, the polyfill supports anchoring of top layer elements but we want to also keep track of the order of top layer elements to ensure a top layer target element cannot anchor to a succeeding top layer anchor, like this WPT shows.

Some additional context and background:

  • While some browsers are beginning to roll out a way to inspect the top layer, as of now there is no programmatic way to access the order of the elements in the top layer so we need to track and maintain this within the polyfill. There is an open request for an API here.
  • To keep track of this order, we need to listen for events like showPopover, showDialog, close(), and clicks to dismiss popovers as well.
  • As the order of the top layer elements change, we will need to revalidate to prevent cases like WPT anchor-position-top-layer-006. This is related to the feature requested in #91 because dynamically adding and removing anchors and/or targets are not yet supported.

Contributor guide

Open the contributing guide

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 the WPT css-anchor-position-top-layer-006.html linked in the issue and review the existing top-layer anchoring work from #90. Trace how showPopover, showDialog, close(), and popover-dismiss clicks can be observed, then verify that changing top-layer order triggers revalidation and prevents anchoring to a succeeding top-layer anchor.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.