Re: [csswg-drafts] [css-cascade-5] Add a R/W `CSSStyleSheet.layer` attribute for the layer name (#7002)

The CSS Working Group just discussed `Add a .layer attribute to CSSSTyleSheet`, and agreed to the following:

* `RESOLVED: Add .layerName to CSSStyleSheet as a readonly attribute.`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: Add a .layer attribute to CSSSTyleSheet<br>
&lt;TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/7002<br>
&lt;TabAtkins> fantasai: So it just seemed reasonable to add, and discussion suggests it should be called .layerName to match the CSSLayerRule<br>
&lt;TabAtkins> astearns: And using .layerName is preferable to switching both to .layer?<br>
&lt;TabAtkins> fantasai: I'm open to both.<br>
&lt;smfr> prefer layerName<br>
&lt;TabAtkins> astearns: I think .layerName does suggest a string rather than an object, so it seems slightly more clear<br>
&lt;emilio> q+<br>
&lt;astearns> ack emilio<br>
&lt;TabAtkins> emilio: does @import allow us to set this on import, so we can make it immutable?<br>
&lt;fantasai_> TabAtkins: If this stylesheet is reflecting from a &lt;link>, that's changeable in HTML<br>
&lt;fantasai_> TabAtkins: maybe we could make it immutable in the API?<br>
&lt;TabAtkins> emilio: Link mutations already have steps to recreate the stylesheet object<br>
&lt;TabAtkins> emilio: So that would trigger the same as changing media=''<br>
&lt;TabAtkins> emilio: Which creates a new stylesheet<br>
&lt;TabAtkins> TabAtkins: What about constructed stylesheets?<br>
&lt;TabAtkins> emilio: Hopefully we can set it in the constructor - it already has an option bag for things like baseURI, which also is immutable. Hopefully we can follow the same pattern.<br>
&lt;TabAtkins> TabAtkins: I'm fine with that.<br>
&lt;TabAtkins> emilio: The original issue uses @import syntax, which requires using an extra argument object somewhere to preserve the mime type...<br>
&lt;TabAtkins> TabAtkins: Don't understand<br>
&lt;TabAtkins> emilio: When you use importSheet()<br>
&lt;TabAtkins> scratch last line<br>
&lt;TabAtkins> emilio: When you use `import sheet from style.css`, can you set the layer there?<br>
&lt;TabAtkins> emilio: I think in JS you have a trailing object that lets you set the mimetype?<br>
&lt;TabAtkins> TabAtkins: Yes, but I'm unsure whether that's meant to be just assertions or can have extra data<br>
&lt;TabAtkins> astearns: Sounds like we can resolve on .layerName?<br>
&lt;TabAtkins> TabAtkins: And on makign it readonly unless that's killer for the JS ipmort syntax<br>
&lt;TabAtkins> emilio: Agreed<br>
&lt;TabAtkins> astearns: objections?<br>
&lt;TabAtkins> RESOLVED: Add .layerName to CSSStyleSheet as a readonly attribute.<br>
&lt;emeyer> scribenick emeyer<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7002#issuecomment-1098263680 using your GitHub account


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

Received on Wednesday, 13 April 2022 16:39:24 UTC