You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: selectors/Overview.bs
+20-22Lines changed: 20 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,11 @@ At Risk: the '':drop()'' pseudo-class
24
24
At Risk: the '':read-write'' pseudo-class
25
25
Ignored Terms: function token, Document, DocumentFragment, math, h1, shadow tree, query(), quirks mode, button, a, span, object, p, div, q, area, link, label, input, html, em, li, ol, pre, CSS Value Definition Syntax
26
26
Ignored Vars: identifier, extended filtering
27
-
Link Defaults: dom-core-ls (interface) Document
28
27
</pre>
28
+
<pre class=link-defaults>
29
+
spec:css-syntax-3; type:dfn; text:identifier
30
+
</pre>
31
+
29
32
<style>
30
33
#selector-examples td:first-child {
31
34
white-space: nowrap;
@@ -606,7 +609,7 @@ Data Model</h3>
606
609
it must do so while ignoring the default namespace. [[CSS3NAMESPACE]]
607
610
608
611
<div class='example'>
609
-
For example, the <a>host element</a> in a <a>shadow tree</a> is <a>featureless</a>,
612
+
For example, the <a>shadow host</a> in a <a>shadow tree</a> is <a>featureless</a>,
610
613
and can't be matched by <em>any</em><a>pseudo-class</a> except for '':host'' and '':host-context()''.)
611
614
</div>
612
615
@@ -1995,10 +1998,7 @@ The Pointer Hover Pseudo-class: '':hover''</h3>
1995
1998
(e.g., a pen device that does not detect hovering)
1996
1999
are still conforming.
1997
2000
1998
-
The parent of an element that matches '':hover'' also matches '':hover''.
1999
-
2000
-
Note: When an element that is '':hover'' is in a <a>shadow tree</a>,
2001
-
the <a>host element</a> (and its parents) are also in the '':hover'' state. (See [[css-scoping-1]])
2001
+
An element also matches '':hover'' if one of its <a>shadow-including descendants</a> matches '':hover''.
2002
2002
2003
2003
Document languages may define additional ways in which an element can match '':hover''.
2004
2004
For example, [[HTML5]] defines a labeled control element as <a href="http://www.whatwg.org/html/selectors.html#selector-hover">matching <code>:hover</code></a>
@@ -2025,10 +2025,7 @@ The Activation Pseudo-class: '':active''</h3>
2025
2025
which elements can become '':active''.
2026
2026
For example, [[HTML5]] defines a <a href="http://www.whatwg.org/html/selectors.html#selector-active">list of activatable elements</a>.
2027
2027
2028
-
The parent of an element that matches '':active'' also matches '':active''.
2029
-
2030
-
Note: When an element that is '':active'' is in a <a>shadow tree</a>,
2031
-
the <a>host element</a> (and its parents) are also in the '':active'' state. (See [[css-scoping-1]])
2028
+
An element also matches '':active'' if one of its <a>shadow-including descendants</a> matches '':active''.
2032
2029
2033
2030
Document languages may define additional ways in which an element can match '':active''.
2034
2031
@@ -2054,10 +2051,8 @@ The Input Focus Pseudo-class: '':focus''</h3>
2054
2051
The Generalized Input Focus Pseudo-class: '':focus-within''</h3>
2055
2052
2056
2053
The <dfn id='focus-within-pseudo'>:focus-within</dfn> pseudo-class applies to elements for which the '':focus'' pseudo class applies.
2057
-
Additionally, the ancestors of an element that matches '':focus-within'' also match '':focus-within''.
2058
2054
2059
-
Note: When an element that is '':focus-within'' is in a <a>shadow tree</a>,
2060
-
the <a>host element</a> (and its parents) are also in the '':focus-within'' state. (See [[css-scoping-1]])
2055
+
An element also matches '':focus-within'' if one of its <a>shadow-including descendants</a> matches '':focus''.
2061
2056
2062
2057
<h3 id="drag-pseudos">
2063
2058
The Drag-and-Drop Pseudo-class: '':drop'' and '':drop()''</h3>
@@ -3153,9 +3148,12 @@ Evaluating a Selector</h3>
3153
3148
This section describes how to <dfn export>evaluate a selector</dfn> against a set of elements.
3154
3149
3155
3150
APIs using this algorithm must provide a selector,
3156
-
and one or more root elements
3157
-
indicating the trees that will be searched by the selector.
3158
-
They may optionally provide:
3151
+
and one or more <var>root elements</var>
3152
+
indicating the <a>trees</a> that will be searched by the selector.
3153
+
All of the <var>root elements</var> must share the same <a for=tree>root</a>,
3154
+
or else calling this algorithm is invalid.
3155
+
3156
+
Callers may optionally provide:
3159
3157
3160
3158
<ul>
3161
3159
<li>
@@ -3183,14 +3181,14 @@ Evaluating a Selector</h3>
3183
3181
3184
3182
A <a>selector</a> is evaluated against some initial list of elements:
3185
3183
the <dfn export>selector match list</dfn>.
3186
-
The <a>selector match list</a> is initially populated with the root elements
3184
+
The <a>selector match list</a> is initially populated with the <var>root elements</var>
3187
3185
provided to the algorithm,
3188
-
and all elements reachable from them by traversing any number of child lists.
3186
+
and all their <a>descendants</a>.
3189
3187
3190
3188
If the selector is <a>scope-contained</a>,
3191
3189
the <a>selector match list</a> is immediately filtered
3192
3190
to contain only elements that are either the <a>scoping root</a>
3193
-
or descendants of the <a>scoping root</a>.
3191
+
or <a>descendants</a> of the <a>scoping root</a>.
3194
3192
3195
3193
The selector is processed from left to right in order,
3196
3194
with <a>simple selectors</a> filtering the <a>selector match list</a>,
@@ -3199,13 +3197,13 @@ Evaluating a Selector</h3>
3199
3197
then after each <a>combinator</a>
3200
3198
the <a>selector match list</a> must be filtered
3201
3199
to contain only elements that are either the <a>scoping root</a>
3202
-
or descendants of the <a>scoping root</a>.
3200
+
or <a>descendants</a> of the <a>scoping root</a>.
3203
3201
3204
3202
If the selector is <a>scope-filtered</a>,
3205
3203
then after the selector is finished processing,
3206
3204
the <a>selector match list</a> must be filtered
3207
3205
to contain only elements that are either the <a>scoping root</a>
3208
-
or descendants of the <a>scoping root</a>.
3206
+
or <a>descendants</a> of the <a>scoping root</a>.
3209
3207
3210
3208
After the selector is finished matching,
3211
3209
the <a>selector match list</a> must be filtered
@@ -3215,7 +3213,7 @@ Evaluating a Selector</h3>
3215
3213
When this process is done, the elements in the <a>selector match list</a>
3216
3214
are the elements said to match the selector.
3217
3215
If the order of elements matter,
3218
-
they must be sorted in document order,
3216
+
they must be sorted in <a>shadow-including tree order</a>,
0 commit comments