Re: [csswg-drafts] [css-position-4] Define "top layer" positioning scheme (#4998)

This is now more or less done, in [CSS Position 4](https://drafts.csswg.org/css-position-4/).

I based the behavior on [Rune's suggested outline](https://github.com/w3c/csswg-drafts/issues/8189#issuecomment-1447989290). This differs slightly from the simpler model described in the Fullscreen spec. Notably:

* In Fullscreen, adding an element to top layer that's already there moves it to the back. In Position, it stays where it is, unless there's already a pending removal request (in which case we shift it to the back and delete the pending removal; essentially we eagerly process the removal).
 
 This change is a no-op in practice; every algo that puts things in the top layer first checks if the element is already in the top layer, and manually removes it if so.

* Fullscreen doesn't have pending removals - to remove something from the list, you just remove it. In Position, removing an element from the top layer goes thru a pending removal list, which is drained as part of Update The Rendering in HTML. This syncs the element's presence in the "top layer" with whether it's currently *rendered* in the top layer.

 This *might* be simplifiable, now that we rely on the 'overlay' property to determine whether it should be killed or not, but, @lilles can explain if it's not. (If we just relied on 'overlay' we'd lose the "if not rendered" bit from the cleanup; I dunno how significant this is.)

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4998#issuecomment-1492642446 using your GitHub account


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

Received on Friday, 31 March 2023 21:42:02 UTC