4 <p>A green square should appear below this text.
</p>
5 <canvas id=
"c" width=
"100" height=
"100"></canvas>
7 window
.onload = function() {
8 var canvas
= document
.getElementById("c")
9 var ctx
= canvas
.getContext("2d")
10 ctx
.fillStyle
= 'red';
11 ctx
.fillRect(0, 0, 100, 100);
12 ctx
.translate(100, 0);
14 // If canvas was in diplay list mode, this will trigger a fallback
15 var dataUrl
= canvas
.toDataURL();
16 // This should reset the current transform. crbug.com/445162 had to do with
17 // The fallback interfering with the mechanism that resets state when the canvas
18 // is cleared by resetting its size to the same value.
21 ctx
.fillStyle
= 'green';
22 ctx
.fillRect(0, 0, 100, 100);