LibWeb: Use correct base-url for CSS-connected FontFace

Previously we would always try to load the font URL relative to the
document's base URL. This commit means that for CSS-connected
`FontFace`s we now try to load relative to the URL of the stylesheet
that contains the associated `CSSFontFaceRule`
This commit is contained in:
Callum Law
2026-01-11 00:01:09 +13:00
committed by Sam Atkins
parent 3996d9ec82
commit 9af90f81bf
Notes: github-actions[bot] 2026-01-13 10:41:15 +00:00
3 changed files with 21 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<link href="../../../Ref/data/fonts/ahem.css" rel="stylesheet" />
<script src="../include.js"></script>
<script>
promiseTest(async () => {
await document.fonts.ready.then(async () => {
await document.fonts
.load('10px \\"Ahem\\"')
.then(loadedFonts => {
if (loadedFonts.length == 1) println("PASS!");
else println("FAIL! Didn't match any fonts.");
})
.catch(e => println("FAIL! Exception during font load: " + e));
});
});
</script>
</html>