script: add skeleton implementation of FontFace API (#35262)

This patch implements the `FontFace` interface, but with some caveats

1. The interface is only exposed on `Window`. Support for Workers will
   be handled in the future.
2. The concept of `css-connected` `FontFace` is not implemented, so
   `@font-face` rules in stylesheets will not be represented in the DOM.
3. The constructor only supports using `url()` strings as source
   and `ArrayBuffer` and `ArrayBufferView` are not supported yet.

A skeleton implementation of the `load` method of `FontFaceSet` is also
implemented in this patch. The intention is to support some web pages
that don't load without this method.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Mukilan Thiyagarajan 2025-02-19 11:20:01 +05:30 committed by GitHub
parent 29e0fad21e
commit 56840e0a35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 1160 additions and 551 deletions

View file

@ -1,4 +0,0 @@
[2d.text.draw.fill.maxWidth.fontface.html]
[fillText works on @font-face fonts]
expected: FAIL

View file

@ -1,6 +1,3 @@
[2d.text.measure.width.empty.html]
[The empty string has zero width for OffscreenCanvas]
expected: FAIL
[The empty string has zero width]
expected: FAIL

View file

@ -0,0 +1,2 @@
[canvas.2d.fontStretch.condensed.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[canvas.2d.fontStretch.expanded.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[canvas.2d.fontStretch.extra-condensed.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[canvas.2d.fontStretch.extra-expanded.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[canvas.2d.fontStretch.normal.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[canvas.2d.fontStretch.semi-condensed.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[canvas.2d.fontStretch.semi-expanded.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[canvas.2d.fontStretch.ultra-condensed.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[canvas.2d.fontStretch.ultra-expanded.html]
expected: FAIL