- From: Vitor Roriz via GitHub <sysbot+gh@w3.org>
- Date: Fri, 16 Jun 2023 16:46:08 +0000
- To: public-css-archive@w3.org
vitorroriz has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-fonts-5] should font-face src format() parse any string? == The font-format syntax is: ``` <font-format>= [<string> | collection | embedded-opentype | opentype | svg | truetype | woff | woff2 ] ``` So the answer to my question would be yes. This is also expected [by the related WPT test](https://github.com/web-platform-tests/wpt/blob/dd6156ef5158cc1538250af5ed20f0909c7bdfce/css/css-fonts/parsing/font-face-src-format.html#L47-L54): ``` // Unknown format string still matches the grammar, although it won't be // loaded. UAs may choose to either not load it, or not add unsupported // entries to the list, ensure that subsequent component of the list are // still recognized. ``` But I'm wondering, if we really should parse any string and then reject the unsupported ones during loading, or if we should already return a parse error for the unsupported strings. I guess we could possibily do that, since spec says that `format(collection)` and `format("collection")` should have the same _effect_. And the effects can now be slightly different. For example, if the engine doesn't support `collection`, `format(collection)` will be rejected at parsing but `format("collection")` will only be rejected at loading. > While keywords are preferred to identify font formats, for reasons of backwards compatibility the following strings are also accepted, and have the same effect as if the equivalent modern syntax had been used. And there is no intention to add to this list: > NOTE: The CSS WG does not anticipate extending this list of format strings in the future. Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8978 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 16 June 2023 16:46:10 UTC