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

  > > I am not sure what type of item represents `<block-contents>` and its specific sub-productions: is it a simple block (ie. a component) or an undefined structure (containing declarations and/or rules)? The return value of *consume a block's contents* is a bit handwavey. But this may be intentional...
  >
  > The return value isn't at all handwavey - it's a list of declarations and a list of rules. `<block-contents>` represents the contents of a block; it is not the block itself (it doesn't represent the wrapping `{}`). **These productions aren't substantially different from what was there before**, I just reshuffled them a little bit.

I think my point was that I find a bit inconsistent that the algorithms for consuming rules no longer process one level at a time, leaving lower levels as a list of component values. I would expect to process the block with *parse a block’s contents* before checking its grammar:

  > The CSS parser is agnostic as to the contents of blocks—they’re all [parsed with the same algorithm](https://drafts.csswg.org/css-syntax-3/#consume-a-blocks-contents)

But it expects a list of component values, as it is only intended for an independent block, eg. `style.cssText`. It cannot handle a block resulting from *parse a rule*.

When rule blocks were consumed with *consume a simple block* while consuming a rule, the resulting simple block value was a list of component values to consume with the appropriate algorithm before checking the grammar.

Anyway, it is probably not important.

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


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

Received on Saturday, 19 August 2023 07:03:54 UTC