layout/reftests/canvas/text-measure.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <html>
     2 <script>
     3 function load() {
     4     var ctx = document.getElementById("canvas").getContext("2d");
     6     ctx.font = "bold 12px sans-serif";
     7     ctx.scale(4, 4);
     8     var str = "HeHeHeHe";
     9     var x = 0;
    10     for (var i = 0; i < str.length; ++i) {
    11         ctx.fillText(str[i], x, 15);
    12         x += ctx.measureText(str[i]).width;
    13     }
    14 }
    15 </script>
    16 <body onload="load();">
    17 <canvas id="canvas" width="400" height="200"></canvas>
    18 </body>
    19 </html>

mercurial