Skip to content

Commit 197f5ed

Browse files
author
Mirko Brodesser
authored
1 parent a238c9e commit 197f5ed

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html class="reftest-wait">
3+
<head>
4+
<title>HTML 5 Canvas Test: fillText() after loading a FontFace and transferControlToOffscreen draws text</title>
5+
<link rel="mismatch" href="empty-ref.html">
6+
<meta charset="utf-8">
7+
<meta name="assert" content="fillText() after loading a FontFace and transferControlToOffscreen() draws text">
8+
<script src="/common/reftest-wait.js"></script>
9+
</head>
10+
<body onload="runTest()">
11+
<canvas id="c"></canvas>
12+
<script>
13+
function runTest() {
14+
let test_font = new FontFace(
15+
"Lato-Medium",
16+
"url(/fonts/Lato-Medium.ttf)"
17+
);
18+
19+
test_font.load().then(font => {
20+
const c = document.getElementById("c");
21+
const ctx = c.transferControlToOffscreen().getContext("2d");
22+
// This should also draw text without setting the font.
23+
ctx.fillText("T", 5, 50);
24+
takeScreenshot();
25+
});
26+
}
27+
</script>
28+
</body>
29+
</html>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html class="reftest-wait">
3+
<head>
4+
<title>HTML 5 Canvas Test: fillText() after transferControlToOffscreen draws text</title>
5+
<link rel="mismatch" href="empty-ref.html">
6+
<meta charset="utf-8">
7+
<meta name="assert" content="fillText() after transferControlToOffscreen() draws text">
8+
<script src="/common/reftest-wait.js"></script>
9+
</head>
10+
<body onload="runTest()">
11+
<canvas id="c"></canvas>
12+
<script>
13+
function runTest() {
14+
const c = document.getElementById("c");
15+
const ctx = c.transferControlToOffscreen().getContext("2d");
16+
ctx.fillText("T", 5, 50);
17+
takeScreenshot();
18+
}
19+
</script>
20+
</body>
21+
</html>

html/canvas/offscreen/manual/text/empty-ref.html

Whitespace-only changes.

0 commit comments

Comments
 (0)