Re: [csswg-drafts] [selectors] Add :modal-dialog pseudo-class (#6965)

> Would there be a single top-layer for CSS-originating content, or multiple?

Yes, it would be a separate top layer for author-positioned content, separate from the (higher) UA top layer.

> Either way, I think all this does is extend the z-index fighting that already occurs.

If the only thing top layer did was give an "infinity+1" z-index, then yes, but that's not the case. Top layer reparents your box in the box tree so you escape ancestors, which is a huge convenience.

Again, authors can do this today by putting the element as a final child of body and giving it a high z-index. The point of top level is to give them the convenience of leaving elements where they *belong* in the DOM tree (both semantically and practically) while still getting the "be on top with nothing clipping you" behavior that the UA wants for fullscreen, dialogs, etc. If the UA can do it for dialogs, videos, etc, the author should be able to do it for their own stuff.

> It also adds complexity with clipping; would CSS-originated top layer content escape non-visible overflow in its containing block ancestor chain?

It would be identical to the UA top layer stuff. Every single thing you want to be in the UA top layer, pages will want to do *similar* things, and I don't see a good reason why they shouldn't be able to.

(For example, a good reason would be if the top layer was a trust feature, where users could recognize when something was "in the top layer" and distinguish it from normal content, and trust that it was thus being UA-managed and not phishing them or something. That is not the case here; every detail of the behavior is something that can be reproduced by page content today, possibly with some annoyance.)

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


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

Received on Friday, 28 January 2022 23:48:01 UTC