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

Yeah -- from testing in the web console, it looks like Gecko is doing what I'd intuitively expect: the src descriptor is *valid* provided the argument(s) to the `tech()` function are (all) valid keywords. Throwing an unknown keyword in there *will* cause the source to be dropped (and if all source entries are dropped, we have a parse error). But a valid source with unsupported tech doesn't result in a parse error, it's just an unusable source and will be skipped during loading.

Some experiments:
```
> style = document.createElement("style") 
< <style>

> document.body.appendChild(style) 
< <style>

> style.textContent = "@font-face { font-family: foo; src: url(foo.ttf) tech(features-opentype, color-SVG); }" 
< "@font-face { font-family: foo; src: url(foo.ttf) tech(features-opentype, color-SVG); }" 

// Valid src descriptor, even though `incremental` is not a supported technology:
> style.textContent = "@font-face { font-family: foo; src: url(foo.ttf) tech(features-opentype, incremental); }" 
< "@font-face { font-family: foo; src: url(foo.ttf) tech(features-opentype, incremental); }" 

> style.textContent = "@font-face { font-family: foo; src: url(foo.ttf) tech(incremental); }" 
< "@font-face { font-family: foo; src: url(foo.ttf) tech(incremental); }" 

// Unknown keyword causes the src list entry to be dropped, leaving the list empty, which is invalid:
> style.textContent = "@font-face { font-family: foo; src: url(foo.ttf) tech(features-unknown); }" 
! Unknown descriptor 'src: url(foo.ttf) tech(features-unknown);' in @font-face rule. Skipped to next declaration. blank:1:72
< "@font-face { font-family: foo; src: url(foo.ttf) tech(features-unknown); }" 

// This is true even if there are valid keywords alongside the invalid one:
> style.textContent = "@font-face { font-family: foo; src: url(foo.ttf) tech(features-opentype, color-SVG, unknown); }" 
! Unknown descriptor 'src: url(foo.ttf) tech(features-opentype, color-SVG, unknown);' in @font-face rule. Skipped to next declaration. blank:1:93
< "@font-face { font-family: foo; src: url(foo.ttf) tech(features-opentype, color-SVG, unknown); }" 

// But only the bad source is dropped, so if there's another entry in the list, the descriptor is still valid:
> style.textContent = "@font-face { font-family: foo; src: url(foo.ttf) tech(features-opentype, color-SVG, unknown), url(bar.ttf); }" 
< "@font-face { font-family: foo; src: url(foo.ttf) tech(features-opentype, color-SVG, unknown), url(bar.ttf); }" 
```

-- 
GitHub Notification of comment by jfkthame
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9054#issuecomment-1631132501 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:28:19 UTC