Index: LayoutTests/fast/canvas/pixelated-resize.html |
diff --git a/LayoutTests/fast/canvas/pixelated-resize.html b/LayoutTests/fast/canvas/pixelated-resize.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..239ad7f0630f9d93b24b01bf9b5f5146237d234a |
--- /dev/null |
+++ b/LayoutTests/fast/canvas/pixelated-resize.html |
@@ -0,0 +1,35 @@ |
+<!DOCTYPE html> |
+<style> |
+ img { |
+ display: none; |
+ } |
+ canvas { |
+ width: 1000px; |
+ height: 1000px; |
+ image-rendering: pixelated; |
+ } |
+</style> |
+<body> |
+ <img src="resources/dice_alpha.png"> |
+ <!-- Test that resizing a pixelated canvas works. --> |
+ <!-- The canvas should be upscaled without blurring. --> |
+ <canvas width="300" height="300"></canvas> |
+</body> |
+<script> |
+ // Ignore the render tree. |
+ if (window.testRunner) |
+ window.testRunner.dumpAsTextWithPixelResults(); |
+ |
+ var image = document.getElementsByTagName("img")[0]; |
+ |
+ function draw() { |
+ var canvas = document.getElementsByTagName("canvas")[0]; |
+ var context = canvas.getContext("2d"); |
+ context.drawImage(image, -0.5, -0.5, 300, 300); |
+ // Resize so that the image buffer is reset. |
+ canvas.width = 301; |
+ canvas.style.width = "1001px"; |
+ context.drawImage(image, -0.5, -0.5, 300, 300); |
+ } |
+ window.onload = draw; |
+</script> |