css-anchor-positioning icon indicating copy to clipboard operation
css-anchor-positioning copied to clipboard

Track top layer order

Open sanajaved7 opened this issue 2 years ago • 3 comments

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.

sanajaved7 avatar Mar 28 '23 11:03 sanajaved7

@jgerigmeyer This appears to be related to #103 - is it a duplicate, or does it need to be tracked separately?

jamesnw avatar May 17 '24 19:05 jamesnw

@jamesnw I think this might be irrelevant given the changes in #103? I'm not entirely sure without digging into the updated WPTs.

jgerigmeyer avatar May 17 '24 19:05 jgerigmeyer

Makes sense- let's keep it open, and revisit once we get to the potentially related task.

jamesnw avatar May 17 '24 19:05 jamesnw