Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cssom] spec for inserting @import rules should explain effects on child stylesheet lists, etc. #4821

Open
dbaron opened this issue Mar 2, 2020 · 1 comment
Labels
cssom-1 tag-tracker Group bringing to attention of the TAG, or tracked by the TAG but not needing response.

Comments

@dbaron
Copy link
Member

dbaron commented Mar 2, 2020

The spec for inserting a CSS rule specifies how the rule gets inserted into a style sheet. It seems like the rule being inserted can be an @import rule, which seems like it should lead to loading of a CSS style sheet (linked from the CSSImportRules styleSheet property) and population of the CSSStyleSheet object that is being imported.

It seems like this should probably be specified in a bit more detail. In particular, given that the spec says:

Note: An @import at-rule always has an associated CSS style sheet.

it seems like what happens is that the linked CSSStyleSheet is created immediately, but gets populated later as the style sheet loads.

Some points that aren't clear are:

  • does that CSSStyleSheet get populated immediately when the newly-loaded style sheet is parsed (and then essentially follow this algorithm for adding rules recursively), or does it wait for other subresources of that style sheet to load?
  • when do relayouts happen as multiple style sheets load?

It also seems that it would be useful for this to be specified better because a number of other specifications, in particular CSS Modules (which we got here from w3ctag/design-reviews#405) and Constructible Stylesheets (w3ctag/design-reviews#308, #3433) are disallowing @import rules, a restriction that seems likely to stick around if it's done initially, and which we feel may not really be there for good underlying reasons (and may be related to the lack of solid specification here).

@emilio
Copy link
Collaborator

emilio commented Mar 3, 2020

Note that there are existing interop issues even without the CSSOM bits, see https://bugs.chromium.org/p/chromium/issues/detail?id=1009997, which comes to mind, but there are also other cases.

@ylafon ylafon added the tag-tracker Group bringing to attention of the TAG, or tracked by the TAG but not needing response. label Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cssom-1 tag-tracker Group bringing to attention of the TAG, or tracked by the TAG but not needing response.
Projects
None yet
Development

No branches or pull requests

3 participants