LibWeb: Support <custom-ident> in FontFaceSet::load()

This exposed a false positive in our test suite which has been fixed and
made more robust
This commit is contained in:
Callum Law
2026-01-08 23:27:38 +13:00
committed by Sam Atkins
parent 9b20fe6902
commit e114c7341e
Notes: github-actions[bot] 2026-01-13 10:41:47 +00:00
3 changed files with 24 additions and 7 deletions

View File

@@ -4,7 +4,7 @@
asyncTest(async done => {
const fontFaceSet = document.fonts;
const fontFace = new FontFace("Hash Sans", "url(../../../../Assets/HashSans.woff)");
const fontFace = new FontFace("Hash Sans", "url(../../../Assets/HashSans.woff)");
fontFaceSet.add(fontFace);
try {
@@ -22,8 +22,15 @@
}
try {
await fontFaceSet.load("1em Hash Sans");
println("Load valid font: PASS");
const result = await fontFaceSet.load("10px NonExistentFont");
println(`Load non-existent font: ${result.length == 0 ? "PASS" : "FAIL"}`);
} catch {
println("Load non-existent font: FAIL");
}
try {
const result = await fontFaceSet.load("1em Hash Sans");
println(`Load valid font: ${result.length > 0 ? "PASS" : "FAIL"}`);
} catch (e) {
println("Load valid font: FAIL");
println(e);