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
[selectors-4] Move quirks mode statements about class and ID selectors to their respective sections. Remove normative dependency on the tree being a DOM tree: that's especially silly given we're giving guidance on mapping other types of trees/structures into the element tree used by Selectors.
Copy file name to clipboardExpand all lines: selectors/Overview.bs
+37-29Lines changed: 37 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -480,7 +480,7 @@ Selectors Overview</h2>
480
480
<dt><dfn local-lt="static">static profile</dfn>
481
481
<dd>
482
482
The <a>static</a> profile is appropriate for contexts which aren't extremely performance sensitive;
483
-
in particular, it's appropriate for contexts which evaluate selectors against a static DOM.
483
+
in particular, it's appropriate for contexts which evaluate selectors against a static document tree.
484
484
For example, the {{Element/query()}} method defined in [[DOM]] should use the <a>static</a> profile.
485
485
It includes all of the selectors defined in this document.
486
486
</dl>
@@ -570,33 +570,19 @@ Structure and Terminology</h3>
570
570
<h3 id='data-model'>
571
571
Data Model</h3>
572
572
573
-
Selectors are evaluated against a DOM tree. [[!DOM]]
573
+
Selectors are evaluated against an element tree such as the DOM. [[!DOM]]
574
574
Within this specification,
575
575
this may be referred to as the "document tree".
576
576
577
-
In addition to the information present in the document tree,
578
-
for the purpose of selectors,
579
-
elements are assumed to have arbitrary <a>pseudo-class</a> flags
580
-
and <a>pseudo-element</a> slots,
581
-
as defined by the given <a>pseudo-class</a> and <a>pseudo-element</a>.
582
-
583
-
<div class='example'>
584
-
For example, the first element child of each element
585
-
has a flag indicating that it matches the '':first-child'' pseudo-class.
586
-
587
-
For another example,
588
-
all elements have ''::before'' pseudo-elements,
589
-
but not only elements with <a>shadow trees</a> have ''::shadow'' pseudo-elements.
590
-
</div>
591
-
592
-
Five aspects of a DOM element are especially relevant for selectors:
577
+
Each element may have any of the following five aspects,
578
+
which can be selected against:
593
579
594
580
<ul>
595
-
<li>The element's type (also known as tagname), which is a string.
596
-
<li>The element's namespace, which is a string.
597
-
<li>An ID, which is a string.
598
-
<li>Classes, which are strings.
599
-
<li>Attributes, which are pairs of strings consisting of an attribute name and an attribute value.
581
+
<li>The element's type (also known as its tag name).
582
+
<li>The element's namespace.
583
+
<li>An ID.
584
+
<li>Classes (named groups) to which it belongs.
585
+
<li>Attributes, which are name-value pairs.
600
586
</ul>
601
587
602
588
While individual elements may lack any of the above features,
@@ -611,10 +597,22 @@ Data Model</h3>
611
597
and can't be matched by <em>any</em><a>pseudo-class</a> except for '':host'' and '':host-context()''.)
612
598
</div>
613
599
614
-
When matching a selector against a document which is in <a>quirks mode</a>,
615
-
class and ID selectors must be matched <a lt="ASCII case-insensitive">ASCII case-insensitively</a>
616
-
against the classes and ID of the elements in the document.
600
+
In addition to the information present in the document tree,
601
+
for the purpose of selectors,
602
+
elements are assumed to have arbitrary <a>pseudo-class</a> flags
603
+
and <a>pseudo-element</a> slots,
604
+
as defined by the given <a>pseudo-class</a> and <a>pseudo-element</a>.
605
+
606
+
<div class='example'>
607
+
For example, the first element child of each element
608
+
has a flag indicating that it matches the '':first-child'' pseudo-class.
609
+
610
+
For another example,
611
+
all elements have ''::before'' pseudo-elements,
612
+
but not only elements with <a>shadow trees</a> have ''::shadow'' pseudo-elements.
613
+
</div>
617
614
615
+
Issue: This section is imho unnecessary, and asserting the existence of a "first-child" flag belonging to the element is a) silly, because that information is already in the tree and b) confusing, because one could then interpret that as meaning the element keeps its first-child flag even when it is moved in the DOM.
618
616
619
617
<h3 id="scoping">
620
618
Scoped Selectors</h3>
@@ -1614,6 +1612,10 @@ Class selectors</h3>
1614
1612
be reached, however, so this behavior is explicitly non-normative in
1615
1613
this specification.
1616
1614
1615
+
When matching against a document which is in <a>quirks mode</a>,
1616
+
class names must be matched <a lt="ASCII case-insensitive">ASCII case-insensitively</a>;
1617
+
class selectors are otherwise case-sensitive.
1618
+
1617
1619
<h3 id="id-selectors">
1618
1620
ID selectors</h3>
1619
1621
@@ -1667,6 +1669,10 @@ ID selectors</h3>
1667
1669
selector. Such a situation could be reached using mixtures of xml:id,
1668
1670
DOM3 Core, XML DTDs, and namespace-specific knowledge.
1669
1671
1672
+
When matching against a document which is in <a>quirks mode</a>,
1673
+
IDs must be matched <a lt="ASCII case-insensitive">ASCII case-insensitively</a>;
0 commit comments