[csswg-drafts] [cssom] There should be a way to get Character Position of the Stylesheet Elements (#10480)

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

== [cssom] There should be a way to get Character Position of the Stylesheet Elements ==
If you create a Designer Application wich supports CSS, you need the character position of the Rules/Declarations so you can modify the CSS.

See my sample Designer https://node-projects.github.io/web-component-designer-demo/index.html
<img width="951" alt="image" src="https://github.com/w3c/csswg-drafts/assets/364896/3113ddaa-051b-4efe-a01f-cf7e643dcbe5">

### Proposal

The addition of a constructor parameter for CSSStyleSheet, so it should keep the positional Information and a 'offset' Property for each class of the [cssom]. 

    const ss = new CSSStyleSheet(true) //enables the positional information
    ss.replaceSync(".a{display:block}");

    ss.cssRules[0].offset

If feasible the offset property could be added and filled without any additional constructor parameter.

This is dependend on https://github.com/w3c/csswg-drafts/issues/10470 

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


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

Received on Friday, 21 June 2024 04:42:01 UTC