csswg-drafts icon indicating copy to clipboard operation
csswg-drafts copied to clipboard

[css-values-5] `<any-value>` in functional `<general-enclosed>` should be a non-strict comma-containing production

Open cdoublev opened this issue 4 months ago • 0 comments

About comma-containing productions:

If it does not start with a "{" token, then it cannot contain commas or {} blocks

@media unknown(foo, bar) {} and @media unknown({}) {} are valid today. So I think <any-value> in the functional <general-enclosed> should be defined as a non-strict comma-containing production.

I guess the above restriction should only apply in functions (which is unclear), so there is no need to define <any-value> in the <general-enclosed> block to allow @media (foo, bar) {} and @media ({}) to be parsed as valid rules, as well as :unknown-pseudo(foo, bar) and :unknown-pseudo({}) as <pseudo-class-selector>s.

(edit)

I missed that non-strict containing production should still follow the syntax rules when it actually starts with a {}-block, so I think <any-value> in functional <general-enclosed> should be something different. Perhaps the spec should just say that the rules should only apply in declaration values.

cdoublev avatar Oct 16 '24 13:10 cdoublev