Skip to content

Commit 22e360d

Browse files
committed
Editorial cleanup of :matches/:not section. Fix some anchors.
1 parent ad0989d commit 22e360d

2 files changed

Lines changed: 109 additions & 93 deletions

File tree

selectors4/Overview.html

Lines changed: 61 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515

1616
<h1 id=title>Selectors Level 4</h1>
1717

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>
1919

2020
<dl>
2121
<dt>This version:
2222

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> -->
2525
<a href="http://dev.w3.org/csswg/selectors4">
2626
http://dev.w3.org/csswg/selectors4</a>
2727

@@ -155,11 +155,11 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
155155
<li><a href="#logical-combination"><span class=secno>4. </span> Logical
156156
Combinations</a>
157157
<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>
160160

161161
<li><a href="#matches"><span class=secno>4.2. </span> The Matches-Any
162-
Psuedo-class: &lsquo;<code class=css>:matches()</code>&rsquo;</a>
162+
Pseudo-class: &lsquo;<code class=css>:matches()</code>&rsquo;</a>
163163

164164
<li><a href="#negation"><span class=secno>4.3. </span> The Negation
165165
Pseudo-class: &lsquo;<code class=css>:not()</code>&rsquo;</a>
@@ -800,15 +800,14 @@ <h3 id=structure><span class=secno>3.1. </span> Structure and Terminology</h3>
800800
<a href="#universal-selector">universal selector</a>. No other type
801801
selector or universal selector is allowed in the sequence.
802802

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
807806
href="#attribute-selectors">attribute selector</a>, <a
808807
href="#class-html">class selector</a>, <a href="#id-selectors">ID
809808
selector</a>, or <a href="#pseudo-classes">pseudo-class</a>.
810809

811-
<p><dfn id=combinators0>Combinators</dfn> are punctuation that represent a
810+
<p><dfn id=combinator>Combinators</dfn> are punctuation that represent a
812811
particular kind of relationship between the compound selectors on either
813812
side. Combinators in Selectors level 4 include: whitespace,
814813
&quot;greater-than sign&quot; (U+003E, <code>&gt;</code>), &quot;plus
@@ -914,7 +913,7 @@ <h3 id=invalid><span class=secno>3.5. </span> Invalid Selectors and Error
914913
<h2 id=logical-combination><span class=secno>4. </span> Logical
915914
Combinations</h2>
916915

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>
918917

919918
<p>A comma-separated list of selectors represents the union of all elements
920919
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>
960959
grouped, only the rule for <code>h2..foo</code> is dropped.)</p>
961960
</div>
962961

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:
964963
&lsquo;<code class=css>:matches()</code>&rsquo;</h3>
965964

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.
970968

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.
974975

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>
978997

979998
<h3 id=negation><span class=secno>4.3. </span> The Negation Pseudo-class:
980999
&lsquo;<code class=css>:not()</code>&rsquo;</h3>
9811000

9821001
<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.
9861005

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.
9891012

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>.
9921015

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>
9951019

9961020
<pre>button:not([DISABLED])</pre>
9971021

9981022
<p>The following selector represents all but <code>FOO</code> elements.</p>
9991023

10001024
<pre>*:not(FOO)</pre>
10011025

1002-
<p>The following group of selectors represents all HTML elements except
1026+
<p>The following compound selector represents all HTML elements except
10031027
links.</p>
10041028

10051029
<pre>html|*:not(:link):not(:visited)</pre>
10061030
</div>
10071031

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.
10291036

10301037
<p class=note><strong>Note</strong>: the :not() pseudo allows useless
10311038
selectors to be written. For instance <code>:not(*|*)</code>, which

selectors4/Overview.src.html

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ <h3 id=structure>
430430
(possibly implied) <a href="#universal-selector">universal selector</a>.
431431
No other type selector or universal selector is allowed in the sequence.</p>
432432

433-
<p>A <dfn><a name=simple-selectors-dfn></a><a
433+
<p>A <dfn><a name=simple></a><a
434434
href="#simple">simple selector</a></dfn> is either a <a
435435
href="#type-selectors">type selector</a>, <a
436436
href="#universal-selector">universal selector</a>, <a
@@ -439,7 +439,7 @@ <h3 id=structure>
439439
href="#id-selectors">ID selector</a>, or <a
440440
href="#pseudo-classes">pseudo-class</a>.</p>
441441

