Skip to content

Commit 3f96ee1

Browse files
committed
[selectors] Some fixes from SimonSapin.
1 parent e213ad5 commit 3f96ee1

2 files changed

Lines changed: 80 additions & 68 deletions

File tree

selectors/Overview.html

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ <h2 class="no-num no-toc" id=status>Status of this Document</h2>
169169
of the CSS development process. See the <a href="#overview">Selectors
170170
Overview</a> for a summary of additions to level 3.
171171

172-
<p>The following features are at-risk and may be dropped during the CR
172+
<p>The following features are at-risk and may be dropped dURLng the CR
173173
period if there is not sufficient implementer interest: the reference
174174
combinator, the column combinator, the ‘<code
175175
class=css>:invalid-drop</code>’ and ‘<code
@@ -813,7 +813,7 @@ <h2 id=overview><span class=secno>2. </span> Selectors Overview</h2>
813813
<tr>
814814
<td><code>E:target</code>
815815

816-
<td>an E element being the target of the referring URI
816+
<td>an E element being the target of the referring URL
817817

818818
<td><a href="#target-pseudo">The target pseudo-class</a>
819819

@@ -1212,9 +1212,13 @@ <h3 id=profiles><span class=secno>2.1. </span> <a
12121212
for use in any context, including dynamic browser CSS selector matching.
12131213
It includes every selector defined in this document, except for:
12141214
<ul>
1215-
<li><a href="#combinator"><i>Combinators</i></a> within ‘<a
1216-
href="#matches-pseudo"><code class=css>:matches()</code></a>’ and
1217-
<a href="#negation-pseudo"><code class=css>:not()</code></a>’.
1215+
<li><a href="#combinator"><i>Combinators</i></a> within <a
1216+
href="#matches-pseudo"><code>:matches()</code></a>, <a
1217+
href="#negation-pseudo"><code>:not()</code></a>, <a
1218+
href="#nth-match-pseudo"><code>:nth-match()</code></a>, and <a
1219+
href="#nth-last-match-pseudo"><code>:nth-last-match()</code></a>.
1220+
<p class=issue>We are considering whether this restriction should be
1221+
lifted.
12181222

12191223
<li>The <a href=idref-combinators>reference combinator</a>
12201224

@@ -2297,14 +2301,14 @@ <h3 id=id-selectors><span class=secno>6.7. </span> ID selectors</h3>
22972301
attribute on an element is considered the “ID attribute“ is defined by
22982302
the document language.
22992303

