Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html class="reftest-wait">
<head>
<title>HTML 5 Canvas Test: fillText() after loading a FontFace and transferControlToOffscreen draws text</title>
<link rel="mismatch" href="empty-ref.html">
<meta charset="utf-8">
<meta name="assert" content="fillText() after loading a FontFace and transferControlToOffscreen() draws text">
<script src="/common/reftest-wait.js"></script>
</head>
<body onload="runTest()">
<canvas id="c"></canvas>
<script>
function runTest() {
let test_font = new FontFace(
"Lato-Medium",
"url(/fonts/Lato-Medium.ttf)"
);
test_font.load().then(font => {
const c = document.getElementById("c");
const ctx = c.transferControlToOffscreen().getContext("2d");
// This should also draw text without setting the font.
ctx.fillText("T", 5, 50);
takeScreenshot();
});
}
</script>
</body>
</html>