Skip to content

[cssom-1] [css-cascade] CSSImportRule.sheet not being null conflicts with @import supports() #8608

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

Closed
emilio opened this issue Mar 17, 2023 · 4 comments · Fixed by #8773
Closed
Labels

Comments

@emilio
Copy link
Collaborator

emilio commented Mar 17, 2023

https://drafts.csswg.org/css-cascade-5/#at-import:

Additionally, if a <supports-condition> blocks the application of the imported style sheet, the UA must not fetch the style sheet (unless it is loaded through some other link) and must return null for the import rule’s CSSImportRule.styleSheet value (even if it is loaded through some other link).

But https://drafts.csswg.org/cssom-1/#dom-cssimportrule-stylesheet is not nullable.

I think the fix is obvious (just make it nullable). Not sure if that needs a resolution tho?

@emilio
Copy link
Collaborator Author

emilio commented Mar 17, 2023

@tabatkins @fantasai do you know if tweaking the OM spec to allow styleSheet to be nullable needs a resolution?

@tabatkins
Copy link
Member

CSSOM is CR-level, so yes, normative changes need WG resolution. (But should be quick and easy.)

@SebastianZ
Copy link
Contributor

@tabatkins CSSOM is still WD-level, not CR-level.

Sebastian

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Apr 11, 2023
…,webidl,smaug

This doesn't match the CSSOM spec, but it seems fairly uncontroversial,
and our WebIDL already has the nullable annotation, see:

  w3c/csswg-drafts#8608

This doesn't change behavior on its own, but it's needed for the other
patches in this bug.

Differential Revision: https://phabricator.services.mozilla.com/D172891
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [cssom-1] [css-cascade] CSSImportRule.sheet not being null conflicts with @import supports(), and agreed to the following:

  • RESOLVED: Update CSSOM to allow null representation of imported style sheets
The full IRC log of that discussion <fantasai> emilio: 2 specs conflicting with each other
<fantasai> ... imported stylesheets cannot be null, but since we have supports() condition the UA is not required to fetch the stylesheet
<fantasai> ... so we need CSSOM to allow it to be null
<TabAtkins> +1 for the obvious fix
<fantasai> +1
<fantasai> RESOLVED: Update CSSOM to allow null representation of imported style sheets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants