Skip to content

Commit f2ac5de

Browse files
fantasaijakearchibald
authored andcommitted
[selectors-4] Add :open and :closed pseudo-classes w3c#7319
1 parent c97bc61 commit f2ac5de

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

selectors-4/Overview.bs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,6 +2481,29 @@ Sound State: the '':muted'' and '':volume-locked'' pseudo-classes
24812481

24822482
Element Display State Pseudo-classes
24832483

2484+

2485+
Collapse State: the '':open'' and '':closed'' pseudo-class
2486+
2487+
The :open pseudo-class represents an element
2488+
that has both “open” and “closed” states,
2489+
and which is currently in the “open” state.
2490+
2491+
The :closed pseudo-class represents an element
2492+
that has both “open” and “closed” states,
2493+
and which is currently in the closed state.
2494+
2495+
Exactly what “open” and “closed” mean is host-language specific,
2496+
but exemplified by elements such as
2497+
HTML's <{details}>, <{select}>, and <{dialog}> elements,
2498+
all of which can be toggled “open” to display more content
2499+
(or any content at all, in the case of <{dialog}>).
2500+
2501+
Note: Being “open” or “closed” is a semantic state.
2502+
An element not currently being displayed
2503+
(for example, one that has ''visibility: collapse'',
2504+
or belongs to a ''display: none'' subtree)
2505+
can still be “open” and will match '':open''.
2506+
24842507
24852508
Modal (Exclusive Interaction) State: the '':modal'' pseudo-class
24862509

@@ -4007,6 +4030,8 @@ Changes since the 7 May 2022 Working Draft
40074030

40084031
Significant changes since the 7 May 2022 Working Draft:
40094032

4033+
* Added '':open'' and '':closed'' pseudo-classes.
4034+
40104035
* Disallowed [=pseudo-elements=] from '':has()'' unless explicitly allowed
40114036
by the pseudo-element’s definition.
40124037

0 commit comments

Comments
 (0)