LibWeb: Properly parse attributes for CSS-connected FontFace

Previously we would just set the attributes to the serialized
descriptors, even if they were the empty string.

We now apply defaults when we have empty descriptors and apply parsing
logic from the various `set_*` methods (only applicable to `font-family`
so far where we now extract the value from either a string or a
custom-ident)

Fixes an issue in some css/css-shapes WPT tests where we weren't
properly matching fonts.
This commit is contained in:
Callum Law
2026-01-11 00:17:50 +13:00
committed by Sam Atkins
parent bbfe7c64fe
commit 668d3afde0
Notes: github-actions[bot] 2026-01-13 10:41:03 +00:00
10 changed files with 238 additions and 136 deletions

View File

@@ -6,7 +6,7 @@
promiseTest(async () => {
await document.fonts.ready.then(async () => {
await document.fonts
.load('10px \\"Ahem\\"')
.load("10px Ahem")
.then(loadedFonts => {
if (loadedFonts.length == 1) println("PASS!");
else println("FAIL! Didn't match any fonts.");