W3C home > Mailing lists > Public > www-style@w3.org > April 2015

Re: W3C can say (?) what an ID means to CSS4, in the fast profile context

From: Florian Rivoal <florian@rivoal.net>
Date: Wed, 8 Apr 2015 10:17:11 +0200
Cc: Peter Krauss <ppkrauss@gmail.com>, "www-style@w3.org" <www-style@w3.org>
Message-Id: <3C0E0068-B6DB-4C6F-9CAB-3608F99FD77E@rivoal.net>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

(little side track, as we can't do this anyway as both you and Boris said)

> On 08 Apr 2015, at 01:11, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> There's no significant speed difference between matching all elements
> with a given ID vs matching only the first, so I don't think there's
> really a use-case for doing this.

Really? I'd think matching all elements with a given ID is actually faster
than matching only the first, and possibly significantly so.

If an ID selector matches all elements with the id, to find out if any given
element matches you only need to consider this element in isolation, but if
an ID selector matches only the first one, you now need to take the whole dom
into account (or build additional data structures to keep track of the
relevant info), making the whole thing slower, or more memory intensive of
both. No?

 - Florian
Received on Wednesday, 8 April 2015 08:17:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:53 UTC