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

Re: [selectors] Tree selectors

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Tue, 22 Mar 2005 09:10:14 +0100
Message-ID: <423FD2E6.5030401@disruptive-innovations.com>
To: Mats Palmgren <mats.palmgren@bredband.net>
Cc: Ian Hickson <ian@hixie.ch>, BachusII <BachusII@planet.nl>, Anne van Kesteren <fora@annevankesteren.nl>, W3C CSS List <www-style@w3.org>

Mats Palmgren wrote:

> How about something similar to counters? [1]
>   body, section, navigation { depth-weight: IDENT 1; }
>   h:depth(IDENT, 3) {}
> that is, :depth(IDENT, number) would match an element where the sum of
> its ascenders' weight for the depth IDENT equals number.

As Ian said, it's a neat idea but it adds a new dependency from
selectors to values. And that's quite a bad one IMHO:

   div:depth(divdepth, 3) { depth-weight: divdepth 1; }


Even if you solve that saying that depth-weight property cannot be used
if the :depth() functional notation is used in the selector part, you'll
still have to resolve depth-weight declarations in a first step before all
other declarations:

   div                    { depth-weight: divdepth 1; }
   div:depth(divdepth, 3) { color: red }

Received on Tuesday, 22 March 2005 08:10:22 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:17 UTC