layout/reftests/canvas/transformed-clip.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 <html>
     2 <body>
     3   <canvas width="500" height="500"></canvas>
     4 <script>
     5   var canvas = document.getElementsByTagName('canvas')[0];
     6   var ctx = canvas.getContext('2d');
     8   ctx.translate(500, 500);
     9   ctx.fillStyle = "red";
    10   ctx.beginPath();
    11   ctx.rect(-250, -250, 50, 50);
    12   ctx.clip();
    13   ctx.fillRect(-500,-500,500,500);
    14 </script>
    15 </body>
    16 </html>

mercurial