Re: [csswg-drafts] [css-fonts-4] @font-face src tech() multiple value syntax (#9054)

> However, I'm confused if an engine should validate `tech(A, B)` only if it supports both `A` **and** `B` technologies, or if it supports `A` **or** `B` techonologies.
> 
> I think it makes more sense to be `A` **and** `B` although I've interpreted as `A` **or** `B` at first and implemented it that way for WebKit. This resulted in a bug filed at https://bugs.webkit.org/show_bug.cgi?id=258948.

The spec text re [Selecting items in the src](https://www.w3.org/TR/css-fonts-4/#font-face-src-formats) says that:

> Conformant user agents must skip downloading a font resource if [...] **any of the font technologies** are unsupported by the user agent

(my emphasis), so it's definitely supposed to be "A and B".

What's a bit confusing, though, is that in [Parsing the src descriptor](https://drafts.csswg.org/css-fonts-5/#font-face-src-parsing), the spec says:

> If parsing a component value results in a parsing error or its format or tech are unsupported, do not add it to the list of supported sources.

> If there are no supported entries at the end of this process, the value for the [src](https://drafts.csswg.org/css-fonts-4/#descdef-font-face-src) descriptor is a parse error.

which means that if any of the requested technologies is unsupported, the source is not added to the list at all; and therefore the need to "skip downloading a font resource" shouldn't arise as it won't be in the list. (Parsing the descriptor happens before there's any question of selecting items in the source list.)

And if the list ends up empty because the only source (or all sources) were dropped as unsupported, the spec says this is a parse error. This seems a bit strange to me; it's not (in my mind) a **parse** error, it's a perfectly valid rule that doesn't happen to provide any usable resources. I'm sure this must have been discussed at some point, but don't recall the details offhand.

Anyhow, I'll take a look at what Gecko is doing....

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


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

Received on Tuesday, 11 July 2023 16:08:21 UTC