Skip to content

[css-font-loading-3] Unclear how to parse font families #3776

@litherum

Description

@litherum

https://drafts.csswg.org/css-font-loading-3/#font-face-constructor

Parse the family argument, and the members of the descriptors argument, according to the grammars of the corresponding descriptors of the CSS @font-face rule.

https://drafts.csswg.org/css-fonts-4/#family-name-syntax

Font family names other than generic families must either be given quoted as <string>s, or unquoted as a sequence of one or more identifiers.

So what if you have

new FontFace("4m", source)

It is neither a quoted string nor an unquoted sequence of one or more identifiers (identifiers can't start with a number), so WebKit throws an exception here. However, Chrome and Firefox treat the argument as if it was quoted.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions