Re: [csswg-drafts] [css-nesting-1] CSSOM for nested media query rules (#7850)

> you suddenly have rules that are to be ignored (but otherwise correctly parsed, visible through CSSOM etc.)

(Sorry,) what rules should suddenly have to be ignored? I only asked if it could be defined that declarations specified via `CSSMediaRule.style` could be ignored when the context of `CSSMediaRule` is not `<style-block>`.

Rules which are invalid according to their context should also be ignored when specified via `CSSMediaRule.cssText` though, but I think ignoring rules which are invalid according to their context is already defined normatively in CSS Syntax, and in the corresponding specs for the rules. For a conditional rule, in CSS Nesting:

> [...] this specification allows nested conditional group rules inside of style rules. When nested in this way, the contents of a conditional group rule are parsed as `<style-block>` rather than `<stylesheet>`

If you meant *declarations that are to be ignored*, I think anything other than an at-rule appearing in a list of rules (`<stylesheet>`) is not ignored but consumed until the parser finds a simple block.

```css
/* top level */
@media {
  property: value; /* consumed as the prelude of... */
  {} /* ... a (invalid) qualified rule */
  @media {}  /* parsed */
}
```

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


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

Received on Tuesday, 11 October 2022 07:36:22 UTC