Re: [csswg-drafts] [css-syntax] Review requested of new Parsing text (#8834)

I hope feedback is still welcome! I have a few notes from implementing this myself last week:
- "Consume a block's contents" loses declarations, see #11017.
- "Consume a list of component values" has the parameters listed as `input`, `stop-token`, `nested`, but the usage in "Consume a declaration" step 5 has them in `input`, `nested`, `stop-token` order. The other usage in "parse a comma-separated list of component values" is correct.
- Algorithms are inconsistent between checking if the next token is EOF, or checking if the token stream is empty. These are functionally the same so it would be nice if they all checked for empty.
- I think it would help if "valid in the current context" had a linked-to definition somewhere, even if that definition is brief and says that it depends on the current rule. (Explicit instructions for keeping track of context would be a nice too. :wink: )
- The definition for [at-rule](https://drafts.csswg.org/css-syntax/#ref-for-at-rule%E2%91%A0%E2%91%A1) says it contains a list of declarations and a list of child rules, but "Consume an at-rule" only ever sets its child rules, using "Consume a block". I think this could be clearer. There is a note about materializing into the CSSOM, but really, it either needs handling before assigning to child rules, or child rules needs to optionally hold lists of declarations until the at-rule gets materialized later. I would be tempted to replace the note with an explicit "assign the contents to child rules and declarations, depending on the rule" step.

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


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

Received on Monday, 14 October 2024 16:20:59 UTC