1919
2020 < h1 id =title > Selectors Level 4</ h1 >
2121
22- < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 9 August 2012</ h2 >
22+ < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 10 August 2012</ h2 >
2323
2424 < dl >
2525 < dt > This version: <!--
26- <dd><a href="http://www.w3.org/TR/2012/ED-selectors4-20120809 /">
27- http://www.w3.org/TR/2012/WD-selectors4-20120809 /</a>
26+ <dd><a href="http://www.w3.org/TR/2012/ED-selectors4-20120810 /">
27+ http://www.w3.org/TR/2012/WD-selectors4-20120810 /</a>
2828
2929 <dt>Editor's draft:
3030-->
@@ -378,37 +378,37 @@ <h2 class="no-num no-toc" id=contents>Table of Contents</h2>
378378 class =css > :empty</ code > ’ pseudo-class</ a >
379379 </ ul >
380380
381- < li > < a href ="#table-pseudos "> < span class =secno > 13. </ span > Grid-Structural
382- Selectors</ a >
381+ < li > < a href ="#combinators "> < span class =secno > 13. </ span > Combinators</ a >
383382 < ul class =toc >
384- < li > < a href ="#column-pseudo "> < span class =secno > 13.1. </ span > ‘< code
385- class =css > :column()</ code > ’ pseudo-class</ a >
386-
387- < li > < a href ="#nth-column-pseudo "> < span class =secno > 13.2. </ span >
388- ‘< code class =css > :nth-column()</ code > ’ pseudo-class</ a >
389-
390- < li > < a href ="#nth-last-column-pseudo "> < span class =secno > 13.3. </ span >
391- ‘< code class =css > :nth-last-column()</ code > ’ pseudo-class</ a >
392- </ ul >
393-
394- < li > < a href ="#combinators "> < span class =secno > 14. </ span > Combinators</ a >
395- < ul class =toc >
396- < li > < a href ="#descendant-combinators "> < span class =secno > 14.1. </ span >
383+ < li > < a href ="#descendant-combinators "> < span class =secno > 13.1. </ span >
397384 Descendant combinator</ a >
398385
399- < li > < a href ="#child-combinators "> < span class =secno > 14 .2. </ span > Child
386+ < li > < a href ="#child-combinators "> < span class =secno > 13 .2. </ span > Child
400387 combinator</ a >
401388
402- < li > < a href ="#adjacent-sibling-combinators "> < span class =secno > 14 .3.
389+ < li > < a href ="#adjacent-sibling-combinators "> < span class =secno > 13 .3.
403390 </ span > Next-sibling combinator</ a >
404391
405- < li > < a href ="#general-sibling-combinators "> < span class =secno > 14 .4.
392+ < li > < a href ="#general-sibling-combinators "> < span class =secno > 13 .4.
406393 </ span > Following-sibling combinator</ a >
407394
408- < li > < a href ="#idref-combinators "> < span class =secno > 14 .5. </ span >
395+ < li > < a href ="#idref-combinators "> < span class =secno > 13 .5. </ span >
409396 Reference combinators</ a >
410397 </ ul >
411398
399+ < li > < a href ="#column-selectors "> < span class =secno > 14. </ span >
400+ Grid-Structural Selectors</ a >
401+ < ul class =toc >
402+ < li > < a href ="#column-combinator "> < span class =secno > 14.1. </ span > Column
403+ combinator</ a >
404+
405+ < li > < a href ="#nth-column-pseudo "> < span class =secno > 14.2. </ span >
406+ ‘< code class =css > :nth-column()</ code > ’ pseudo-class</ a >
407+
408+ < li > < a href ="#nth-last-column-pseudo "> < span class =secno > 14.3. </ span >
409+ ‘< code class =css > :nth-last-column()</ code > ’ pseudo-class</ a >
410+ </ ul >
411+
412412 < li > < a href ="#specificity "> < span class =secno > 15. </ span > Calculating a
413413 selector's specificity</ a >
414414
@@ -3113,83 +3113,9 @@ <h3 id=empty-pseudo><span class=secno>12.14. </span> ‘<code
31133113 < pre > <foo>this is not <bar>:empty</bar></foo></ pre >
31143114 </ div >
31153115
3116- < h2 id =table-pseudos > < span class =secno > 13. </ span > Grid-Structural
3117- Selectors</ h2 >
3118-
3119- < p > The double-association of a cell in a 2D grid (to its row and column)
3120- cannot be represented by parentage in a hierarchical markup language. Only
3121- one of those associations can be represented hierarchically: the other
3122- must be explicitly or implicitly defined in the document language
3123- semantics. In both HTML and DocBook, two of the most common hierarchical
3124- markup languages, the markup is row-primary (that is, the row associations
3125- are represented hierarchically); the columns must be implied. Thus the
3126- < code > :nth-column()</ code > , < code > :nth-last-column()</ code > , and
3127- < code > :column()</ code > are defined. In a column-primary format, these
3128- pseudo-classes would match against row associations instead.
3129-
3130- < h3 id =column-pseudo > < span class =secno > 13.1. </ span > ‘< code
3131- class =css > :column()</ code > ’ pseudo-class</ h3 >
3132-
3133- < p > The < code > :column(< var > selector-list</ var > )</ code > pseudo-class notation
3134- represents a cell element belonging to a column that is represented by the
3135- element selected by its argument. Column membership is determined based on
3136- the semantics of the document language only: whether and how the elements
3137- are presented is not considered. If a cell element belongs to more than
3138- one column, it is represented by a selector indicating any of those
3139- columns.
3140-
3141- < div class =example >
3142- < p > The following example makes cells C, E, and G yellow.</ p >
3143-
3144- < pre > :column(col.selected) { background: yellow; }</ pre >
3145-
3146- < pre >
3147- <!-- --> <table>
3148- <!-- --> <col span="2">
3149- <!-- --> <col class="selected">
3150- <!-- --> <tr> <td> A <td> B <td> C
3151- <!-- --> <tr> <td span="2"> D <td> E
3152- <!-- --> <tr> <td> F <td span="2"> G
3153- <!-- --> </table> </ pre >
3154- </ div >
3155-
3156- < h3 id =nth-column-pseudo > < span class =secno > 13.2. </ span > ‘< code
3157- class =css > :nth-column()</ code > ’ pseudo-class</ h3 >
3158-
3159- < p > The < code > :nth-column(< var > a</ var > n+< var > b</ var > )</ code > pseudo-class
3160- notation represents a cell element belonging to a column that has
3161- < var > a</ var > < code > n</ code > +< var > b</ var > -1 columns < strong > before</ strong >
3162- it, for any positive integer or zero value of < code > n</ code > . Column
3163- membership is determined based on the semantics of the document language
3164- only: whether and how the elements are presented is not considered. If a
3165- cell element belongs to more than one column, it is represented by a
3166- selector indicating any of those columns.
3167-
3168- < p > See < a href ="#nth-child-pseudo "> < code > :nth-child()</ code > </ a >
3169- pseudo-class for the syntax of its argument. It also accepts the ‘< code
3170- class =css > < code > even</ code > </ code > ’ and ‘< code
3171- class =css > < code > odd</ code > </ code > ’ values as arguments.
3172-
3173- < h3 id =nth-last-column-pseudo > < span class =secno > 13.3. </ span > ‘< code
3174- class =css > :nth-last-column()</ code > ’ pseudo-class</ h3 >
3175-
3176- < p > The < code > :nth-last-column(< var > a</ var > n+< var > b</ var > )</ code >
3177- pseudo-class notation represents a cell element belonging to a column that
3178- has < var > a</ var > < code > n</ code > +< var > b</ var > -1 columns
3179- < strong > after</ strong > it, for any positive integer or zero value of
3180- < code > n</ code > . Column membership is determined based on the semantics of
3181- the document language only: whether and how the elements are presented is
3182- not considered. If a cell element belongs to more than one column, it is
3183- represented by a selector indicating any of those columns.
3116+ < h2 id =combinators > < span class =secno > 13. </ span > Combinators</ h2 >
31843117
3185- < p > See < a href ="#nth-child-pseudo "> < code > :nth-child()</ code > </ a >
3186- pseudo-class for the syntax of its argument. It also accepts the ‘< code
3187- class =css > < code > even</ code > </ code > ’ and ‘< code
3188- class =css > < code > odd</ code > </ code > ’ values as arguments.
3189-
3190- < h2 id =combinators > < span class =secno > 14. </ span > Combinators</ h2 >
3191-
3192- < h3 id =descendant-combinators > < span class =secno > 14.1. </ span > Descendant
3118+ < h3 id =descendant-combinators > < span class =secno > 13.1. </ span > Descendant
31933119 combinator</ h3 >
31943120
31953121 < p > At times, authors may want selectors to describe an element that is the
@@ -3234,7 +3160,7 @@ <h3 id=descendant-combinators><span class=secno>14.1. </span> Descendant
32343160 < pre > div p *[href]</ pre >
32353161 </ div >
32363162
3237- < h3 id =child-combinators > < span class =secno > 14 .2. </ span > Child combinator</ h3 >
3163+ < h3 id =child-combinators > < span class =secno > 13 .2. </ span > Child combinator</ h3 >
32383164
32393165 < p > A < dfn id =child-combinator > child combinator</ dfn > describes a childhood
32403166 relationship between two elements. A child combinator is made of the
@@ -3265,7 +3191,7 @@ <h3 id=child-combinators><span class=secno>14.2. </span> Child combinator</h3>
32653191 the section on the < code > < a
32663192 href ="#structural-pseudos "> :first-child</ a > </ code > pseudo-class above.
32673193
3268- < h3 id =adjacent-sibling-combinators > < span class =secno > 14 .3. </ span >
3194+ < h3 id =adjacent-sibling-combinators > < span class =secno > 13 .3. </ span >
32693195 Next-sibling combinator</ h3 >
32703196
32713197 < p > The < dfn id =next-sibling-combinator > next-sibling combinator</ dfn > is
@@ -3292,7 +3218,7 @@ <h3 id=adjacent-sibling-combinators><span class=secno>14.3. </span>
32923218 < pre > h1.opener + h2</ pre >
32933219 </ div >
32943220
3295- < h3 id =general-sibling-combinators > < span class =secno > 14 .4. </ span >
3221+ < h3 id =general-sibling-combinators > < span class =secno > 13 .4. </ span >
32963222 Following-sibling combinator</ h3 >
32973223
32983224 < p > The < dfn id =following-sibling-combinator > following-sibling
@@ -3315,7 +3241,7 @@ <h3 id=general-sibling-combinators><span class=secno>14.4. </span>
33153241 <pre>function a(x) = 12x/13.5</pre></ pre >
33163242 </ div >
33173243
3318- < h3 id =idref-combinators > < span class =secno > 14 .5. </ span > Reference
3244+ < h3 id =idref-combinators > < span class =secno > 13 .5. </ span > Reference
33193245 combinators</ h3 >
33203246
33213247 < p > The IDREF combinator consists of two slashes with an indetervening < a
@@ -3345,6 +3271,81 @@ <h3 id=idref-combinators><span class=secno>14.5. </span> Reference
33453271
33463272 < p class =issue > This could also be implemented as a functional pseudo-class.
33473273
3274+ < h2 id =column-selectors > < span class =secno > 14. </ span > Grid-Structural
3275+ Selectors</ h2 >
3276+
3277+ < p > The double-association of a cell in a 2D grid (to its row and column)
3278+ cannot be represented by parentage in a hierarchical markup language. Only
3279+ one of those associations can be represented hierarchically: the other
3280+ must be explicitly or implicitly defined in the document language
3281+ semantics. In both HTML and DocBook, two of the most common hierarchical
3282+ markup languages, the markup is row-primary (that is, the row associations
3283+ are represented hierarchically); the columns must be implied. To be able
3284+ to represent such implied column-based relationships, the < a
3285+ href ="#column-combinator0 "> < i > column combinator</ i > </ a > and the
3286+ < code > :nth-column()</ code > and < code > :nth-last-column()</ code >
3287+ pseudo-classes are defined. In a column-primary format, these
3288+ pseudo-classes match against row associations instead.
3289+
3290+ < h3 id =column-combinator > < span class =secno > 14.1. </ span > Column combinator</ h3 >
3291+
3292+ < p > The < dfn id =column-combinator0 > column combinator</ dfn > , which consists
3293+ of two forward slashes (‘< code class =css > //</ code > ’) represents the
3294+ relationship of a column element to a cell element belonging to the column
3295+ it represents. Column membership is determined based on the semantics of
3296+ the document language only: whether and how the elements are presented is
3297+ not considered. If a cell element belongs to more than one column, it is
3298+ represented by a selector indicating membership in any of those columns.
3299+
3300+ < div class =example >
3301+ < p > The following example makes cells C, E, and G yellow.</ p >
3302+
3303+ < pre > col.selected // td { background: yellow; }</ pre >
3304+
3305+ < pre >
3306+ <!-- --> <table>
3307+ <!-- --> <col span="2">
3308+ <!-- --> <col class="selected">
3309+ <!-- --> <tr> <td> A <td> B <td> C
3310+ <!-- --> <tr> <td span="2"> D <td> E
3311+ <!-- --> <tr> <td> F <td span="2"> G
3312+ <!-- --> </table> </ pre >
3313+ </ div >
3314+
3315+ < h3 id =nth-column-pseudo > < span class =secno > 14.2. </ span > ‘< code
3316+ class =css > :nth-column()</ code > ’ pseudo-class</ h3 >
3317+
3318+ < p > The < code > :nth-column(< var > a</ var > n+< var > b</ var > )</ code > pseudo-class
3319+ notation represents a cell element belonging to a column that has
3320+ < var > a</ var > < code > n</ code > +< var > b</ var > -1 columns < strong > before</ strong >
3321+ it, for any positive integer or zero value of < code > n</ code > . Column
3322+ membership is determined based on the semantics of the document language
3323+ only: whether and how the elements are presented is not considered. If a
3324+ cell element belongs to more than one column, it is represented by a
3325+ selector indicating any of those columns.
3326+
3327+ < p > See < a href ="#nth-child-pseudo "> < code > :nth-child()</ code > </ a >
3328+ pseudo-class for the syntax of its argument. It also accepts the ‘< code
3329+ class =css > < code > even</ code > </ code > ’ and ‘< code
3330+ class =css > < code > odd</ code > </ code > ’ values as arguments.
3331+
3332+ < h3 id =nth-last-column-pseudo > < span class =secno > 14.3. </ span > ‘< code
3333+ class =css > :nth-last-column()</ code > ’ pseudo-class</ h3 >
3334+
3335+ < p > The < code > :nth-last-column(< var > a</ var > n+< var > b</ var > )</ code >
3336+ pseudo-class notation represents a cell element belonging to a column that
3337+ has < var > a</ var > < code > n</ code > +< var > b</ var > -1 columns
3338+ < strong > after</ strong > it, for any positive integer or zero value of
3339+ < code > n</ code > . Column membership is determined based on the semantics of
3340+ the document language only: whether and how the elements are presented is
3341+ not considered. If a cell element belongs to more than one column, it is
3342+ represented by a selector indicating any of those columns.
3343+
3344+ < p > See < a href ="#nth-child-pseudo "> < code > :nth-child()</ code > </ a >
3345+ pseudo-class for the syntax of its argument. It also accepts the ‘< code
3346+ class =css > < code > even</ code > </ code > ’ and ‘< code
3347+ class =css > < code > odd</ code > </ code > ’ values as arguments.
3348+
33483349 < h2 id =specificity > < span class =secno > 15. </ span > Calculating a selector's
33493350 specificity</ h2 >
33503351
0 commit comments