Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / css3 / images / pixelated-hidpi.html
blob3b4791c90031a79668f44200fc4d5017c79674db
1 <!DOCTYPE html>
2 <style>
3 canvas {
4 width: 10px;
5 height: 10px;
6 image-rendering: pixelated;
8 img {
9 width: 10px;
10 height: 10px;
11 image-rendering: pixelated;
13 svg {
14 width: 10px;
15 height: 10px;
17 image {
18 image-rendering: pixelated;
20 </style>
21 <body>
22 <!-- The output should be checkerboards all 20x20 with sharp 2x2 blocks and no blurring. -->
23 <!-- FIXME: this test is a little too small to visually inspect for blurring. Should we make the test larger and more accessible? -->
24 <canvas width="10" height="10"></canvas>
25 <img src="resources/pixelated-hdpi.png">
26 <svg><image width="10" height="10" xlink:href="resources/pixelated-hdpi.png"/></svg>
27 </body>
28 <script>
29 function drawImageToCanvas() {
30 var image = document.getElementsByTagName("img")[0];
31 var canvas = document.getElementsByTagName("canvas")[0].getContext("2d");
32 canvas.drawImage(image, 0, 0);
35 function runTest() {
36 if (!window.testRunner)
37 return;
39 // Ignore the render tree.
40 testRunner.dumpAsTextWithPixelResults();
42 testRunner.waitUntilDone();
43 testRunner.setBackingScaleFactor(2, function () {
44 drawImageToCanvas();
45 testRunner.notifyDone();
46 });
49 window.onload = runTest;
50 </script>