Skip to content

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=290042 #52689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions html/canvas/offscreen/manual/text/canvas.2d.fillText-FontFace.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!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>
21 changes: 21 additions & 0 deletions html/canvas/offscreen/manual/text/canvas.2d.fillText.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<title>HTML 5 Canvas Test: fillText() after transferControlToOffscreen draws text</title>
<link rel="mismatch" href="empty-ref.html">
<meta charset="utf-8">
<meta name="assert" content="fillText() after transferControlToOffscreen() draws text">
<script src="/common/reftest-wait.js"></script>
</head>
<body onload="runTest()">
<canvas id="c"></canvas>
<script>
function runTest() {
const c = document.getElementById("c");
const ctx = c.transferControlToOffscreen().getContext("2d");
ctx.fillText("T", 5, 50);
takeScreenshot();
}
</script>
</body>
</html>
Empty file.