Skip to content

Commit

Permalink
[selectors-4] Add :open and :closed pseudo-classes #7319
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasai committed Nov 11, 2022
1 parent 389fafd commit 7dc6e0d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions selectors-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2481,6 +2481,29 @@ Sound State: the '':muted'' and '':volume-locked'' pseudo-classes</h3>
<h2 id="display-state-pseudos">
Element Display State Pseudo-classes</h2>

<h3 id="open-state">
Collapse State: the '':open'' and '':closed'' pseudo-class</h3>

The <dfn>:open</dfn> pseudo-class represents an element
that has both “open” and “closed” states,
and which is currently in the “open” state.

The <dfn>:closed</dfn> pseudo-class represents an element
that has both “open” and “closed” states,
and which is currently in the closed state.

Exactly what “open” and “closed” mean is host-language specific,
but exemplified by elements such as
HTML's <{details}>, <{select}>, and <{dialog}> elements,
all of which can be toggled “open” to display more content
(or any content at all, in the case of <{dialog}>).

Note: Being “open” or “closed” is a semantic state.
An element not currently being displayed
(for example, one that has ''visibility: collapse'',
or belongs to a ''display: none'' subtree)
can still be “open” and will match '':open''.

<h3 id="modal-state">
Modal (Exclusive Interaction) State: the '':modal'' pseudo-class</h3>

Expand Down Expand Up @@ -4007,6 +4030,8 @@ Changes since the 7 May 2022 Working Draft</h3>

Significant changes since the <a href="https://www.w3.org/TR/2022/WD-selectors-4-20220507/">7 May 2022 Working Draft</a>:

* Added '':open'' and '':closed'' pseudo-classes.
(<a href="https://github.com/w3c/csswg-drafts/issues/7319">Issue 7319</a>)
* Disallowed [=pseudo-elements=] from '':has()'' unless explicitly allowed
by the pseudo-element’s definition.
(<a href="https://github.com/w3c/csswg-drafts/issues/7463">Issue 7463</a>)
Expand Down

0 comments on commit 7dc6e0d

Please sign in to comment.