Skip to content

Commit b12db0f

Browse files
committed
[selectors] Introduce the :focus-within pseudo class
1 parent 83b6885 commit b12db0f

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

selectors/Overview.bs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2107,7 +2107,7 @@ The reference element pseudo-class '':scope''</h3>
21072107
User Action Pseudo-classes</h2>
21082108

21092109
Interactive user agents sometimes change the rendering in response to user actions.
2110-
Selectors provides three pseudo-classes for the selection of an element the user is acting on.
2110+
Selectors provides several pseudo-classes for the selection of an element the user is acting on.
21112111
(In non-interactive user agents, these pseudo-classes are valid, but never match any element.)
21122112

21132113
These pseudo-classes are not mutually exclusive. An element may
@@ -2206,6 +2206,15 @@ The input focus pseudo-class '':focus''</h3>
22062206
the same ways must apply to elements matching '':focus'' as well,
22072207
except that the parent of an element that matches '':focus'' must not match '':focus''.
22082208

2209+
<h3 id="the-focus-within-pseudo">
2210+
The Generalized Input Focus Pseudo-Class: '':focus-within''</h3>
2211+
2212+
The <dfn id='focus-within-pseudo'>:focus-within</dfn> pseudo-class applies to elements for which the '':focus'' pseudo class applies.
2213+
Additionaly, the parent of an element that matches '':focus-within'' also matches '':focus-within''.
2214+
2215+
Note: When an element that is '':focus-within'' is in a <a>shadow tree</a>,
2216+
the <a>host element</a> (and its parents) are also in the '':focus-within'' state. (See [[css-scoping-1]])
2217+
22092218
<h3 id="drag-pseudos">
22102219
The drag-and-drop pseudo-class '':drop'' and '':drop()''</h3>
22112220

0 commit comments

Comments
 (0)