Skip to content

Commit eb5e7c1

Browse files
committed
[selectors] Define that the root elements when matching must have the same root. Also fix some linking errors.
1 parent 935cbbc commit eb5e7c1

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

selectors/Overview.bs

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ At Risk: the '':drop()'' pseudo-class
2424
At Risk: the '':read-write'' pseudo-class
2525
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
2626
Ignored Vars: identifier, extended filtering
27-
Link Defaults: dom-core-ls (interface) Document
2827
</pre>
28+
<pre class=link-defaults>
29+
spec:css-syntax-3; type:dfn; text:identifier
30+
</pre>
31+
2932
<style>
3033
#selector-examples td:first-child {
3134
white-space: nowrap;
@@ -606,7 +609,7 @@ Data Model</h3>
606609
it must do so while ignoring the default namespace. [[CSS3NAMESPACE]]
607610

608611
<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>,
610613
and can't be matched by <em>any</em> <a>pseudo-class</a> except for '':host'' and '':host-context()''.)
611614
</div>
612615

@@ -1995,10 +1998,7 @@ The Pointer Hover Pseudo-class: '':hover''</h3>
19951998
(e.g., a pen device that does not detect hovering)
19961999
are still conforming.
19972000

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''.
20022002

20032003
Document languages may define additional ways in which an element can match '':hover''.
20042004
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>
20252025
which elements can become '':active''.
20262026
For example, [[HTML5]] defines a <a href="http://www.whatwg.org/html/selectors.html#selector-active">list of activatable elements</a>.
20272027

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''.
20322029

20332030
Document languages may define additional ways in which an element can match '':active''.
20342031

@@ -2054,10 +2051,8 @@ The Input Focus Pseudo-class: '':focus''</h3>
20542051
The Generalized Input Focus Pseudo-class: '':focus-within''</h3>
20552052

20562053
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''.
20582054

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''.
20612056

20622057
<h3 id="drag-pseudos">
20632058
The Drag-and-Drop Pseudo-class: '':drop'' and '':drop()''</h3>
@@ -3153,9 +3148,12 @@ Evaluating a Selector</h3>
31533148
This section describes how to <dfn export>evaluate a selector</dfn> against a set of elements.
31543149

31553150
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:
31593157

31603158
<ul>
31613159
<li>
@@ -3183,14 +3181,14 @@ Evaluating a Selector</h3>
31833181

31843182
A <a>selector</a> is evaluated against some initial list of elements:
31853183
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>
31873185
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>.
31893187

31903188
If the selector is <a>scope-contained</a>,
31913189
the <a>selector match list</a> is immediately filtered
31923190
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>.
31943192

31953193
The selector is processed from left to right in order,
31963194
with <a>simple selectors</a> filtering the <a>selector match list</a>,
@@ -3199,13 +3197,13 @@ Evaluating a Selector</h3>
31993197
then after each <a>combinator</a>
32003198
the <a>selector match list</a> must be filtered
32013199
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>.
32033201

32043202
If the selector is <a>scope-filtered</a>,
32053203
then after the selector is finished processing,
32063204
the <a>selector match list</a> must be filtered
32073205
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>.
32093207

32103208
After the selector is finished matching,
32113209
the <a>selector match list</a> must be filtered
@@ -3215,7 +3213,7 @@ Evaluating a Selector</h3>
32153213
When this process is done, the elements in the <a>selector match list</a>
32163214
are the elements said to match the selector.
32173215
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>,
32193217
unless otherwise specified.
32203218

32213219
<div class='example'>

0 commit comments

Comments
 (0)