Re: [csswg-drafts] [selectors-4] Rescope :has to static CSS rather than .querySelector (#3925)

Please. Don't fix what is not broken yet, and it's unclear if it ever gets broken in the future. Don't make simple things complicated. There is no evidence that the "CSS profiles" concept is anything more than a purely theoretical question. Anywhere in practice, there is just CSS.

The impossibility to style elements depending on their content or following siblings is a real problem that [web](http://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector) [developers](http://stackoverflow.com/questions/45004/complex-css-selector-for-parent-of-active-child?lq=1) [have suffered](http://stackoverflow.com/questions/2000582/css-selector-for-foo-that-contains-bar?lq=1) [from](http://stackoverflow.com/questions/4220327/css-selector-element-with-a-given-child?lq=1) [for years](http://stackoverflow.com/questions/21252551/apply-style-to-parent-if-it-has-child-with-css?lq=1). The slowness of the selector that only _perhaps would be implemented in the future_ is not (although the slowness of its _script-based alternatives_ that web devs currently have to resort to _probably is!)._ Please, help solving the real problem. If `:has()` can't be reasonably done so that web devs could safely use it for styling, than please give the web devs _anything that can_ instead.

Even if `:has()` was implemented in JS-only context, it would be merely kind of a syntactic sugar: `document.querySelectorAll('a:has(img)')` is not _that_ more readable for a JS developer than `[...document.querySelectorAll('a')].filter(el => el.querySelector('img'))`. It's _styling_ where it would be a game-changer and totally worth implementation effort, just like already existing content-aware selectors like `:focus-within`. Please, help the web developers to solve the real problem!

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

Received on Sunday, 12 May 2019 12:07:43 UTC