Skip to content

[css-syntax-3] Return syntax error from parse a declaration with a trailing ;? #11730

@cdoublev

Description

@cdoublev

Parse a declaration is intended for parsing @supports conditions. It invokes consume a declaration, which stops consuming the value when it finds ;:

  1. Consume a list of component values from input, with nested, and with <semicolon-token> as the stop token, and set decl’s value to the result.

A CSS parser would fail to match color: green; against <declaration> because the input is not fully consumed. But (color: green;) would then match <general-enclosed>.

Should it return a syntax error when the next token is not <EOF-token> instead, like parse a rule, for consistency?

  1. If the next token from input is an <EOF-token>, return rule. Otherwise, return a syntax error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions