1313 rel =dcterms.rights >
1414 < meta content ="Selectors Level 3 " name =dcterms.title >
1515 < meta content =text name =dcterms.type >
16- < meta content =2017-05-16 name =dcterms.date >
16+ < meta content =2017-05-17 name =dcterms.date >
1717 < meta content ="" name =dcterms.creator >
1818 < meta content =W3C name =dcterms.publisher >
1919 < meta content ="https://dev.w3.org/csswg/css3-selectors/ "
3030
3131 < h1 id =title > Selectors Level 3</ h1 >
3232
33- < h2 class ="no-num no-toc "> Editor's Draft 16 May 2017</ h2 >
33+ < h2 class ="no-num no-toc "> Editor's Draft 17 May 2017</ h2 >
3434
3535 < dl >
3636 < dt > This version:
3737
3838 < dd > <!-- <a href="https://dev.w3.org/csswg/css3-selectors/">
39- https://www.w3.org/TR/2017/REC-css3-selectors-20170516 </a> -->
39+ https://www.w3.org/TR/2017/REC-css3-selectors-20170517 </a> -->
4040 < a href ="https://drafts.csswg.org/selectors3 ">
4141 https://drafts.csswg.org/selectors3</ a >
4242
@@ -396,6 +396,8 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
396396
397397 < li > < a href ="#informative-references "> < span class =secno > 15.2.
398398 </ span > Informative References</ a >
399+
400+ < li > < a href ="#changes "> < span class =secno > 15.3. </ span > Changes</ a >
399401 </ ul >
400402 </ ul >
401403 <!--end-toc--> </ nav >
@@ -1888,9 +1890,8 @@ <h4 id=structural-pseudos><span class=secno>6.6.5. </span>Structural
18881890 cannot be represented by other simple selectors or combinators.
18891891
18901892 < p > Standalone text and other non-element nodes are not counted when
1891- calculating the position of an element in the list of children of its
1892- parent. When calculating the position of an element in the list of
1893- children of its parent, the index numbering starts at 1.
1893+ calculating the position of an element in its list of siblings; index
1894+ numbering starts at 1.
18941895
18951896 < h5 id =root-pseudo > < span class =secno > 6.6.5.1. </ span > :root pseudo-class</ h5 >
18961897
@@ -1908,15 +1909,15 @@ <h5 id=nth-child-pseudo><span class=secno>6.6.5.2. </span>:nth-child()
19081909 pseudo-class notation represents an element that has
19091910 < var > a</ var > < code > n</ code > +< var > b</ var > -1 siblings < a
19101911 href ="#sel-before "> < strong > before</ strong > </ a > it in the document tree,
1911- for any positive integer or zero value of < code > n</ code > , and has a parent
1912- element . For values of < var > a</ var > and < var > b</ var > greater than zero,
1913- this effectively divides the element's children into groups of
1914- < var > a</ var > elements (the last group taking the remainder), and selecting
1915- the < var > b</ var > th element of each group. For example, this allows the
1916- selectors to address every other row in a table, and could be used to
1917- alternate the color of paragraph text in a cycle of four. The < var > a </ var >
1918- and < var > b</ var > values must be integers (positive, negative, or zero).
1919- The index of the first child of an element is 1.
1912+ for any positive integer or zero value of < code > n</ code > . It is not
1913+ required to have a parent . For values of < var > a</ var > and < var > b</ var >
1914+ greater than zero, this effectively divides the element's children into
1915+ groups of < var > a</ var > elements (the last group taking the remainder), and
1916+ selecting the < var > b</ var > th element of each group. For example, this
1917+ allows the selectors to address every other row in a table, and could be
1918+ used to alternate the color of paragraph text in a cycle of four. The
1919+ < var > a </ var > and < var > b</ var > values must be integers (positive, negative,
1920+ or zero). The index of the first child of an element is 1.
19201921
19211922 < p > In addition to this, < code > :nth-child()</ code > can take ‘< code
19221923 class =css > < code > odd</ code > </ code > ’ and ‘< code
@@ -2047,9 +2048,10 @@ <h5 id=nth-last-child-pseudo><span class=secno>6.6.5.3.
20472048 pseudo-class notation represents an element that has
20482049 < var > a</ var > < code > n</ code > +< var > b</ var > -1 siblings < a
20492050 href ="#sel-after "> < strong > after</ strong > </ a > it in the document tree, for
2050- any positive integer or zero value of < code > n</ code > , and has a parent
2051- element. See < a href ="#nth-child-pseudo "> < code > :nth-child()</ code > </ a >
2052- pseudo-class for the syntax of its argument. It also accepts the ‘< code
2051+ any positive integer or zero value of < code > n</ code > . It is not required
2052+ to have a parent. See < a
2053+ href ="#nth-child-pseudo "> < code > :nth-child()</ code > </ a > pseudo-class for
2054+ the syntax of its argument. It also accepts the ‘< code
20532055 class =css > < code > even</ code > </ code > ’ and ‘< code
20542056 class =css > < code > odd</ code > </ code > ’ values as arguments.
20552057
@@ -2071,8 +2073,8 @@ <h5 id=nth-of-type-pseudo><span class=secno>6.6.5.4. </span>:nth-of-type()
20712073 pseudo-class notation represents an element that has
20722074 < var > a</ var > < code > n</ code > +< var > b</ var > -1 siblings with the same expanded
20732075 element name < a href ="#sel-before "> < strong > before</ strong > </ a > it in the
2074- document tree, for any zero or positive integer value of < code > n</ code > ,
2075- and has a parent element . See < a
2076+ document tree, for any zero or positive integer value of < code > n</ code > .
2077+ It is not required to have a parent. See < a
20762078 href ="#nth-child-pseudo "> < code > :nth-child()</ code > </ a > pseudo-class for
20772079 the syntax of its argument. It also accepts the ‘< code
20782080 class =css > < code > even</ code > </ code > ’ and ‘< code
@@ -2096,8 +2098,8 @@ <h5 id=nth-last-of-type-pseudo><span class=secno>6.6.5.5.
20962098 pseudo-class notation represents an element that has
20972099 < var > a</ var > < code > n</ code > +< var > b</ var > -1 siblings with the same expanded
20982100 element name < a href ="#sel-after "> < strong > after</ strong > </ a > it in the
2099- document tree, for any zero or positive integer value of < code > n</ code > ,
2100- and has a parent element . See < a
2101+ document tree, for any zero or positive integer value of < code > n</ code > .
2102+ It is not required to have a parent. See < a
21012103 href ="#nth-child-pseudo "> < code > :nth-child()</ code > </ a > pseudo-class for
21022104 the syntax of its argument. It also accepts the ‘< code
21032105 class =css > < code > even</ code > </ code > ’ and ‘< code
@@ -2122,7 +2124,7 @@ <h5 id=first-child-pseudo><span class=secno>6.6.5.6. </span>:first-child
21222124
21232125 < p > Same as < code > :nth-child(1)</ code > . The < dfn data-dfn-type =selector
21242126 data-export =data-export id =sel-first-child > :first-child</ dfn > pseudo-class
2125- represents an element that is the first child of some other element .
2127+ represents an element that is first in a list of siblings .
21262128
21272129 < div class =example >
21282130 < p > Examples:
@@ -2157,7 +2159,7 @@ <h5 id=last-child-pseudo><span class=secno>6.6.5.7. </span>:last-child
21572159
21582160 < p > Same as < code > :nth-last-child(1)</ code > . The < dfn data-dfn-type =selector
21592161 data-export =data-export id =sel-last-child > :last-child</ dfn > pseudo-class
2160- represents an element that is the last child of some other element .
2162+ represents an element that is last in a list of siblings .
21612163
21622164 < div class =example >
21632165 < p > Example:
@@ -2173,8 +2175,7 @@ <h5 id=first-of-type-pseudo><span class=secno>6.6.5.8.
21732175
21742176 < p > Same as < code > :nth-of-type(1)</ code > . The < dfn data-dfn-type =selector
21752177 data-export =data-export id =sel-first-of-type > :first-of-type</ dfn >
2176- pseudo-class represents an element that is the first sibling of its type
2177- in the list of children of its parent element.
2178+ pseudo-class represents an element that is the first sibling of its type.
21782179
21792180 < div class =example >
21802181 < p > Example:
@@ -2207,8 +2208,7 @@ <h5 id=last-of-type-pseudo><span class=secno>6.6.5.9. </span>:last-of-type
22072208 < p > Same as < code > :nth-last-of-type(1)</ code > . The < dfn
22082209 data-dfn-type =selector data-export =data-export
22092210 id =sel-last-of-type > :last-of-type</ dfn > pseudo-class represents an element
2210- that is the last sibling of its type in the list of children of its parent
2211- element.
2211+ that is the last sibling of its type.
22122212
22132213 < div class =example >
22142214 < p > Example:
@@ -2224,8 +2224,7 @@ <h5 id=only-child-pseudo><span class=secno>6.6.5.10. </span>:only-child
22242224
22252225 < p > The < dfn data-dfn-type =selector data-export =data-export
22262226 id =sel-only-child > :only-child</ dfn > pseudo-class represents an element
2227- that has a parent element and whose parent element has no other element
2228- children. Same as < code > :first-child:last-child</ code > or
2227+ that has no siblings. Same as < code > :first-child:last-child</ code > or
22292228 < code > :nth-child(1):nth-last-child(1)</ code > , but with a lower
22302229 specificity.
22312230
@@ -2234,8 +2233,7 @@ <h5 id=only-of-type-pseudo><span class=secno>6.6.5.11. </span>:only-of-type
22342233
22352234 < p > The < dfn data-dfn-type =selector data-export =data-export
22362235 id =sel-only-of-type > :only-of-type</ dfn > pseudo-class represents an element
2237- that has a parent element and whose parent element has no other element
2238- children with the same expanded element name. Same as
2236+ that has no siblings with the same expanded element name. Same as
22392237 < code > :first-of-type:last-of-type</ code > or
22402238 < code > :nth-of-type(1):nth-last-of-type(1)</ code > , but with a lower
22412239 specificity.
@@ -3532,5 +3530,17 @@ <h3 id=informative-references><span class=secno>15.2. </span>Informative
35323530 </ dl >
35333531 <!--end-informative-->
35343532
3533+ < h3 id =changes > < span class =secno > 15.3. </ span > Changes</ h3 >
3534+
3535+ < p > Substantive since the previous Recommendation are:
3536+
3537+ < ul >
3538+ < li > Allowing the < a href ="#structural-pseudos "> Structural
3539+ pseudo-classes</ a > to match the root element. See < a
3540+ href ="http://lists.w3.org/Archives/Public/www-style/2013Apr/0246.html "> minutes</ a >
3541+ and < a
3542+ href ="https://software.hixie.ch/utilities/js/live-dom-viewer/saved/5188 "> testcase</ a > .
3543+ </ ul >
3544+
35353545 < script src ="//www.w3.org/scripts/TR/2016/fixup.js "
35363546 type ="application/javascript "> </ script >
0 commit comments