Re: [csswg-drafts] [selectors] Add `:top-layer` pseudo class (#7319)

> > I guess, my question is, _why_ does the Fullscreen spec. define that `::backdrop` is in the top layer? And that the top layer can consist of _multiple_ elements.
> > Sebastian
> 
> This is to prevent a random element outside the top layer with z-index: 999999 to appear above a `::backdrop`.

Ok, so it's just a matter of terminology and their paint order defines the actual "layer" they end up in.

My definition would interweave stacking contexts and paint orders, so you'll end up having one layer per element. That means, an element in the top layer is one layer above everything else. A `::backdrop` would be one layer below that but still above everything else.
So, regarding your example, the top-layer element would have an imaginary `z-index: 1000001;` and the backdrop `z-index: 1000000;`.

> > And that the top layer can consist of _multiple_ elements.
> 
> Nested elements is the answer here too. It's a semi-common use case. Like a dialog that has a tooltip on top. Both are in the top layer.

That's why I meant we'd need multiple top layers. And "top layer" would be defined as above everything that comes before but elements inside this top-layer element can themselves be placed in a new top layer meaning above everything within the top-layer element it's placed in.

(Disclaimer: I didn't read the OpenUI discussions around the Popup API and the top layer yet. So, maybe the concept mentioned in my comments here was already covered earlier.)

Sebastian

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


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

Received on Thursday, 2 June 2022 11:00:45 UTC