[csswg-drafts] [css-syntax-3] Preserve appearance order of rules and declarations when consuming a style block's contents (#7286)

cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-syntax-3] Preserve appearance order of rules and declarations when consuming a style block's contents ==
According to [CSS Nesting](https://drafts.csswg.org/css-nesting-1/#mixing):

> Declarations occuring after a nested rule are invalid and ignored.

But the nested rules are appended into the list of declarations in [*consume a style block’s contents*](https://drafts.csswg.org/css-syntax-3/#consume-style-block).

> Create an initially empty list of declarations decls, and an initially empty list of rules rules.
>
> [...]
>
> `<EOF-token>`: Extend `decls` with `rules`, then return `decls`.
>
> [...]

I do not know if Syntax should remain decoupled from any context validation in other specs but at least, rules and declarations could be pushed into the same list, in appearance order. Otherwise the procedure could skip a declaration if the rule list is not empty.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7286 using your GitHub account


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

Received on Wednesday, 18 May 2022 15:58:23 UTC