Files
sousa-gecko/testing/web-platform/tests/css/css-font-loading/fontface-loadingevent.html
T
Alexsander Borges Damaceno f36ec831e6 Bug 1992325 [wpt PR 55202] - [CSS-FONT-LOADING] Add test for firing load event, a=testonly
Automatic update from web-platform-tests
[CSS-FONT-LOADING] Add test for firing load event

--
Update fontface-loadingevent.html
--

wpt-commits: ee2a0e5ac457bdd1963eccd9c1e39c069c318790, a72e4b698a27833669d19e0f8980bb6b3ca74ece
wpt-pr: 55202
2025-10-14 16:11:39 +00:00

22 lines
689 B
HTML

<!DOCTYPE html>
<title>Tests FontFaceSet loading event</title>
<link rel="help" href="https://drafts.csswg.org/css-font-loading/#events">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async t => {
const fontSet = document.fonts;
let loadingFired = false;
fontSet.addEventListener("loading", () => {
loadingFired = true;
});
const TestFont = new FontFace("GoodFont", "url(/fonts/Ahem.ttf)");
fontSet.add(TestFont);
await TestFont.load();
await fontSet.ready;
assert_true(loadingFired, "The 'loading' event should have fired");
}, "FontFaceSet fires correct loading event");
</script>