2300-
<p>An ID-typed attribute of a document language allows authors to assign an
2301-
identifier to one element instance in the document tree. An <dfn
2302-
id=id-selector>ID selector</dfn> contains a “number sign” (U+0023,
2303-
<code>#</code>) immediately followed by the ID value, which must be a CSS
2304-
<a
2304+
<p>An <dfn id=id-selector>ID selector</dfn> consists of a “number sign”
2305+
(U+0023, <code>#</code>) immediately followed by the ID value, which must
2306+
be a CSS <a
23052307
href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifier</a>.
23062308
An ID selector represents an element instance that has an identifier that
2307-
matches the identifier in the ID selector.
2309+
matches the identifier in the ID selector. (It is possible in
2310+
non-conforming documents for multiple elements to match a single ID
2311+
selector.)
23082312

23092313
<p class=issue> In Quirks Mode, we accept all hash tokens, not just ones
23102314
whose value matches the ident syntax. Should we change the Standards Mode
@@ -2415,9 +2419,9 @@ <h3 id=local-pseudo><span class=secno>7.3. </span> The local link
24152419
site-internal versus site-external links. The <a
24162420
href="#local-link-pseudo"><code>:local-link</code></a> pseudo-class
24172421
represents an element that is the source anchor of a hyperlink whose
2418-
target's absolute URI matches the element's own document URI. The fragment
2419-
identifier of the document URI is stripped before matching against the
2420-
link's URI; otherwise all portions of the URI are considered.
2422+
target's absolute URL matches the element's own document URL. Any fragment
2423+
identifiers are stripped before matching the document's URL against the
2424+
link's URL; otherwise all portions of the URL are considered.
24212425

24222426
<div class=example>
24232427
<p>For example, the following rule prevents links targetting the current
@@ -2427,19 +2431,20 @@ <h3 id=local-pseudo><span class=secno>7.3. </span> The local link
24272431
</div>
24282432

24292433
<p>The pseudo-class can also accept a non-negative integer as its sole
2430-
argument, which, if the document's URI is a URL, indicates the number of
2431-
path levels to match: an argument of zero represents a link element whose
2432-
target is in the same domain as the document's URI, ‘<code
2433-
class=css>1</code>’ represents a link element whose target has the same
2434+
argument, which, if the document's URL is hierarchical, indicates the
2435+
number of path levels to match: an argument of ‘<code
2436+
class=css>0</code>’ represents a link element whose target is in the
2437+
same domain as the document's URL, ‘<code
2438+
class=css>1</code>’represents a link element whose target has the same
24342439
domain and first path segment, ‘<code class=css>2</code>’ represents a
24352440
link element whose target has the same domain, first, and second path
24362441
segments, etc. Path segments are portions of the URL's path that are
24372442
separated by forward slashes (/). If a segment is missing from the
24382443
document's URL, a pseudo-class requiring that segment to match does not
2439-
match anything. Similarly if the document's URI is not a URL, the
2440-
pseudo-class does not match anything. The scheme, username, password,
2441-
port, query string, and fragment portions of the URL are not considered
2442-
when matching against <code>:local-link(<var>n</var>)</code>.
2444+
match anything. Similarly if the document's URL is not hierarchical, the
2445+
functional pseudo-class does not match anything. The scheme, username,
2446+
password, port, query string, and fragment portions of the URL are not
2447+
considered when matching against <code>:local-link(<var>n</var>)</code>.
24432448

24442449
<p class=issue>Is there such a thing as IRL? Because we do want this to
24452450
work for internationalized URLs, just not URNs.
@@ -2475,7 +2480,7 @@ <h3 id=local-pseudo><span class=secno>7.3. </span> The local link
24752480
<li><code>a:local-link(3) {...}</code>
24762481
</ol>
24772482

2478-
<p>If the document's URI is <code>http://www.example.com/2011/03/</code>:
2483+
<p>If the document's URL is <code>http://www.example.com/2011/03/</code>:
24792484

24802485
<ol>
24812486
<li>Link 1 would receive Style 2
@@ -2521,7 +2526,7 @@ <h3 id=the-target-pseudo><span class=secno>7.4. </span> The target
25212526
<pre>p.note:target</pre>
25222527

25232528
<p>This selector represents a <code>p</code> element of class
2524-
<code>note</code> that is the target element of the referring URI.
2529+
<code>note</code> that is the target element of the referring URL.
25252530
</div>
25262531

25272532
<div class=example>
@@ -2751,8 +2756,8 @@ <h2 id=time-pseudos><span class=secno>9. </span> Time-dimensional
27512756
Pseudo-classes</h2>
27522757

27532758
<p>These pseudo-classes classify elements with respect to the
2754-
currently-displayed or active position in some timeline, such as during
2755-
speech rendering of a document, or during the display of a video using
2759+
currently-displayed or active position in some timeline, such as dURLng
2760+
speech rendering of a document, or dURLng the display of a video using
27562761
WebVTT to render subtitles.
27572762

27582763
<h3 id=the-current-pseudo><span class=secno>9.1. </span> The
@@ -3706,6 +3711,12 @@ <h3 id=selected-child-index><span class=secno>12.7. </span> Selected
37063711
class=css>:nth-last-match()</code></a>’ pseudo-classes allow one to
37073712
build a selector for the latter interpretation.
37083713

3714+
<p>In the <a href="#fast-profile"><i>fast</i></a> Selectors profile, only
3715+
lists of <a href="#compound"><i>compound selectors</i></a> are allowed
3716+
within these selectors. In the <a
3717+
href="#complete-profile"><i>complete</i></a> profile, full <a
3718+
href="#complex"><i>complex selectors</i></a> are allowed.
3719+
37093720
<h4 id=the-nth-match-pseudo><span class=secno>12.7.1. </span> <a
37103721
href="#nth-match-pseudo"><code>:nth-match()</code></a> pseudo-class</h4>
37113722

selectors/Overview.src.html

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ <h2 class="no-num no-toc" id="status">Status of this Document</h2>
9090
See the <a href="#overview">Selectors Overview</a> for a summary of
9191
additions to level 3.
9292

93-
<p>The following features are at-risk and may be dropped during the CR period
93+
<p>The following features are at-risk and may be dropped dURLng the CR period
9494
if there is not sufficient implementer interest:
9595
the reference combinator,
9696
the column combinator,
@@ -306,7 +306,7 @@ <h2 id="overview">
306306
<td>4
307307
<tr>
308308
<td><code>E:target</code>
309-
<td>an E element being the target of the referring URI
309+
<td>an E element being the target of the referring URL
310310
<td><a href="#target-pseudo">The target pseudo-class</a>
311311
<td>3
312312
<tr>
@@ -540,7 +540,8 @@ <h3 id="profiles">
540540
except for:
541541

542542
<ul>
543-
<li><i>Combinators</i> within '':matches()'' and '':not()''.
543+
<li><i>Combinators</i> within <code>:matches()</code>, <code>:not()</code>, <code>:nth-match()</code>, and <code>:nth-last-match()</code>.
544+
<p class='issue'>We are considering whether this restriction should be lifted.
544545
<li>The <a href="idref-combinators">reference combinator</a>
545546
<li>The <a href="#subject">subject indicator</a>
546547
</ul>
@@ -1484,23 +1485,22 @@ <h3 id="class-html">
14841485
<h3 id="id-selectors">
14851486
ID selectors</h3>
14861487

1487-
<p>Document languages may contain attributes that are declared to be
1488-
of type ID. What makes attributes of type ID special is that no two
1489-
such attributes can have the same value in a conformant document,
1490-
regardless of the type of the elements that carry them; whatever the
1491-
document language, an ID typed attribute can be used to uniquely
1492-
identify its element. In HTML all ID attributes are named <code>id</code>;
1493-
XML applications may name ID attributes differently,
1494-
but the same restriction applies.
1495-
Which attribute on an element is considered the “ID attribute“ is defined by the document language.
1496-
1497-
<p>An ID-typed attribute of a document language allows authors to
1498-
assign an identifier to one element instance in the document tree. An
1499-
<dfn>ID selector</dfn> contains a “number sign” (U+0023, <code>#</code>)
1500-
immediately followed by the ID value, which must be a
1501-
CSS <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifier</a>.
1502-
An ID selector represents an element instance that has an
1503-
identifier that matches the identifier in the ID selector.
1488+
<p>Document languages may contain attributes that are declared to be of type ID.
1489+
What makes attributes of type ID special
1490+
is that no two such attributes can have the same value in a conformant document,
1491+
regardless of the type of the elements that carry them;
1492+
whatever the document language,
1493+
an ID typed attribute can be used to uniquely identify its element.
1494+
In HTML all ID attributes are named <code>id</code>;
1495+
XML applications may name ID attributes differently,
1496+
but the same restriction applies.
1497+
Which attribute on an element is considered the “ID attribute“ is defined by the document language.
1498+
1499+
<p>An <dfn>ID selector</dfn> consists of a “number sign” (U+0023, <code>#</code>)
1500+
immediately followed by the ID value,
1501+
which must be a CSS <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifier</a>.
1502+
An ID selector represents an element instance that has an identifier that matches the identifier in the ID selector.
1503+
(It is possible in non-conforming documents for multiple elements to match a single ID selector.)
15041504

15051505
<p class='issue'>
15061506
In Quirks Mode, we accept all hash tokens, not just ones whose value matches the ident syntax.
@@ -1598,11 +1598,10 @@ <h3 id="local-pseudo">
15981598
<a href="#the-any-link-pseudo">hyperlinks</a> based on the users current location within a site and to
15991599
differentiate site-internal versus site-external links. The
16001600
<code>:local-link</code> pseudo-class represents an element that is
1601-
the source anchor of a hyperlink whose target's absolute URI
1602-
matches the element's own document URI.
1603-
The fragment identifier of the document URI is stripped before
1604-
matching against the link's URI; otherwise all portions of the
1605-
URI are considered.
1601+
the source anchor of a hyperlink whose target's absolute URL
1602+
matches the element's own document URL.
1603+
Any fragment identifiers are stripped before matching the document's URL against the link's URL;
1604+
otherwise all portions of the URL are considered.
16061605

16071606
<div class="example">
16081607
<p>For example, the following rule prevents links targetting the
@@ -1611,20 +1610,19 @@ <h3 id="local-pseudo">
16111610
<pre>nav :local-link { text-decoration: none; }</pre>
16121611
</div>
16131612

1614-
<p>The pseudo-class can also accept a non-negative integer as its sole
1615-
argument, which, if the document's URI is a URL, indicates the number
1616-
of path levels to match: an argument of zero represents a link element
1617-
whose target is in the same domain as the document's URI, ''1''
1618-
represents a link element whose target has the same domain and first
1619-
path segment, ''2'' represents a link element whose target has the same
1620-
domain, first, and second path segments, etc. Path segments are portions
1621-
of the URL's path that are separated by forward slashes (/). If a segment
1622-
is missing from the document's URL, a pseudo-class requiring that segment
1623-
to match does not match anything. Similarly if the document's URI is
1624-
not a URL, the pseudo-class does not match anything. The scheme,
1625-
username, password, port, query string, and fragment portions of the
1626-
URL are not considered when matching against
1627-
<code>:local-link(<var>n</var>)</code>.
1613+
<p>The pseudo-class can also accept a non-negative integer as its sole argument,
1614+
which, if the document's URL is hierarchical,
1615+
indicates the number of path levels to match:
1616+
an argument of ''0'' represents a link element whose target is in the same domain as the document's URL,
1617+
''1''represents a link element whose target has the same domain and first path segment,
1618+
''2'' represents a link element whose target has the same domain, first, and second path segments, etc.
1619+
Path segments are portions of the URL's path that are separated by forward slashes (/).
1620+
If a segment is missing from the document's URL,
1621+
a pseudo-class requiring that segment to match does not match anything.
1622+
Similarly if the document's URL is not hierarchical,
1623+
the functional pseudo-class does not match anything.
1624+
The scheme, username, password, port, query string, and fragment portions of the URL are not considered
1625+
when matching against <code>:local-link(<var>n</var>)</code>.
16281626

16291627
<p class="issue">Is there such a thing as IRL? Because we do want this
16301628
to work for internationalized URLs, just not URNs.
@@ -1646,7 +1644,7 @@ <h3 id="local-pseudo">
16461644
<li><code>a:local-link(2) {...}</code>
16471645
<li><code>a:local-link(3) {...}</code>
16481646
</ol>
1649-
<p>If the document's URI is <code>http://www.example.com/2011/03/</code>:
1647+
<p>If the document's URL is <code>http://www.example.com/2011/03/</code>:
16501648
<ol>
16511649
<li>Link 1 would receive Style 2
16521650
<li>Link 2 would receive Styles 2 and 3
@@ -1684,7 +1682,7 @@ <h3 id="the-target-pseudo">
16841682
<pre>p.note:target</pre>
16851683
<p>This selector represents a <code>p</code> element of class
16861684
<code>note</code> that is the target element of the referring
1687-
URI.
1685+
URL.
16881686
</div>
16891687

16901688
<div class="example">
@@ -1847,7 +1845,7 @@ <h2 id="time-pseudos">
18471845

18481846
<p>These pseudo-classes classify elements with respect to the
18491847
currently-displayed or active position in some timeline, such as
1850-
during speech rendering of a document, or during the display of
1848+
dURLng speech rendering of a document, or dURLng the display of
18511849
a video using WebVTT to render subtitles.
18521850

18531851
<h3 id="the-current-pseudo">
@@ -2627,6 +2625,9 @@ <h3 id="selected-child-index">
26272625
The '':nth-match()'' and '':nth-last-match()'' pseudo-classes
26282626
allow one to build a selector for the latter interpretation.
26292627

2628+
<p>In the <i>fast</i> Selectors profile, only lists of <i>compound selectors</i> are allowed within these selectors.
2629+
In the <i>complete</i> profile, full <i>complex selectors</i> are allowed.
2630+
26302631
<h4 id="the-nth-match-pseudo">
26312632
<code>:nth-match()</code> pseudo-class</h4>
26322633

0 commit comments

Comments
 (0)