@@ -633,35 +633,24 @@ Scoped Selectors</h3>
633
633
and may be either a true element (the <dfn export>scoping element</dfn> )
634
634
or a <dfn export lt="virtual scoping root">virtual</dfn> one (such as a <a interface>DocumentFragment</a> ).
635
635
636
- There are two <dfn export lt="scoping method | selector scoping method">scoping methods</dfn> for selectors:
637
-
638
- <dl>
639
- <dt> <dfn export id="scope-contained" lt="scope-contained | scope-contained selector">scope-contained</dfn>
640
- <dd>
641
- With this method of scoping, selectors match as if
642
- the <a>scoping root</a> were the root of the document:
643
- all <a>compound selectors</a> must be represented within the scope.
644
- (The '':root'' pseudo-class, however,
645
- still only matches the actual root of the document.)
646
-
647
- <dt> <dfn export id="scope-filtered" lt="scope-filtered | scope-filtered selector">scope-filtered</dfn>
648
- <dd>
649
- With this method of scoping, a selector matches an element only if the element is within the scope,
650
- even if other components of the selector are outside the scope.
651
- (A <a>scoping element</a> is considered to be in scope.)
652
- </dl>
636
+ When a selector is <a>scoped</a> ,
637
+ it matches an element only if the element is a descendant of the <a>scoping root</a> .
638
+ (The rest of the selector can match unrestricted;
639
+ it's only the final matched elements that must be within the scope.)
653
640
654
641
<div class='example'>
655
642
For example,
656
643
the <code> element.querySelector()</code> function defined in [[DOM]]
657
- allows the author to define a <a>scope-filtered</a> selector.
644
+ allows the author to evalute a <a>scoped</a> selector
645
+ relative to the <code> element</code> it's called on.
658
646
659
- On the other hand, the selectors within an [[HTML5]] scoped stylesheet
660
- define <a>scope-contained</a> selectors.
647
+ A call like <code highlight=js> widget.querySelector("a")</code>
648
+ will thus only find <{a}> elements inside of the <code> widget</code> element,
649
+ ignoring any other <{a}> s that might be scattered throughout the document.
661
650
</div>
662
651
663
- Note: If there are no <a>:scope elements</a> when a selector is evaluated ,
664
- the <a>scoping root</a> acts like a <a>:scope element</a> .
652
+ Note: If the context does not explicitly define any <a>:scope elements</a> for the selector,
653
+ the <a>scoping root</a> is a <a>:scope element</a> .
665
654
666
655
<h3 id="relative">
667
656
Relative Selectors</h3>
@@ -677,7 +666,7 @@ Relative Selectors</h3>
677
666
However, it must be <a href="#absolutize">absolutized</a> before matching.
678
667
679
668
Relative selectors, once absolutized,
680
- can additionally be <a>scope-contained</a> or <a>scope-filtered </a> .
669
+ can additionally be <a>scoped </a> .
681
670
682
671
<h4 id='absolutizing'>
683
672
Absolutizing a Relative Selector</h4>
@@ -3177,7 +3166,8 @@ Evaluating a Selector</h3>
3177
3166
3178
3167
<ul>
3179
3168
<li>
3180
- a <a>scoping method</a> and <a>scoping root</a> .
3169
+ a <a>scoping root</a> ,
3170
+ indicating that the selector is <a>scoped</a> .
3181
3171
If not specified, the selector defaults to being unscoped.
3182
3172
3183
3173
<li>
@@ -3205,25 +3195,14 @@ Evaluating a Selector</h3>
3205
3195
provided to the algorithm,
3206
3196
and all their <a>descendants</a> .
3207
3197
3208
- If the selector is <a>scope-contained</a> ,
3209
- the <a>selector match list</a> is immediately filtered
3210
- to contain only elements that are either the <a>scoping root</a>
3211
- or <a>descendants</a> of the <a>scoping root</a> .
3212
-
3213
3198
The selector is processed from left to right in order,
3214
3199
with <a>simple selectors</a> filtering the <a>selector match list</a> ,
3215
3200
and <a>combinators</a> and <a>pseudo-elements</a> changing the <a>selector match list</a> into something new.
3216
- If the selector is <a>scope-contained</a>
3217
- then after each <a>combinator</a>
3218
- the <a>selector match list</a> must be filtered
3219
- to contain only elements that are either the <a>scoping root</a>
3220
- or <a>descendants</a> of the <a>scoping root</a> .
3221
3201
3222
3202
If the selector is <a>scope-filtered</a> ,
3223
3203
then after the selector is finished processing,
3224
3204
the <a>selector match list</a> must be filtered
3225
- to contain only elements that are either the <a>scoping root</a>
3226
- or <a>descendants</a> of the <a>scoping root</a> .
3205
+ to contain only elements that are <a>descendants</a> of the <a>scoping root</a> .
3227
3206
3228
3207
After the selector is finished matching,
3229
3208
the <a>selector match list</a> must be filtered
@@ -3326,7 +3305,8 @@ Match a Selector Against A Tree</h3>
3326
3305
3327
3306
<ul>
3328
3307
<li>
3329
- A <a>scoping method</a> and <a>scoping root</a> .
3308
+ A <a>scoping root</a>
3309
+ indicating the selector is <a>scoped</a> .
3330
3310
If not specified,
3331
3311
the <var> selector</var> defaults to being unscoped.
3332
3312
0 commit comments