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

Re: [CSSWG][selectors4] Updated WD of Selectors Level 4

From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
Date: Fri, 31 Aug 2012 17:18:15 +0400
To: Brian Kardell <bkardell@gmail.com>
Cc: fantasai <fantasai.lists@inkedblade.net>,"www-style@w3.org" <www-style@w3.org>
Message-Id: <199391346419095@web7f.yandex.ru>
31.08.2012, 03:46, "Brian Kardell" <bkardell@gmail.com>:
> On Aug 30, 2012 7:38 PM, "fantasai" <fantasai.lists@inkedblade.net> wrote:
>>
>> The CSS WG has published an updated Working Draft of the Selectors Level 4:
>>
>>   http://www.w3.org/TR/selectors4/
> Since I got no response last time I will try again....
> :has() ... please? Reading the past minutes I do not see to be alone in my support... it is honestly a lot less confusing and already proven.

Indeed, `:has()` would make HTML code more clear from extra elements and extra classes.

For example, we have a table where some cells contain links clickable over entire area (including padding) while other cells contain just text:

    <table>
        <tr>
            <td>1</td>
            <td><a href="#">2</a></td>
        </tr>
    </table>

and we want that all cells have `em` padding, we are currently forced to wrap text with `SPAN`:

    <table>
        <tr>
            <td><span>1</span></td>
            <td><a href="#">2</a></td>
        </tr>
    </table>

    <style>
        TD > A,
        TD > SPAN {display: block; padding: .1em .3em; }
    </style>

We can't use negative margins to compensate cell padding:

    <table>
        <tr>
            <td>1</td>
            <td><a href="#">2</a></td>
        </tr>
    </table>

    <style>
        TD,
        TD > A {padding: .1em .3em; }

        TD > A {display: block; margin: -.1em -.3em; }
    </style>

since it wouldn't be pixel-perfect (calculated pixel value of `em` value varies depending on calculated pixel dimensions of previous elements).
Received on Friday, 31 August 2012 13:18:44 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:59 GMT