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

[css-syntax-3] "Consume a block's contents" leaves decls list with #11017

Open
AtkinsSJ opened this issue Oct 10, 2024 · 0 comments
Open

[css-syntax-3] "Consume a block's contents" leaves decls list with #11017

AtkinsSJ opened this issue Oct 10, 2024 · 0 comments

Comments

@AtkinsSJ
Copy link
Contributor

Consume a block's 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>
<}-token>
Return rules.

into this:

<EOF-token>
<}-token>
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants