Skip to content

Update @import behavior per CSSWG resolution - #137

Closed
dandclark wants to merge 1 commit into
WICG:mainfrom
dandclark:user/daniec/update-@import-behavior
Closed

Update @import behavior per CSSWG resolution#137
dandclark wants to merge 1 commit into
WICG:mainfrom
dandclark:user/daniec/update-@import-behavior

Conversation

@dandclark

@dandclark dandclark commented May 3, 2021

Copy link
Copy Markdown

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
Copy Markdown
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