Skip to content

Commit a989782

Browse files
committed
1 parent f9e915e commit a989782

2 files changed

Lines changed: 85 additions & 95 deletions

File tree

selectors4/Overview.html

Lines changed: 51 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<html lang=en>
44
<head>
55
<title>Selectors Level 4</title>
6-
<link href=default.css rel=stylesheet type="text/css">
6+
<link href="../css-module/default.css" rel=stylesheet type="text/css">
77

88
<style type="text/css">
99
.tprofile td, th { vertical-align: baseline; padding: 0 0.5em; }
@@ -19,13 +19,13 @@
1919

2020
<h1 id=title>Selectors Level 4</h1>
2121

22-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 10 October
22+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 4 November
2323
2011</h2>
2424

2525
<dl>
2626
<dt>This version: <!--
27-
<dd><a href="http://www.w3.org/TR/2011/ED-selectors4-20111010/">
28-
http://www.w3.org/TR/2011/WD-selectors4-20111010/</a>
27+
<dd><a href="http://www.w3.org/TR/2011/ED-selectors4-20111104/">
28+
http://www.w3.org/TR/2011/WD-selectors4-20111104/</a>
2929
3030
<dt>Editor's draft:
3131
-->
@@ -301,7 +301,7 @@ <h2 class="no-num no-toc" id=contents>Table of Contents</h2>
301301
class=css>:dir()</code>&rsquo;</a>
302302

303303
<li><a href="#lang-pseudo"><span class=secno>10.2. </span> The language
304-
pseudo-class &lsquo;<code class=css>:lang</code>&rsquo;</a>
304+
pseudo-class &lsquo;<code class=css>:lang()</code>&rsquo;</a>
305305
</ul>
306306

307307
<li><a href="#ui-states-pseudos"><span class=secno>11. </span> The UI
@@ -557,15 +557,6 @@ <h2 id=overview><span class=secno>2. </span> Selectors Overview</h2>
557557
<td>1
558558

559559
<tbody>
560-
<tr>
561-
<td><code>E:not(<var>s</var>)</code>
562-
563-
<td>an E element that does not match simple selector <var>s</var>
564-
565-
<td><a href="#negation">Negation pseudo-class</a>
566-
567-
<td>3
568-
569560
<tr>
570561
<td><code>E:not(<var>s1</var>, <var>s2</var>)</code>
571562

@@ -574,7 +565,7 @@ <h2 id=overview><span class=secno>2. </span> Selectors Overview</h2>
574565

575566
<td><a href="#negation">Negation pseudo-class</a>
576567

577-
<td>4
568+
<td>3/4
578569

579570
<tr>
580571
<td><code>E:matches(<var>s1</var>, <var>s2</var>)</code>
@@ -698,14 +689,14 @@ <h2 id=overview><span class=secno>2. </span> Selectors Overview</h2>
698689
<td>2
699690

700691
<tr>
701-
<td><code>E:lang(fr)</code>
692+
<td><code>E:lang(fr, en)</code>
702693

703-
<td>an element of type E in language "fr" (the document language
704-
specifies how language is determined)
694+
<td>an element of type E in either language "fr" or language "en" (the
695+
document language specifies how language is determined)
705696

706697
<td><a href="#lang-pseudo">The :lang() pseudo-class</a>
707698

708-
<td>2
699+
<td>2/4
709700

710701
<tbody>
711702
<tr>
@@ -1456,6 +1447,9 @@ <h3 id=negation><span class=secno>4.3. </span> The Negation Pseudo-class:
14561447
<code>:matches()</code>: <code>:not(:not(...))</code> and
14571448
<code>:matches(:not(...))</code> are invalid.
14581449

1450+
<p class=note>In Selectors Level 3, only a single <a href="#simple">simple
1451+
selector</a> was allowed as the argument to <code>:not()</code>.
1452+
14591453
<p>Pseudo-elements cannot be represented by the negation pseudo-class; they
14601454
are not valid within <code>:not()</code>.
14611455

@@ -2428,36 +2422,34 @@ <h3 id=dir-pseudo><span class=secno>10.1. </span> The directionality
24282422
href="#HTML5" rel=biblioentry>[HTML5]<!--{{HTML5}}--></a>
24292423

24302424
<h3 id=lang-pseudo><span class=secno>10.2. </span> The language
2431-
pseudo-class &lsquo;<code class=css>:lang</code>&rsquo;</h3>
2425+
pseudo-class &lsquo;<code class=css>:lang()</code>&rsquo;</h3>
24322426

