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

Update @import behavior per CSSWG resolution #137

Closed

Conversation

dandclark
Copy link

@dandclark dandclark commented May 3, 2021

Last year the CSSWG resolved on the following changes for constructable stylesheets' treatment of @import:

  1. insertRule() inserting an @import rule will throw a SyntaxError instead of a NotAllowedError.
  2. replaceSync() and replace() both ignore @import rules, and do not throw an exception when encountering one.

This PR updates the spec to reflect these changes.

In this change, the 'ignoring' of @imports for replace()/replaceSync() is achieved by removing the rules from the list produced by the parser. This is a little odd; it could be more natural to have the parser skip them when parsing a constructed stylesheet. But since this document is not yet merged into any other CSS spec it's difficult to plumb that behavior through to the parser. So, the rules are instead removed after-the-fact, which should produce the same result.

Closes #123.


Preview | Diff

@dandclark
Copy link
Author

This was handled in w3c/csswg-drafts#6411.

@dandclark dandclark closed this Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specification text for replace() does not match Chromium implementation
1 participant