Skip to content

[css-font-loading] FontFaceSet.load() promise rejections #7680

@litherum

Description

@litherum

The spec says:

  1. Find the matching font faces from font face set using the font and text arguments passed to the function, and let font face list be the return value (ignoring the found faces flag). If a syntax error was returned, reject promise with a SyntaxError exception and terminate these steps.
  2. Queue a task to run the following steps synchronously:
    1. For all of the font faces in the font face list, call their load() method.
    2. Resolve promise with the result of waiting for all of the [[FontStatusPromise]]s of each font face in the font face list, in order.

However, this is not, in fact, what (any) browser does. This text indicates that either A) the string passed to load() is a syntax error, or B) the promise is resolved (rather than rejected). However, WebKit, Chrome, and Firefox all reject the promise if no fonts were able to be loaded. (WebKit rejects the promise if any font was unable to be loaded, and I'm not sure about the other browsers.)

I suggest we make the spec match what is de-facto true in browsers.

test.html.zip

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