Re: [csswg-drafts] [css-selectors] Substring Matching of Individual Class Names

> FWIW browsers can handle class and ID selectors in an efficient manner (by storing tables of classes and IDs that appear in style sheets), which is not really possible with substrings.

I would  have thought it possible to at least optimise, to some extent, begin/end matching.

> If we had this feature I would expect selector matching for them to be slower, like it is for regular attribute substring matches.

There's no doubt that substring matching attribute selectors are amongst the least performant.

Though, I would differentiate between matching the beginning/end of a string and matching a value contained within a string, the latter being notably slower (depends on string length).

> If we want a mechanism for class inheritance in CSS I'd rather have an explicit feature for it.

I completely agree, however, this would require a fundamental change to the CSS Object Model and  realistically this isn’t going to happen anytime soon, it could even take decades. 

This is an interim solution that is pragmatic, could be implemented relatively quickly as it leverages an existing feature of the language and provides many of the same benefits.

-- 
GitHub Notification of comment by simlawr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2984#issuecomment-424679238 using your GitHub account

Received on Wednesday, 26 September 2018 11:20:52 UTC