6 image-rendering: pixelated;
10 <!-- Draw to a canvas already in the DOM. -->
11 <!-- The resulting image should be 100x100, consisting of 4 50x50 blocks of solid color, with no blurring of edges -->
12 <canvas width=
"2" height=
"2"></canvas>
15 // Ignore the render tree.
16 if (window
.testRunner
)
17 window
.testRunner
.dumpAsTextWithPixelResults();
19 var canvas
= document
.getElementsByTagName("canvas")[0];
20 var context
= canvas
.getContext("2d");
21 var imageHandle
= context
.createImageData(canvas
.width
, canvas
.height
);
25 imageHandle
.data
[index
++] = 255;
26 imageHandle
.data
[index
++] = 0;
27 imageHandle
.data
[index
++] = 0;
28 imageHandle
.data
[index
++] = 255;
30 imageHandle
.data
[index
++] = 0;
31 imageHandle
.data
[index
++] = 255;
32 imageHandle
.data
[index
++] = 0;
33 imageHandle
.data
[index
++] = 255;
35 imageHandle
.data
[index
++] = 0;
36 imageHandle
.data
[index
++] = 0;
37 imageHandle
.data
[index
++] = 255;
38 imageHandle
.data
[index
++] = 255;
40 imageHandle
.data
[index
++] = 0;
41 imageHandle
.data
[index
++] = 0;
42 imageHandle
.data
[index
++] = 0;
43 imageHandle
.data
[index
++] = 255;
45 context
.putImageData(imageHandle
, 0, 0);