@@ -183,9 +183,6 @@ <h2 class="no-num no-toc" id=contents>Table of Contents</h2>
183183
184184 < li > < a href ="#invalid "> < span class =secno > 3.8. </ span > Invalid Selectors
185185 and Error Handling</ a >
186-
187- < li > < a href ="#selector-scoping "> < span class =secno > 3.9. </ span > Selector
188- Scoping</ a >
189186 </ ul >
190187
191188 < li > < a href ="#logical-combination "> < span class =secno > 4. </ span > Logical
@@ -1236,6 +1233,21 @@ <h3 id=scoping><span class=secno>3.3. </span> Scoped Selectors</h3>
12361233 set</ i > </ a > and can be selected with the < a
12371234 href ="#scope-pseudo "> < code > :scope</ code > </ a > pseudo-class.
12381235
1236+ < div class =example >
1237+ < p > The < code > document.querySelector()</ code > function defined in < a
1238+ href ="#SELECTORS-API2 "
1239+ rel =biblioentry > [SELECTORS-API2]<!--{{SELECTORS-API2}}--> </ a > allows the
1240+ author to define a < a
1241+ href ="#scope-constrained "> < i > scope-constrained</ i > </ a > selector.
1242+
1243+ < p > On the other hand, the < code > document.find()</ code > function defined
1244+ in < a href ="#SELECTORS-API2 "
1245+ rel =biblioentry > [SELECTORS-API2]<!--{{SELECTORS-API2}}--> </ a > and the
1246+ selectors within a scoped stylesheet, defined in < a href ="#HTML5 "
1247+ rel =biblioentry > [HTML5]<!--{{HTML5}}--> </ a > , define < a
1248+ href ="#scope-contained "> < i > scope-contained</ i > </ a > selectors.
1249+ </ div >
1250+
12391251 < h3 id =pseudo-classes > < span class =secno > 3.4. </ span > Pseudo-classes</ h3 >
12401252
12411253 < p > The < dfn id =pseudo-class > pseudo-class</ dfn > concept is introduced to
@@ -1374,50 +1386,6 @@ <h3 id=invalid><span class=secno>3.8. </span> Invalid Selectors and Error
13741386 that the last rule be dropped in favor of Media Queries-style
13751387 error-handling.
13761388
1377- < h3 id =selector-scoping > < span class =secno > 3.9. </ span > Selector Scoping</ h3 >
1378-
1379- < p > In some instances, selectors may be "scoped", or limited in some way to
1380- apply only within a section of the document.
1381-
1382- < p > There are two distinct ways in which selectors can be scoped:
1383-
1384- < dl >
1385- < dt > < dfn id =scope-contained0 > scope-contained</ dfn >
1386-
1387- < dd > When a selector is < a
1388- href ="#scope-contained0 "> < i > scope-contained</ i > </ a > , it matches as if the
1389- elements outside of its scope did not exist. In other words, it acts like
1390- the scope defines a sub-document within which the selector is matched.
1391-
1392- < dt > < dfn id =scope-limited > scope-limited</ dfn >
1393-
1394- < dd > When a selector is < a href ="#scope-limited "> < i > scope-limited</ i > </ a > ,
1395- it only matches if the target is within the scope. The rest of the
1396- document is still acknowledged and can match all but the last part of the
1397- selector; only the target (the element matched by the last compound
1398- selector in the selector) is required to be within the scope.
1399- </ dl >
1400-
1401- < div class =example >
1402- < p > The < code > document.querySelector()</ code > function defined in < a
1403- href ="#SELECTORS-API2 "
1404- rel =biblioentry > [SELECTORS-API2]<!--{{SELECTORS-API2}}--> </ a > allows the
1405- author to define a < a href ="#scope-limited "> < i > scope-limited</ i > </ a >
1406- selector.
1407-
1408- < p > On the other hand, the < code > document.find()</ code > function defined
1409- in < a href ="#SELECTORS-API2 "
1410- rel =biblioentry > [SELECTORS-API2]<!--{{SELECTORS-API2}}--> </ a > and the
1411- selectors within a scoped stylesheet, defined in < a href ="#HTML5 "
1412- rel =biblioentry > [HTML5]<!--{{HTML5}}--> </ a > , define < a
1413- href ="#scope-contained0 "> < i > scope-contained</ i > </ a > selectors.
1414- </ div >
1415-
1416- < p > Both kinds of scoping define a < a
1417- href ="#contextual-reference-element-set "> < i > contextual reference element
1418- set</ i > </ a > , which can be matched with the < a
1419- href ="#scope-pseudo "> < code > :scope</ code > </ a > pseudo-class selector.
1420-
14211389 < h2 id =logical-combination > < span class =secno > 4. </ span > Logical
14221390 Combinations</ h2 >
14231391
0 commit comments