summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/font-update.html
blob: d621d8943e76dd71a4102c41ea67202f41544383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<style>
    @font-face {
        font-family: no-such-font;
        src: url(no-such-file.ttf);
    }
</style>
<canvas id="target"></canvas>
<script>
    canvas = document.getElementById("target");
    ctx = canvas.getContext('2d');
    ctx.font = "100px no-such-font, ahem";
    ctx.fillStyle = "red";
    ctx.fillText("B", 0, 100);
    ctx.fillStyle = "green";
    canvas.parentNode.removeChild(canvas);
    if (window.testRunner)
        testRunner.waitUntilDone();
    setTimeout(function()
    {
        ctx.fillText("A", 0, 100);
        document.body.appendChild(canvas);
        if (window.testRunner)
            testRunner.notifyDone();
    }, 50);
</script>