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
22 lines
689 B
HTML
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>
|