layout/reftests/svg/as-image/canvas-drawImage-scale-1b.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/svg/as-image/canvas-drawImage-scale-1b.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +<html class="reftest-wait">
     1.5 +  <head>
     1.6 +    <script type="text/javascript">
     1.7 +      function go() {
     1.8 +        var canvas = document.getElementById("canvas");
     1.9 +        var ctx = canvas.getContext("2d");
    1.10 +
    1.11 +        // Draw some orange
    1.12 +        ctx.fillStyle = "orange";
    1.13 +        ctx.fillRect(0, 0, 100, 100);
    1.14 +
    1.15 +        // Instantiate an image. Once it has loaded, draw it & take snapshot.
    1.16 +        var image = new Image();
    1.17 +        image.onload = function() {
    1.18 +          // Note that our canvas is 100x100, so our scaled 200x200 image will
    1.19 +          // get cropped to 100x100.
    1.20 +          ctx.scale(2, 2);  // Scale our image-drawing by 2
    1.21 +          ctx.drawImage(image, 0, 0);
    1.22 +          document.documentElement.removeAttribute("class");
    1.23 +        }
    1.24 +        image.src ="lime100x100.svg";
    1.25 +      }
    1.26 +    </script>
    1.27 +  </head>
    1.28 +  <body onload="go()">
    1.29 +    <canvas id="canvas" width="100" height="100"></canvas>
    1.30 +</body>
    1.31 +</html>

mercurial