W3C home > Mailing lists > Public > www-style@w3.org > March 2012

Re: [selectors4] Should the reference combinator really be a combinator?

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Tue, 13 Mar 2012 01:10:27 +0100
Message-Id: <506D01F6-7557-4B3F-82DB-AAB3D3BC7683@crissov.de>
To: "www-style@w3.org CSS" <www-style@w3.org>
L. David Baron (2012-03-09 00:34):
> On Wednesday 2012-03-07 14:57 -0800, fantasai wrote:
>> Hixie's original proposal for :column() used // as a combinator instead. Using a combinator there does avoid the branching possibilities present with :column(), and might therefore make more sense.
> I prefer :column() as it is, and would rather see the reference combinator use a functional pseudo-class (…).  

Maybe pseudo-attributes are more useful than pseudo-classes (and combinators) here.

  td[:col=1]    {font-weight: bold;}
  td[:col=2]    {font-style: italic;}
  td[:col=3]    {font-variant: small-caps;}
  td[:col#=foo] {background: lime;}         /* or =# */
  td[:col.=bar] {background: green;}        /* or =. */
  col#foo       {background: red;}
  col.bar       {background: maroon;}

    <caption>3*3 table with 4 cells only</caption>
    <col id=foo><col span=2 class=bar>
      <td rowspan=2>
        td[:col=1][:row=1], td[:col=1][:row=2],
        td[:col#=foo][:row=1], td[:col#=foo][:row=2]
      <td colspan=2>
        td[:col=2][:row=1], td[:col=3][:row=1],
        td[:col.=bar][:row=1], td[:col.=bar][:row=1]
      <td colspan=2 rowspan=2>
        td[:col=2][:row=2], td[:col=3][:row=2],
        td[:col=2][:row=3], td[:col=3][:row=3],
        td[:col.=bar][:row=2], td[:col.=bar][:row=3]
        td[:col=1][:row=3], td[:col=1][:row=-1],

You can do most of the common things that ‘:column()’, ‘:nth-column()’ and ‘:nth-last-column()’ can do, except for advanced stuff like “:column(colgroup[span]>col:only-of-type)”.

Note that “:nth-column(1)” ≈ “:column(col:first-of-type)” and “:nth-last-column(1)” ≈ “:column(col:last-of-type)”.
Received on Tuesday, 13 March 2012 00:10:53 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:12 UTC