[csswg-drafts] [css-cascade-5] Do we need an API that lists the cascade layers in a tree scope? (#7015)

xiaochengh has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-cascade-5] Do we need an API that lists the cascade layers in a tree scope? ==
It might be useful if there is an API that returns all the cascade layers of a tree scope as a sorted list or a tree. For example, DevTools might need this (source: https://twitter.com/kilianvalkhof/status/1484568350504140804?s=20)

However, for the same purpose, Chrome DevTools doesn't need a public web API. Instead, it retrieves information via [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/), which is also a public API.

So while a layer-listing API seems good on its own, I'm not sure about the exact use cases, and therefore not sure about what the exact result format it should use. (I tried to draft something [here](https://gist.github.com/xiaochengh/437cbc4b9a6fc9afdbd97856d9946901))

So I'm opening this issue to collect ideas and see if we should introduce such an API.

@mirisuzanne 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7015 using your GitHub account


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

Received on Thursday, 3 February 2022 22:52:04 UTC