Chromium Code Reviews| Index: LayoutTests/css3/images/pixelated-canvas.html |
| diff --git a/LayoutTests/css3/images/pixelated-canvas.html b/LayoutTests/css3/images/pixelated-canvas.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9ed4951ca492d1d03f81ee643f4ca986e50b3442 |
| --- /dev/null |
| +++ b/LayoutTests/css3/images/pixelated-canvas.html |
| @@ -0,0 +1,57 @@ |
| +<!DOCTYPE html> |
| +<style> |
| + canvas { |
| + display: block; |
| + position: fixed; |
|
pdr.
2014/06/13 03:59:23
There are a lot of unnecessary values here. I thin
jackhou
2014/06/13 04:27:32
Done.
|
| + left: 0px; |
| + top: 0px; |
| + right: 0px; |
| + bottom: 0px; |
| + border: none; |
| + width: 100px; |
| + height: 100px; |
| + margin: 0px; |
| + padding: 0px; |
| + image-rendering: pixelated; |
| + } |
| +</style> |
| +<body> |
| + <!-- 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> |
| + if (window.layoutTestController) |
|
pdr.
2014/06/13 03:59:23
I haven't seen this since pre-fork Webkit :) Can y
jackhou
2014/06/13 04:27:31
Yeah, I patched these from a 2 year old CL without
|
| + layoutTestController.dumpAsText(true); |
| + |
| + var canvas; |
|
pdr.
2014/06/13 03:59:23
Nit: indentation.
jackhou
2014/06/13 04:27:31
Done.
|
| + var imageHandle; |
| + canvas = document.getElementsByTagName("canvas")[0].getContext("2d"); |
| + canvas.width = 2; |
| + canvas.height = 2; |
| + imageHandle = canvas.createImageData(2, 2); |
| + |
| + var index = 0; |
| + var length = imageHandle.data.length; |
| + |
| + imageHandle.data[index++] = 255; |
| + imageHandle.data[index++] = 0; |
| + imageHandle.data[index++] = 0; |
| + imageHandle.data[index++] = 255; |
| + |
| + imageHandle.data[index++] = 0; |
| + imageHandle.data[index++] = 255; |
| + imageHandle.data[index++] = 0; |
| + imageHandle.data[index++] = 255; |
| + |
| + imageHandle.data[index++] = 0; |
| + imageHandle.data[index++] = 0; |
| + imageHandle.data[index++] = 255; |
| + imageHandle.data[index++] = 255; |
| + |
| + imageHandle.data[index++] = 0; |
| + imageHandle.data[index++] = 0; |
| + imageHandle.data[index++] = 0; |
| + imageHandle.data[index++] = 255; |
| + |
| + canvas.putImageData(imageHandle, 0, 0); |
|
pdr.
2014/06/13 03:59:23
nit: indentation.
jackhou
2014/06/13 04:27:31
Done.
|
| +</script> |