442-
<p><dfn>Combinators</dfn> are punctuation that represent a particular
442+
<p><dfn id=combinator>Combinators</dfn> are punctuation that represent a particular
443443
kind of relationship between the compound selectors on either side.
444444
Combinators in Selectors level 4 include: whitespace, &quot;greater-than
445445
sign&quot; (U+003E, <code>&gt;</code>), &quot;plus sign&quot; (U+002B,
@@ -535,7 +535,7 @@ <h2 id=logical-combination>
535535
Logical Combinations</h2>
536536

537537
<h3 id=grouping>
538-
Groups of selectors</h2>
538+
Selector Groups</h2>
539539

540540
<p>A comma-separated list of selectors represents the union of all
541541
elements selected by each of the individual selectors in the list.
@@ -575,62 +575,71 @@ <h3 id=grouping>
575575
</div>
576576

577577
<h3 id=matches>
578-
The Matches-Any Psuedo-class: '':matches()''</h3>
578+
The Matches-Any Pseudo-class: '':matches()''</h3>
579579

580-
<p>The <code>:matches(<var>X</var>)</code> pseudo-class is a functional
581-
notation taking a comma-separated list of <a href="#compound">compound
582-
selectors</a> as an argument. It represents an element that is represented
583-
by any of its arguments.
580+
<p>The matches pseudo-class, <code>:matches(<var>X</var>)</code>,
581+
is a functional notation taking a <a href="#grouping">selector group</a>
582+
as an argument. It represents an element that is represented by its argument.
584583

585-
<p><code>:matches()</code> may not be nested; <code>:matches(:matches(...))</code>
586-
is invalid.
587-
Also pseudo-elements are not valid within <code>:matches()</code>.</p>
584+
<p>In Selectors Level 4, only <a href="#compound">compound selectors</a>
585+
are allowed within <code>:matches()</code>:
586+
<a href="#combinator">combinators</a> are not allowed. Additionally,
587+
<code>:matches()</code> may not be nested within itself or within
588+
<code>:not()</code>: <code>:matches(:matches(...))</code> and
589+
<code>:not(:matches(...))</code> are invalid.</p>
588590

589-
<p>Default namespace declarations do not affect the argument of the
590-
matches-any pseudo-class unless the argument is a universal selector or a
591-
type selector. (See below for examples.)</p>
591+
<p>Pseudo-elements cannot be represented by the matches pseudo-class;
592+
they are not valid within <code>:matches()</code>.
593+
594+
<p>Default namespace declarations do not affect the subject of any selector
595+
within a matches-any pseudo-class unless the argument is an explicit
596+
universal selector or a type selector.</p>
597+
598+
<div class="example">
599+
<p>For example, following selector matches any element that is being
600+
hovered or focused, regardless of its namespace. In particular, it
601+
is not limited to only matching elements in the default namespace
602+
that are being hovered or focused.</p>
603+
<pre>*|*:matches(:hover, :focus)</pre>
604+
<p>The following selector, however, represents only hovered or focused
605+
elements that are in the default namespace, because it uses an explicit
606+
universal selector within the <code>:matches()</code> notation:</p>
607+
<pre>*|*:matches(*:hover, *:focus)</pre>
608+
</div>
592609

593610
<h3 id=negation>
594611
The Negation Pseudo-class: '':not()''</h3>
595612

596613
<p>The negation pseudo-class, <code>:not(<var>X</var>)</code>, is a
597-
functional notation taking a comma-separated list of <a href="#compound">compound
598-
selectors</a> as an argument. It represents an element that is not
599-
represented by any of its arguments.
614+
functional notation taking a <a href="#grouping">selector group</a>
615+
as an argument. It represents an element that is not represented
616+
by its argument.
617+
618+
<p>In Selectors Level 4, only <a href="#compound">compound selectors</a>
619+
are allowed within <code>:matches()</code>:
620+
<a href="#combinator">combinators</a> are not allowed. Additionally,
621+
negations may not be nested within itself or within <code>:matches()</code>:
622+
<code>:not(:not(...))</code> and <code>:matches(:not(...))</code> are invalid.
600623

601-
<p>Negations may not be nested; <code>:not(:not(...))</code> is invalid.
602-
Also pseudo-elements are not valid within <code>:not()</code>.</p>
624+
<p>Pseudo-elements cannot be represented by the negation pseudo-class;
625+
they are not valid within <code>:not()</code>.
603626

604627
<div class="example">
605-
<p>Examples:</p>
606-
<p>The following selector matches all <code>button</code>
628+
<p>For example, the following selector matches all <code>button</code>
607629
elements in an HTML document that are not disabled.</p>
608630
<pre>button:not([DISABLED])</pre>
609631
<p>The following selector represents all but <code>FOO</code>
610632
elements.</p>
611633
<pre>*:not(FOO)</pre>
612-
<p>The following group of selectors represents all HTML elements
634+
<p>The following compound selector represents all HTML elements
613635
except links.</p>
614636
<pre>html|*:not(:link):not(:visited)</pre>
615637
</div>
616638

617-
<p>Default namespace declarations do not affect the argument of the
618-
negation pseudo-class unless the argument is a universal selector or a
619-
type selector.</p>
620-
621-
<div class="example">
622-
<p>Examples:</p>
623-
<p>Assuming that the default namespace is bound to
624-
"http://example.com/", the following selector represents all
625-
elements that are not in that namespace:</p>
626-
<pre>*|*:not(*)</pre>
627-
<p>The following selector matches any element that is not being
628-
hovered, regardless of its namespace. In particular, it is not
629-
limited to only matching elements in the default namespace that are
630-
not being hovered, and elements not in the default namespace don't
631-
match the rule when they <em>are</em> being hovered.</p>
632-
<pre>*|*:not(:hover)</pre>
633-
</div>
639+
<p>Default namespace declarations do not affect the subject of any selector
640+
within a negation pseudo-class unless the argument is an explicit universal
641+
selector or a type selector. (See <a href="#matches"><code>:matches()</code></a>
642+
for examples.</p>
634643

635644
<p class="note"><strong>Note</strong>: the :not() pseudo allows
636645
useless selectors to be written. For instance <code>:not(*|*)</code>,

0 commit comments

Comments
 (0)