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

I'm ok with `:modal`, but we'll need to very specifically define what "modal" means. (Again, [modalness is a spectrum](https://github.com/openui/open-ui/issues/325), and by choosing `:modal`, we're picking a single point on that spectrum.) I think the only definition we have is "the exact behavior exhibited by `<dialog>` when you call `.showModal()`", which is roughly:
 1. Element appears in the top layer.
 2. A `::backdrop` pseudo element is sized to the viewport and placed immediately behind the element.
 3. The rest of the page is marked `inert`.
 4. The element is automatically closed when a [close signal](https://wicg.github.io/close-watcher/#close-signal) is received (traditionally just ESC). The element is **not** automatically closed when clicking outside the element.

I think only APIs that do all of the above should match `:modal`. That would not include fullscreen elements, since (I believe?) they don't do <span>#</span>3. And it would not include the [Popup API](https://open-ui.org/components/popup.research.explainer) because it doesn't do <span>#</span>3 or <span>#</span>4.

This seems like a self-consistent definition, and while I think it can cause some confusion (over the definition of "modal"), I think we can get around it with crisp documentation about what exactly is meant by `:modal`.

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


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

Received on Wednesday, 27 April 2022 18:25:54 UTC