[csswg-drafts] [css-syntax-3] Should `@font-face/src` accept a positioned {} block? (#12508)

cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-syntax-3] Should `@font-face/src` accept a positioned {} block? ==
In Chrome and FF, `@font-face { src: {}, local(serif) }` is valid and registers a font face with `local(serif)` as its source.

But according to CSS Syntax, [consuming a declaration](https://drafts.csswg.org/css-syntax-3/#consume-a-declaration) should return nothing:

  > Otherwise, if `decl`’s value contains a top-level simple block with an associated token of `<{-token>`, and also contains any other non-`<whitespace-token>` value, return nothing.

Then `src: {}` should be consumed as a qualified rule, invalid in the context and dumped, like `, local(serif)`. The result should be an empty `@font-face {}`.

Is there any reason to make an exception and allow a positioned block when [parsing](https://drafts.csswg.org/css-syntax-3/#css-parse-a-comma-separated-list-according-to-a-css-grammar) a declaration value defined with a forgiving grammar? Or is it just a browser issue?

Related: https://github.com/w3c/csswg-drafts/issues/11966.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12508 using your GitHub account


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

Received on Monday, 21 July 2025 17:24:34 UTC