Re: [csswg-drafts] More intuitive names for selector performance profiles

"Live" for CSS-related profile is great IMO.

But first of all, I would ask if the "non-live" profile — for just one selector — is really necessary! Limiting the `:has()` selector to that "non-live" profile effectively makes that selector nearly useless since there are already many other ways to know if one element contains or precedes the other in DOM/JavaScript (so no wonder that nobody wants to implement it under this limitation). What people constantly ask for is adding something like `:has()` to _live_ profile, to be able to modify the styling of the container based on the content _without_ resorting to scripting. Yes, that selector wouldn't be the fast one, but we already have several selectors depending on the nested or following elements (`:empty`, `:nth-last-*`, `:focus-within`). And it's up to the author to decide if the resulting performance is acceptable or not.

I believe that the most use cases for `:has()`, once it gets implemented, would be relatively simple (something like `label:has([type="checkbox"]:checked)`) and the resulting performance wouldn't differ too much from the performance of the existing selectors.

Wasn't the whole concept of "non-live" selector profile a kind of premature optimization that was relevant in the era of slower CSS engines, that isn't much helpful in our days when the performance of CSS selectors is usually negligible comparing to other parts of the rendering process? Wouldn't it be better to drop it at all rather that to rename it?

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

Received on Friday, 4 August 2017 15:18:12 UTC