Skip to content

[css-font-loading] Lack of interop on FontFace constructor. #6236

@emilio

Description

@emilio
new FontFace("Font 01", "").family

Is an empty string in Gecko, because Font 01 is not a valid family name (you need to quote it because 01 is not a CSS identifier)

Safari says normal.

Chrome says Font 01.

My understanding is that Gecko is right, per https://drafts.csswg.org/css-font-loading/#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. If the source argument is a CSSOMString, parse it according to the grammar of the CSS src descriptor of the @font-face rule. If any of them fail to parse correctly, reject font face’s [[FontStatusPromise]] with a DOMException named "SyntaxError", set font face’s corresponding attributes to the empty string, and set font face’s status attribute to "error". Otherwise, set font face’s corresponding attributes to the serialization of the parsed values.

But given the lack of interop other members may disagree? What is exactly going on in Safari / Chrome?

@litherum @lilles

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Agenda+

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions