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

LibWeb: Treat import rules as invalid if preceded by non-import rules #3283

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tcl3
Copy link
Member

@tcl3 tcl3 commented Jan 16, 2025

If an import statement is preceded by a valid rule that isn't an import rule or a @layer statement rule, it is now treated as invalid.

Fixes: http://wpt.live/css/CSS2/css1/c11-import-000.xht

If an import statement is preceded by a valid rule that isn't an
import rule or a @layer statement rule, it is now treated as invalid.
@tcl3 tcl3 requested a review from AtkinsSJ as a code owner January 16, 2025 21:59
auto is_layer_statement_rule = is<CSSLayerStatementRule>(*rule);
auto is_import_rule = is<CSSImportRule>(*rule);

// FIXME: Include @charset rules in this check when they are added.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This FIXME isn't necessary. It's confusing, but @charset is a weird beast that isn't actually an at-rule that shows up in the CSSOM. https://drafts.csswg.org/css-syntax/#charset-rule

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...there are order-requirements for @namespace though, and I think some others.

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.

2 participants