| Index: LayoutTests/fast/canvas/pixelated-off-screen.html
|
| diff --git a/LayoutTests/css3/images/pixelated-canvas.html b/LayoutTests/fast/canvas/pixelated-off-screen.html
|
| similarity index 73%
|
| copy from LayoutTests/css3/images/pixelated-canvas.html
|
| copy to LayoutTests/fast/canvas/pixelated-off-screen.html
|
| index 6caa2b9d99d83bdd1c90336d5eac6292286bf685..a0f05b547061b74118c5b36b6240e5ca5554c3db 100644
|
| --- a/LayoutTests/css3/images/pixelated-canvas.html
|
| +++ b/LayoutTests/fast/canvas/pixelated-off-screen.html
|
| @@ -7,23 +7,22 @@
|
| }
|
| </style>
|
| <body>
|
| + <!-- Test drawing a canvas off-screen then appending it to the DOM. -->
|
| <!-- The resulting image should be 100x100, consisting of 4 50x50 blocks of solid color, with no blurring of edges -->
|
| - <canvas width="2" height="2"></canvas>
|
| </body>
|
| <script>
|
| // Ignore the render tree.
|
| if (window.testRunner)
|
| window.testRunner.dumpAsTextWithPixelResults();
|
|
|
| - var canvas;
|
| - var imageHandle;
|
| - canvas = document.getElementsByTagName("canvas")[0].getContext("2d");
|
| + var canvas = document.createElement('canvas');
|
| canvas.width = 2;
|
| canvas.height = 2;
|
| - imageHandle = canvas.createImageData(2, 2);
|
| +
|
| + var context = canvas.getContext("2d");
|
| + var imageHandle = context.createImageData(canvas.width, canvas.height);
|
|
|
| var index = 0;
|
| - var length = imageHandle.data.length;
|
|
|
| imageHandle.data[index++] = 255;
|
| imageHandle.data[index++] = 0;
|
| @@ -45,5 +44,6 @@
|
| imageHandle.data[index++] = 0;
|
| imageHandle.data[index++] = 255;
|
|
|
| - canvas.putImageData(imageHandle, 0, 0);
|
| -</script>
|
| + context.putImageData(imageHandle, 0, 0);
|
| + document.getElementsByTagName("body")[0].appendChild(canvas);
|
| +</script>
|
|
|