24332427
<p>If the document language specifies how the human language of an element
24342428
is determined, it is possible to write selectors that represent an element
2435-
based on its language. For example, in HTML <a href="#HTML401"
2429+
based on its language. The <code>:lang()</code> pseudo-class represents an
2430+
element that is in one of the languages listed in its argument. It accepts
2431+
a comma-separated list of one or more language identifiers as its
2432+
argument. Each language identifier in <code>:lang()</code> must be a valid
2433+
CSS <a
2434+
href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifier</a>
2435+
for the selector to be valid. <a href="#CSS21"
2436+
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
2437+
2438+
<p>The language of an element is defined by the document language. For
2439+
example, in HTML <a href="#HTML401"
24362440
rel=biblioentry>[HTML401]<!--{{HTML401}}--></a>, the language is
2437-
determined by a combination of the <code>lang</code> attribute and
2438-
possibly information from the <code>meta</code> elements or the protocol
2439-
(such as HTTP headers). XML uses an attribute called
2440-
<code>xml:lang</code>, and there may be other document language-specific
2441-
methods for determining the language.
2442-
2443-
<p>The pseudo-class <code>:lang(C)</code> represents an element that is in
2444-
language C. Whether an element is represented by a <code>:lang()</code>
2445-
selector is based solely on the element's language value (normalized to
2446-
BCP 47 syntax if necessary) being equal to the identifier C, or beginning
2447-
with the identifier C immediately followed by "-" (U+002D). The matching
2448-
of C against the element's language value is performed case-insensitively
2449-
within the ASCII range. The identifier C does not have to be a valid
2450-
language name.
2441+
determined by a combination of the <code>lang</code> attribute,
2442+
information from <code>meta</code> elements, and possibly also the
2443+
protocol (e.g. from HTTP headers). XML languages can use the
2444+
<code>xml:lang</code> attribute to indicate language information for an
2445+
element.
24512446

2452-
<p class=issue>It's been <a
2453-
href="http://lists.w3.org/Archives/Public/www-international/2011OctDec/0000.html">proposed</a>
2454-
to allow :lang() to take a comma-separated list, as this will make an
2455-
easier syntax when multiple languages need to be selected against.
2456-
2457-
<p>C must be a valid CSS <a
2458-
href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifier</a>
2459-
<a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a> and must not
2460-
be empty. (Otherwise, the selector is invalid.)
2447+
<p>The element's language matches a language identifier if the element's
2448+
language value (normalized to BCP 47 syntax if necessary) either is equal
2449+
to the language identifier or begins with the identifier and is
2450+
immediately followed by "-" (U+002D). The matching is performed
2451+
case-insensitively within the ASCII range. The language identifier does
2452+
not need to be a valid language code to perform this comparison.
24612453

24622454
<p class=note><strong>Note:</strong> It is recommended that documents and
24632455
protocols indicate language using codes from BCP 47 <a href="#BCP47"
@@ -2480,8 +2472,8 @@ <h3 id=lang-pseudo><span class=secno>10.2. </span> The language
24802472
:lang(de) &gt; q</pre>
24812473
</div>
24822474

2483-
<p>The difference between <code>:lang(C)</code> and the &lsquo;<code
2484-
class=css>|=</code>&rsquo; operator is that the &lsquo;<code
2475+
<p class=note>One difference between <code>:lang(C)</code> and the
2476+
&lsquo;<code class=css>|=</code>&rsquo; operator is that the &lsquo;<code
24852477
class=css>|=</code>&rsquo; operator only performs a comparison against a
24862478
given attribute on the element, while the <code>:lang(C)</code>
24872479
pseudo-class uses the UAs knowledge of the document's semantics to perform
@@ -3766,20 +3758,20 @@ <h3 id=normative-references><span class=secno>20.1. </span> Normative
37663758
<dt id=CSS21>[CSS21]
37673759

