Skip to content

Commit 1c9918b

Browse files
simonwuelkerservo-wpt-sync
authored andcommitted
Add web platform test
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
1 parent 56d37a3 commit 1c9918b

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<link rel="stylesheet" href="/fonts/ahem.css">
5+
</head>
6+
<body>
7+
<div style="font-family: Ahem">This text should be rendered using Ahem</div>
8+
</body>
9+
</html>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html class="reftest-wait">
3+
<head>
4+
<title>Removing a @font-face while it is loading works</title>
5+
<meta name="assert" content="Removing a @font-face while it is loading works" />
6+
<link rel="author" title="Simon Wülker" href="simon.wuelker@arcor.de">
7+
<link rel="stylesheet" href="/fonts/ahem.css">
8+
<link rel="match" href="remove-rule-while-font-face-is-loading-ref.html">
9+
</head>
10+
<body>
11+
<!-- Ensures that the Lato font is actually loaded once the @font-face rule is available -->
12+
<div style="font-family: Lato, Ahem">This text should be rendered using Ahem</div>
13+
<script>
14+
let style = document.createElement("style");
15+
style.textContent = `
16+
@font-face {
17+
font-family: Lato;
18+
src: url("/fonts/Lato-Medium.ttf?pipe=trickle(d1)");
19+
}
20+
`;
21+
document.body.appendChild(style);
22+
window.requestAnimationFrame(() => {
23+
style.remove();
24+
25+
document.fonts.ready.then(() => {
26+
document.documentElement.classList.remove("reftest-wait");
27+
})
28+
})
29+
</script>
30+
31+
</body>
32+
</html>

0 commit comments

Comments
 (0)