layout/reftests/canvas/strokeText-path.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/canvas/strokeText-path.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,33 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +  <head>
     1.7 +    <script type="text/javascript"><!--
     1.8 +window.onload = function () {
     1.9 +  var canvas = document.getElementById('testCanvas'),
    1.10 +      context = canvas.getContext('2d');
    1.11 +
    1.12 +  // draw a path
    1.13 +  context.beginPath();
    1.14 +  context.moveTo(10, 10);
    1.15 +  context.lineTo(200, 10);
    1.16 +  context.lineTo(200, 200);
    1.17 +  context.stroke();
    1.18 +  context.closePath();
    1.19 +
    1.20 +  context.clearRect(0, 0, canvas.width, canvas.height);
    1.21 +
    1.22 +  // draw some text
    1.23 +  context.font = 'bold 40px sans-serif';
    1.24 +  context.strokeText("Hello world!", 10, 50);
    1.25 +};
    1.26 +      // --></script>
    1.27 +  </head>
    1.28 +  <body>
    1.29 +    <p>You should see only see "Hello world!" below, without any additional 
    1.30 +    line. JavaScript is required.</p>
    1.31 +
    1.32 +    <p><canvas id="testCanvas" width="400" height="300">You need Canvas 
    1.33 +    support.</canvas></p>
    1.34 +
    1.35 +  </body>
    1.36 +</html>

mercurial