Re: [csswg-drafts] [cssom-1] Expose nested selectorText on CSSStyleRule (#10246)

> The current OM _does_ represent the full selector; the `&` selector is not evaluated by substitution, but rather refers directly to the elements selected by the parent rule.

Sorry, should have said “flattened” or “resolved” selector.

> Understanding the use-cases better would be useful. If it's about making it easier to select the same elements in qSA() as a particular style block, we can cater to that more directly.

That’s my specific use-case indeed.

> You seem to be suggesting that authors would be willing to crawl the OM and obtain a selector directly off of the CSSStyleRule - how serious were you about that in particular as a use-case?

It came up when writing a (rough) polyfill for `ident()` + `attr()` for [this demo](https://codepen.io/bramus/pen/PogVZwb) but admittedly not all authors write that type of stuff.

Another use case is doing an analysis of the loaded CSS (nesting depth, layers extraction, etc.) with userland code.


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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 25 April 2024 21:50:45 UTC