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

Allow CSSImportRule.styleSheet to be null #325

Open
amoseui opened this issue Feb 27, 2024 · 1 comment
Open

Allow CSSImportRule.styleSheet to be null #325

amoseui opened this issue Feb 27, 2024 · 1 comment
Labels
topic: css Spec relates to CSS (Cascading Style Sheets) venue: W3C CSS WG

Comments

@amoseui
Copy link

amoseui commented Feb 27, 2024

WebKittens

No response

Title of the spec

CSS Object Model (CSSOM)

URL to the spec

https://drafts.csswg.org/cssom/#the-cssimportrule-interface

URL to the spec's repository

https://github.com/w3c/csswg-drafts

Issue Tracker URL

No response

Explainer URL

No response

TAG Design Review URL

No response

Mozilla standards-positions issue URL

No response

WebKit Bugzilla URL

No response

Radar URL

No response

Description

CSSImportRule.styleSheet became nullable in w3c/csswg-drafts#8773 from the issue w3c/csswg-drafts#8608. The behavior of @import had not been matched with CSSOM CSSImportRule.

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

Additionally, if a 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).

It was fixed as following.

https://drafts.csswg.org/cssom/#the-cssimportrule-interface

The styleSheet attribute must return the associated CSS style sheet, if any, or null otherwise.

NOTE: An @import at-rule might not have an associated CSS style sheet (e.g., if it has a non-matching supports() condition).

@annevk
Copy link
Contributor

annevk commented Feb 27, 2024

My main worry here would be that the lifetime of these objects is not carefully defined and as such when they return null and non-null can end up varying in edge cases.

@annevk annevk added topic: css Spec relates to CSS (Cascading Style Sheets) venue: W3C CSS WG labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: css Spec relates to CSS (Cascading Style Sheets) venue: W3C CSS WG
Projects
None yet
Development

No branches or pull requests

2 participants