Re: [csswg-drafts] [cssom] Disabling imported styleSheet (#9538)

Following up on this: I'm unsure if this is intended spec behavior or an implementation issue in browsers. I believe the relevant part of the spec is this: [https://drafts.csswg.org/css-cascade-3/#at-ruledef-import](https://drafts.csswg.org/css-cascade-3/#at-ruledef-import)

> If an [@import](https://drafts.csswg.org/css-cascade-3/#at-ruledef-import) rule refers to a valid stylesheet, user agents must treat the contents of the stylesheet as if they were written in place of the @import rule [...].

This seems like it could be interpreted to mean that `@import` is effectively syntactic sugar for copy and pasting in the contents of a different stylesheet so that it 'becomes' one stylesheet. If this is the case then I can see why disabling the imported stylesheet would behave as it does as it is effectively not a separate stylesheet.

However, the following makes it seem like this is just in the context of how to apply the cascade

> declarations in style rules from imported stylesheets interact with the cascade as if they were written literally into the stylesheet at the point of the [@import](https://drafts.csswg.org/css-cascade-3/#at-ruledef-import).

Can someone clarify what is meant by the spec? Does treating it as one stylesheet only apply in the context of the cascade?

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


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

Received on Thursday, 18 January 2024 15:01:38 UTC