|
15 | 15 |
|
16 | 16 | <h1 id=title>Selectors Level 4</h1> |
17 | 17 |
|
18 | | - <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 23 March 2011</h2> |
| 18 | + <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 28 March 2011</h2> |
19 | 19 |
|
20 | 20 | <dl> |
21 | 21 | <dt>This version: |
22 | 22 |
|
23 | | - <dd> <!-- <a href="http://www.w3.org/TR/2011/ED-selectors4-20110323"> |
24 | | - http://www.w3.org/TR/2011/PR-selectors4-20110323</a> --> |
| 23 | + <dd> <!-- <a href="http://www.w3.org/TR/2011/ED-selectors4-20110328"> |
| 24 | + http://www.w3.org/TR/2011/PR-selectors4-20110328</a> --> |
25 | 25 | <a href="http://dev.w3.org/csswg/selectors4"> |
26 | 26 | http://dev.w3.org/csswg/selectors4</a> |
27 | 27 |
|
@@ -155,11 +155,11 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2> |
155 | 155 | <li><a href="#logical-combination"><span class=secno>4. </span> Logical |
156 | 156 | Combinations</a> |
157 | 157 | <ul class=toc> |
158 | | - <li><a href="#grouping"><span class=secno>4.1. </span> Groups of |
159 | | - selectors </a> |
| 158 | + <li><a href="#grouping"><span class=secno>4.1. </span> Selector Groups |
| 159 | + </a> |
160 | 160 |
|
161 | 161 | <li><a href="#matches"><span class=secno>4.2. </span> The Matches-Any |
162 | | - Psuedo-class: ‘<code class=css>:matches()</code>’</a> |
| 162 | + Pseudo-class: ‘<code class=css>:matches()</code>’</a> |
163 | 163 |
|
164 | 164 | <li><a href="#negation"><span class=secno>4.3. </span> The Negation |
165 | 165 | Pseudo-class: ‘<code class=css>:not()</code>’</a> |
@@ -800,15 +800,14 @@ <h3 id=structure><span class=secno>3.1. </span> Structure and Terminology</h3> |
800 | 800 | <a href="#universal-selector">universal selector</a>. No other type |
801 | 801 | selector or universal selector is allowed in the sequence. |
802 | 802 |
|
803 | | - <p>A <dfn id=simple-selector><a name=simple-selectors-dfn></a><a |
804 | | - href="#simple">simple selector</a></dfn> is either a <a |
805 | | - href="#type-selectors">type selector</a>, <a |
806 | | - href="#universal-selector">universal selector</a>, <a |
| 803 | + <p>A <dfn id=simple-selector><a name=simple></a><a href="#simple">simple |
| 804 | + selector</a></dfn> is either a <a href="#type-selectors">type |
| 805 | + selector</a>, <a href="#universal-selector">universal selector</a>, <a |
807 | 806 | href="#attribute-selectors">attribute selector</a>, <a |
808 | 807 | href="#class-html">class selector</a>, <a href="#id-selectors">ID |
809 | 808 | selector</a>, or <a href="#pseudo-classes">pseudo-class</a>. |
810 | 809 |
|
811 | | - <p><dfn id=combinators0>Combinators</dfn> are punctuation that represent a |
| 810 | + <p><dfn id=combinator>Combinators</dfn> are punctuation that represent a |
812 | 811 | particular kind of relationship between the compound selectors on either |
813 | 812 | side. Combinators in Selectors level 4 include: whitespace, |
814 | 813 | "greater-than sign" (U+003E, <code>></code>), "plus |
@@ -914,7 +913,7 @@ <h3 id=invalid><span class=secno>3.5. </span> Invalid Selectors and Error |
914 | 913 | <h2 id=logical-combination><span class=secno>4. </span> Logical |
915 | 914 | Combinations</h2> |
916 | 915 |
|
917 | | - <h3 id=grouping><span class=secno>4.1. </span> Groups of selectors</h3> |
| 916 | + <h3 id=grouping><span class=secno>4.1. </span> Selector Groups</h3> |
918 | 917 |
|
919 | 918 | <p>A comma-separated list of selectors represents the union of all elements |
920 | 919 | selected by each of the individual selectors in the list. (A comma is |
@@ -960,72 +959,80 @@ <h3 id=grouping><span class=secno>4.1. </span> Groups of selectors</h3> |
960 | 959 | grouped, only the rule for <code>h2..foo</code> is dropped.)</p> |
961 | 960 | </div> |
962 | 961 |
|
963 | | - <h3 id=matches><span class=secno>4.2. </span> The Matches-Any Psuedo-class: |
| 962 | + <h3 id=matches><span class=secno>4.2. </span> The Matches-Any Pseudo-class: |
964 | 963 | ‘<code class=css>:matches()</code>’</h3> |
965 | 964 |
|
966 | | - <p>The <code>:matches(<var>X</var>)</code> pseudo-class is a functional |
967 | | - notation taking a comma-separated list of <a href="#compound">compound |
968 | | - selectors</a> as an argument. It represents an element that is represented |
969 | | - by any of its arguments. |
| 965 | + <p>The matches pseudo-class, <code>:matches(<var>X</var>)</code>, is a |
| 966 | + functional notation taking a <a href="#grouping">selector group</a> as an |
| 967 | + argument. It represents an element that is represented by its argument. |
970 | 968 |
|
971 | | - <p><code>:matches()</code> may not be nested; |
972 | | - <code>:matches(:matches(...))</code> is invalid. Also pseudo-elements are |
973 | | - not valid within <code>:matches()</code>. |
| 969 | + <p>In Selectors Level 4, only <a href="#compound">compound selectors</a> |
| 970 | + are allowed within <code>:matches()</code>: <a |
| 971 | + href="#combinator">combinators</a> are not allowed. Additionally, |
| 972 | + <code>:matches()</code> may not be nested within itself or within |
| 973 | + <code>:not()</code>: <code>:matches(:matches(...))</code> and |
| 974 | + <code>:not(:matches(...))</code> are invalid. |
974 | 975 |
|
975 | | - <p>Default namespace declarations do not affect the argument of the |
976 | | - matches-any pseudo-class unless the argument is a universal selector or a |
977 | | - type selector. (See below for examples.) |
| 976 | + <p>Pseudo-elements cannot be represented by the matches pseudo-class; they |
| 977 | + are not valid within <code>:matches()</code>. |
| 978 | + |
| 979 | + <p>Default namespace declarations do not affect the subject of any selector |
| 980 | + within a matches-any pseudo-class unless the argument is an explicit |
| 981 | + universal selector or a type selector. |
| 982 | + |
| 983 | + <div class=example> |
| 984 | + <p>For example, following selector matches any element that is being |
| 985 | + hovered or focused, regardless of its namespace. In particular, it is not |
| 986 | + limited to only matching elements in the default namespace that are being |
| 987 | + hovered or focused.</p> |
| 988 | + |
| 989 | + <pre>*|*:matches(:hover, :focus)</pre> |
| 990 | + |
| 991 | + <p>The following selector, however, represents only hovered or focused |
| 992 | + elements that are in the default namespace, because it uses an explicit |
| 993 | + universal selector within the <code>:matches()</code> notation:</p> |
| 994 | + |
| 995 | + <pre>*|*:matches(*:hover, *:focus)</pre> |
| 996 | + </div> |
978 | 997 |
|
979 | 998 | <h3 id=negation><span class=secno>4.3. </span> The Negation Pseudo-class: |
980 | 999 | ‘<code class=css>:not()</code>’</h3> |
981 | 1000 |
|
982 | 1001 | <p>The negation pseudo-class, <code>:not(<var>X</var>)</code>, is a |
983 | | - functional notation taking a comma-separated list of <a |
984 | | - href="#compound">compound selectors</a> as an argument. It represents an |
985 | | - element that is not represented by any of its arguments. |
| 1002 | + functional notation taking a <a href="#grouping">selector group</a> as an |
| 1003 | + argument. It represents an element that is not represented by its |
| 1004 | + argument. |
986 | 1005 |
|
987 | | - <p>Negations may not be nested; <code>:not(:not(...))</code> is invalid. |
988 | | - Also pseudo-elements are not valid within <code>:not()</code>. |
| 1006 | + <p>In Selectors Level 4, only <a href="#compound">compound selectors</a> |
| 1007 | + are allowed within <code>:matches()</code>: <a |
| 1008 | + href="#combinator">combinators</a> are not allowed. Additionally, |
| 1009 | + negations may not be nested within itself or within |
| 1010 | + <code>:matches()</code>: <code>:not(:not(...))</code> and |
| 1011 | + <code>:matches(:not(...))</code> are invalid. |
989 | 1012 |
|
990 | | - <div class=example> |
991 | | - <p>Examples:</p> |
| 1013 | + <p>Pseudo-elements cannot be represented by the negation pseudo-class; they |
| 1014 | + are not valid within <code>:not()</code>. |
992 | 1015 |
|
993 | | - <p>The following selector matches all <code>button</code> elements in an |
994 | | - HTML document that are not disabled.</p> |
| 1016 | + <div class=example> |
| 1017 | + <p>For example, the following selector matches all <code>button</code> |
| 1018 | + elements in an HTML document that are not disabled.</p> |
995 | 1019 |
|
996 | 1020 | <pre>button:not([DISABLED])</pre> |
997 | 1021 |
|
998 | 1022 | <p>The following selector represents all but <code>FOO</code> elements.</p> |
999 | 1023 |
|
1000 | 1024 | <pre>*:not(FOO)</pre> |
1001 | 1025 |
|
1002 | | - <p>The following group of selectors represents all HTML elements except |
| 1026 | + <p>The following compound selector represents all HTML elements except |
1003 | 1027 | links.</p> |
1004 | 1028 |
|
1005 | 1029 | <pre>html|*:not(:link):not(:visited)</pre> |
1006 | 1030 | </div> |
1007 | 1031 |
|
1008 | | - <p>Default namespace declarations do not affect the argument of the |
1009 | | - negation pseudo-class unless the argument is a universal selector or a |
1010 | | - type selector. |
1011 | | - |
1012 | | - <div class=example> |
1013 | | - <p>Examples:</p> |
1014 | | - |
1015 | | - <p>Assuming that the default namespace is bound to "http://example.com/", |
1016 | | - the following selector represents all elements that are not in that |
1017 | | - namespace:</p> |
1018 | | - |
1019 | | - <pre>*|*:not(*)</pre> |
1020 | | - |
1021 | | - <p>The following selector matches any element that is not being hovered, |
1022 | | - regardless of its namespace. In particular, it is not limited to only |
1023 | | - matching elements in the default namespace that are not being hovered, |
1024 | | - and elements not in the default namespace don't match the rule when they |
1025 | | - <em>are</em> being hovered.</p> |
1026 | | - |
1027 | | - <pre>*|*:not(:hover)</pre> |
1028 | | - </div> |
| 1032 | + <p>Default namespace declarations do not affect the subject of any selector |
| 1033 | + within a negation pseudo-class unless the argument is an explicit |
| 1034 | + universal selector or a type selector. (See <a |
| 1035 | + href="#matches"><code>:matches()</code></a> for examples. |
1029 | 1036 |
|
1030 | 1037 | <p class=note><strong>Note</strong>: the :not() pseudo allows useless |
1031 | 1038 | selectors to be written. For instance <code>:not(*|*)</code>, which |
|
0 commit comments