- From: Florian Rivoal <florian@rivoal.net>
- Date: Wed, 8 Apr 2015 10:17:11 +0200
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: Peter Krauss <ppkrauss@gmail.com>, "www-style@w3.org" <www-style@w3.org>
(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