[csswg-drafts] Pull Request: [css-position-4] Add "afterRemoval" steps to top layer removal algorithms

keithamus has just submitted a new pull request for https://github.com/w3c/csswg-drafts:

== [css-position-4] Add "afterRemoval" steps to top layer removal algorithms ==
Refs https://github.com/whatwg/html/issues/11694.

The spec for implicit anchors is slightly wrong, as the timing of when an implicit anchor can be removed is awkward. 

Implicit anchors for elements in the top layer need to be removed _after_ transitions, otherwise the anchor positioning may cause reflow. 

Chrome "cheats" and skips reflow if the implicit anchor is being removed, but this can cause glitches if the anchored element reflows during this transition, as it will appear to move around the page (losing its implicit anchoring) when reflow is triggered.

Rather than doing this, I propose we add a "list of steps |afterRemoval|" to the "request an element to be removed from the top layer (immediately)" steps. This way we can use this as a callback to determine when the implicit anchor association should be removed.

See https://github.com/w3c/csswg-drafts/pull/12850


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 24 September 2025 15:41:47 UTC