Closed Bug 1715546 Opened 3 years ago Closed 2 years ago

Support for @font-face src: descriptor's "tech(...)" syntax


(Core :: CSS Parsing and Computation, enhancement)




105 Branch
Tracking Status
firefox105 --- fixed


(Reporter: drott, Assigned: jfkthame)



(Keywords: dev-doc-complete)


(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.39 Safari/537.36

Steps to reproduce:

FF drops @font-face src: lines which contain "supports ..." stances in their src: line. The CSS Fonts spec lists parsing rules for the src: line:
which explain that the expected behaviour is to parse and analyse entries of the src: line according to the following grammar (excerpt)

<url> [ format(<font-format> [supports <font-technology>#]?)]? | local(<font-face-name>)
<font-format> = [<string> | woff | truetype | opentype | woff2 | embedded-opentype | collection | svg]
<font-technology> = [features | variations | color(<color-font-technology>) | palettes]

and then dropping entries which specify an unsupported format or technology but are considered syntactically correct.

Related issue for parsing issues for format() keywords instead of strings is issue 650372.

Actual results:

FF drops the complete src: line.

Expected results:

FF should understand the supports keyword and the listed technologies including color(...) and drop entries which reference a font with unsupported technologies.

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

Updating the bug title to reflect the current spec: CSS Fonts 4 has evolved such that instead of supports <font-technology> within the format() function, there's now a separate tech() function that takes keywords such as variations, color-COLRv1, etc.

Ever confirmed: true
Summary: Support for @font-face src: line "supports <technology>" syntax → Support for @font-face src: descriptor's "tech(...)" syntax
Assignee: nobody → jfkthame

Dominik, I notice that tech() doesn't yet seem to be implemented in Chrome Canary (or is there a flag I need to set?) -- I wondered if you can say anything about plans here, as it'll be of somewhat limited use until it is more widely supported.

Flags: needinfo?(drott)

Planning to ship this, compare: - and hoping to get to it this quarter.

Flags: needinfo?(drott)
Pushed by
Add support for the @font-face src descriptor's tech() function. r=emilio
Add WPT tests for parsing of the @font-face src descriptor's tech() function. r=emilio
Created web-platform-tests PR for changes under testing/web-platform/tests
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
Upstream PR merged by moz-wptsync-bot
Blocks: 1740530
Keywords: dev-doc-needed

FYI Docs work for this can be tracked in

Following this going behind a pref in 1786804 all I've done is added to the experimental features and also the browser compatibility data. We follow your lead and add documentation for tech() once the API stabilizes.

Blocks: 1794277
You need to log in before you can comment on or make changes to this bug.