[csswg-drafts] [css-syntax-3] "Consume a block's contents" leaves `decls` list with (#11017)

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

== [css-syntax-3] "Consume a block's contents" leaves `decls` list with  ==
[Consume a block's contents](https://drafts.csswg.org/css-syntax/#consume-block-contents) collects declarations into the `decls` list, but only copies that over into `rules` when an at-rule is encountered. If `decls` is not empty when `<EOF-token>` or `<}-token>` is encountered, those declarations are lost.

I think the fix is to change this:
> [`<EOF-token>`](https://drafts.csswg.org/css-syntax/#typedef-eof-token)
> [`<}-token>`](https://drafts.csswg.org/css-syntax/#tokendef-close-curly)
>    Return rules.

into this:
> [`<EOF-token>`](https://drafts.csswg.org/css-syntax/#typedef-eof-token)
> [`<}-token>`](https://drafts.csswg.org/css-syntax/#tokendef-close-curly)
>    If decls is not empty, append it to rules.
>    Return rules.

This at least worked for me.

---

As a side note, not sure if #8834 is asking for this particular kind of feedback, but the new algorithms have been very straightforward to implement directly, and feel like a nice improvement to how they worked previously. (Token streams are how I'd ended up implementing it before so it's nice to have that actually match the spec!) So thanks @tabatkins

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


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

Received on Thursday, 10 October 2024 15:22:59 UTC