Re: [csswg-drafts] [css-cascade] What is a valid at-rule? Or what is an invalid at-rule? (#9175)

Yeah, FF discards it. I guess it is a bug in Chrome.

---

In [8. CSS stylesheets - CSS Syntax](https://drafts.csswg.org/css-syntax-3/#css-stylesheets):

  > If any style rule is [invalid](https://drafts.csswg.org/css-syntax-3/#css-invalid), or any at-rule is not recognized or is invalid according to its grammar or context, it’s a [parse error](https://drafts.csswg.org/css-syntax-3/#parse-error). Discard that rule.

Note the link on *invalid*:

  > After each construct (declaration, style rule, at-rule) is parsed, the user agent checks it against its expected grammar. If it does not match the grammar, it’s invalid, and gets ignored by the UA, which treats it as if it wasn’t there at all.

It could be a bit more exhaustive regarding *invalid in the context*.

-- 
GitHub Notification of comment by cdoublev
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9175#issuecomment-1673041370 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 10 August 2023 11:27:33 UTC