W3C home > Mailing lists > Public > www-style@w3.org > June 2010

Re: [css3-selectors] The :nth-sibling combinator

From: Eduard Pascual <herenvardo@gmail.com>
Date: Fri, 18 Jun 2010 19:34:54 +0200
Message-ID: <AANLkTinT8rRdaDa11lT7ZEQFe1CeFFkd5JscfihgGYwh@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: www-style@w3.org
On Fri, Jun 18, 2010 at 6:38 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 6/18/10 12:26 PM, Eduard Pascual wrote:
>> This has to be, on the worst case, very close in costs to the general
>> sibling combinator (~) which is already implemented by most browsers.
> Though as of this writing webkit skips the "cost" part (by totally not
> handling ~ when dynamic changes are involved) and in Gecko the dynamic
> change aspect of ~ is in fact quite expensive.  I can't speak to what Presto
> and Trident do here.
I wasn't aware about webkit's limitation (nor am I sure about what the
others do), but I definitely knew that dynamic ~ is expensive. But
Gecko has it implemented despite the cost. It's probably the most
expensive CSS Selectors feature (or among the most expensive ones)
that has been implemented, so its cost is, IMO, a nice approximation
of what an upper bound would be for Selectors' features' costs.
I should have added emphasis on the "worst case" words on my claim: I
really hope that this suggestion will be significantly cheaper than ~;
but I can't tell for sure until Gabriele describes the proposal more
clearly: how can we discuss about the costs it will have if we don't
know what the selector should match? On the best case, it may be just
syntax sugar for long concatenations of X+X+X... where X is a simple
selector, spiced with the bonus of the an+b flexibility; so it would
be closer in cost to :nth-child than to ~. But until we have some
specific proposal to speak about, this is just speculation.

Eduard Pascual
Received on Friday, 18 June 2010 17:35:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:47 UTC