37683760
<dd>Bert Bos; et al. <a
3769-
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/"><cite>Cascading Style
3761+
href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
37703762
Sheets Level 2 Revision 1 (CSS&#160;2.1) Specification.</cite></a> 7 June
37713763
2011. W3C Recommendation. URL: <a
3772-
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">http://www.w3.org/TR/2011/REC-CSS2-20110607/</a>
3764+
href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
37733765
</dd>
37743766
<!---->
37753767

37763768
<dt id=CSS3NAMESPACE>[CSS3NAMESPACE]
37773769

37783770
<dd>Elika J. Etemad; Anne van Kesteren. <a
3779-
href="http://www.w3.org/TR/2008/CR-css3-namespace-20080523/"><cite>CSS
3780-
Namespaces Module.</cite></a> 23 May 2008. W3C Candidate Recommendation.
3781-
(Work in progress.) URL: <a
3782-
href="http://www.w3.org/TR/2008/CR-css3-namespace-20080523/">http://www.w3.org/TR/2008/CR-css3-namespace-20080523/</a>
3771+
href="http://www.w3.org/TR/2011/REC-css3-namespace-20110929/"><cite>CSS
3772+
Namespaces Module.</cite></a> 29 September 2011. W3C Recommendation. URL:
3773+
<a
3774+
href="http://www.w3.org/TR/2011/REC-css3-namespace-20110929/">http://www.w3.org/TR/2011/REC-css3-namespace-20110929/</a>
37833775
</dd>
37843776
<!---->
37853777

@@ -3801,10 +3793,9 @@ <h3 id=normative-references><span class=secno>20.1. </span> Normative
38013793
<dt id=SELECT>[SELECT]
38023794

38033795
<dd>Tantek &#199;elik; et al. <a
3804-
href="http://www.w3.org/TR/2009/PR-css3-selectors-20091215"><cite>Selectors
3805-
Level 3.</cite></a> 15 December 2009. W3C Proposed Recommendation. (Work
3806-
in progress.) URL: <a
3807-
href="http://www.w3.org/TR/2009/PR-css3-selectors-20091215">http://www.w3.org/TR/2009/PR-css3-selectors-20091215</a>
3796+
href="http://www.w3.org/TR/2011/REC-css3-selectors-20110929/"><cite>Selectors
3797+
Level 3.</cite></a> 29 September 2011. W3C Recommendation. URL: <a
3798+
href="http://www.w3.org/TR/2011/REC-css3-selectors-20110929/">http://www.w3.org/TR/2011/REC-css3-selectors-20110929/</a>
38083799
</dd>
38093800
<!---->
38103801

@@ -3916,10 +3907,10 @@ <h3 id=informative-references><span class=secno>20.2. </span> Informative
39163907
<dt id=SVG11>[SVG11]
39173908

39183909
<dd>Erik Dahlstr&#246;m; et al. <a
3919-
href="http://www.w3.org/TR/2011/PR-SVG11-20110609/"><cite>Scalable Vector
3920-
Graphics (SVG) 1.1 (Second Edition).</cite></a> 9 June 2011. W3C Proposed
3921-
Recommendation. (Work in progress.) URL: <a
3922-
href="http://www.w3.org/TR/2011/PR-SVG11-20110609/">http://www.w3.org/TR/2011/PR-SVG11-20110609/</a>
3910+
href="http://www.w3.org/TR/2011/REC-SVG11-20110816/"><cite>Scalable
3911+
Vector Graphics (SVG) 1.1 (Second Edition).</cite></a> 16 August 2011.
3912+
W3C Recommendation. URL: <a
3913+
href="http://www.w3.org/TR/2011/REC-SVG11-20110816/">http://www.w3.org/TR/2011/REC-SVG11-20110816/</a>
39233914
</dd>
39243915
<!---->
39253916

selectors4/Overview.src.html

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<title>Selectors Level 4</title>
5-
<link href="default.css" type="text/css" rel="stylesheet">
5+
<link href="../css-module/default.css" type="text/css" rel="stylesheet">
66
<style type="text/css">
77
.tprofile td, th { vertical-align: baseline; padding: 0 0.5em; }
88
.tprofile th { text-align: right; }
@@ -166,17 +166,12 @@ <h2 id=overview>
166166
<td><a href="#type-selectors">Type selector</a>
167167
<td>1
168168
<tbody>
169-
<tr>
170-
<td><code>E:not(<var>s</var>)</code>
171-
<td>an E element that does not match simple selector <var>s</var>
172-
<td><a href="#negation">Negation pseudo-class</a>
173-
<td>3
174169
<tr>
175170
<td><code>E:not(<var>s1</var>, <var>s2</var>)</code>
176171
<td>an E element that does not match either compound selector <var>s1</var>
177172
or compound selector <var>s2</var>
178173
<td><a href="#negation">Negation pseudo-class</a>
179-
<td>4
174+
<td>3/4
180175
<tr>
181176
<td><code>E:matches(<var>s1</var>, <var>s2</var>)</code>
182177
<td>an E element that matches compound selector <var>s1</var>
@@ -251,11 +246,11 @@ <h2 id=overview>
251246
<td><a href="#dir-pseudo">The :dir() pseudo-class</a>
252247
<td>2
253248
<tr>
254-
<td><code>E:lang(fr)</code>
255-
<td>an element of type E in language "fr" (the document
256-
language specifies how language is determined)
249+
<td><code>E:lang(fr, en)</code>
250+
<td>an element of type E in either language "fr" or language "en"
251+
(the document language specifies how language is determined)
257252
<td><a href="#lang-pseudo">The :lang() pseudo-class</a>
258-
<td>2
253+
<td>2/4
259254
<tbody>
260255
<tr>
261256
<td><code>E:any-link</code>
@@ -801,6 +796,10 @@ <h3 id=negation>
801796
negations may not be nested within itself or within <code>:matches()</code>:
802797
<code>:not(:not(...))</code> and <code>:matches(:not(...))</code> are invalid.
803798

799+
<p class="note">In Selectors Level 3, only a single
800+
<a href="#simple">simple selector</a> was allowed as the argument to
801+
<code>:not()</code>.
802+
804803
<p>Pseudo-elements cannot be represented by the negation pseudo-class;
805804
they are not valid within <code>:not()</code>.
806805

@@ -1698,32 +1697,32 @@ <h3 id="dir-pseudo">
16981697
directionality of the elements as determined by its contents. [[HTML5]]
16991698

17001699
<h3 id=lang-pseudo>
1701-
The language pseudo-class '':lang''</h3>
1700+
The language pseudo-class '':lang()''</h3>
17021701

17031702
<p>If the document language specifies how the human language of an
17041703
element is determined, it is possible to write selectors that
1705-
represent an element based on its language. For example, in HTML [[HTML401]], the language is determined by a
1706-
combination of the <code>lang</code> attribute and possibly
1707-
information from the <code>meta</code> elements or the protocol (such
1708-
as HTTP headers). XML uses an attribute called <code>xml:lang</code>,
1709-
and there may be other document language-specific methods for
1710-
determining the language.</p>
1711-
1712-
<p>The pseudo-class <code>:lang(C)</code> represents an element that
1713-
is in language C. Whether an element is represented by a
1714-
<code>:lang()</code> selector is based solely on the element's
1715-
language value (normalized to BCP 47 syntax if necessary) being
1716-
equal to the identifier C, or beginning with the identifier C
1717-
immediately followed by "-" (U+002D). The matching of C against the
1718-
element's language value is performed case-insensitively within the ASCII range.
1719-
The identifier C does not have to be a valid language name.</p>
1720-
1721-
<p class="issue">It's been <a href="http://lists.w3.org/Archives/Public/www-international/2011OctDec/0000.html">proposed</a>
1722-
to allow :lang() to take a comma-separated list, as this will make
1723-
an easier syntax when multiple languages need to be selected against.
1724-
1725-
<p>C must be a valid CSS <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifier</a> [[!CSS21]]
1726-
and must not be empty. (Otherwise, the selector is invalid.)</p>
1704+
represent an element based on its language.
1705+
The <code>:lang()</code> pseudo-class represents an element that
1706+
is in one of the languages listed in its argument. It accepts
1707+
a comma-separated list of one or more language identifiers as its
1708+
argument. Each language identifier in <code>:lang()</code> must be
1709+
a valid CSS <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifier</a>
1710+
for the selector to be valid. [[!CSS21]]
1711+
1712+
<p>The language of an element is defined by the document language.
1713+
For example, in HTML [[HTML401]], the language is determined by a
1714+
combination of the <code>lang</code> attribute, information from
1715+
<code>meta</code> elements, and possibly also the protocol (e.g.
1716+
from HTTP headers). XML languages can use the <code>xml:lang</code>
1717+
attribute to indicate language information for an element.
1718+
1719+
<p>The element's language matches a language identifier if the element's
1720+
language value (normalized to BCP 47 syntax if necessary) either is equal
1721+
to the language identifier or begins with the identifier and is
1722+
immediately followed by "-" (U+002D).
1723+
The matching is performed case-insensitively within the ASCII range.
1724+
The language identifier does not need to be a valid language code to
1725+
perform this comparison.</p>
17271726

17281727
<p class="note"><strong>Note:</strong> It is recommended that
17291728
documents and protocols indicate language using codes from BCP 47 [[BCP47]] or its successor, and by means of
@@ -1743,7 +1742,7 @@ <h3 id=lang-pseudo>
17431742
:lang(de) &gt; q</pre>
17441743
</div>
17451744

1746-
<p>The difference between <code>:lang(C)</code> and the '|=' operator
1745+
<p class="note">One difference between <code>:lang(C)</code> and the '|=' operator
17471746
is that the '|=' operator only performs a comparison against a given
17481747
attribute on the element, while the <code>:lang(C)</code> pseudo-class
17491748
uses the UAs knowledge of the document's semantics to perform the

0 commit comments

Comments
 (0)