[csswg-drafts] [cssom-1] Should `CSSImportRule.styleSheet` be defined when fetching failed? (#13292)

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

== [cssom-1] Should `CSSImportRule.styleSheet` be defined when fetching failed? ==
When fetching `@import` style sheet fails, all browsers seem to create `CSSImportRule.styleSheet`. But expecting `null` seems reasonable, based on the current spec text:

  > `[SameObject] readonly attribute CSSStyleSheet? styleSheet;`
  >
  > The `styleSheet` attribute must return the associated CSS style sheet, if any, or null otherwise.

When a browser fails to fetch a resource, users do not get an empty resource with which they can interact with, such as inserting a new CSS rule into a CSS style sheet.

This text follows the resolution in #8608, which was about `@import` failing to match some of its conditions. But I do not see why you would get an empty style sheet when fetching failed, but not when its import conditions do not match.

To my surprise, it seems there are no WPT tests for this. I mainly searched in the `cssom` and `css-cascade` directories.

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


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

Received on Monday, 5 January 2026 09:57:28 UTC