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

RE: [css-selectors] Tagname based substrings

From: Francois Remy <francois.remy.dev@outlook.com>
Date: Thu, 7 Apr 2016 12:35:24 -0700
Message-ID: <DUB408-EAS263799B1C4C3EE959BA1AAA5900@phx.gbl>
To: "'Tab Atkins Jr.'" <jackalmage@gmail.com>, "'Simon Pieters'" <simonp@opera.com>
CC: "'Davis, Greg'" <greg.davis@pearson.com>, <www-style@w3.org>, "'Marat Tanalin'" <mtanalin@yandex.ru>
> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
> On Thu, Apr 7, 2016 at 4:06 AM, Simon Pieters <simonp@opera.com> wrote:
> > It seems to me this could be equally useful for attributes, in
> > particular
> > data-* attributes.
> 
> Yeah, it's a pretty long-standing request for data-* attributes.
> 
> > While we're bikeshedding, a more succinct syntax would be IDENT
> > DELIM(*) (no allowed whitespace between) so you can do:
> >
> >     x-admin-* { ... }
> >     [data-my-*] { ... }
> 
> Definitely my preference. Very readable, and it bridges the universal selector
> nicely - * is just a tagname selector with a wildcard and no prefix.
> 
> > Performance-wise it seems to me this shouldn't be worse than partial
> > attribute value selectors, but I could be missing something?
> 
> I *think* you're right, but we should tag in some implementors.  I've bugged
> Elliot privately.

I think this would break an optimization some browsers do where they create a bloom filter of attributes being used for css selectors, in order to avoid invalidating the style for most attribute changes. This would make it harder by adding another component on top of the bloom filter. Not sure this is worth the pain. If you control the element, just add a "data-my=true" attribute and test for it. 
Received on Thursday, 7 April 2016 19:35:56 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:38 UTC