layout/reftests/canvas/text-emoji.html

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

Correct small whitespace inconsistency, lost while renaming variables.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4 <title>Test for Unicode emoji in canvas</title>
     5 <script type="text/javascript">
     6 function test(canvasID) {
     7   var canvas = document.getElementById(canvasID);
     8   var ctx = canvas.getContext('2d');
     9   var str = 'Hello \uD83D\uDE0E'; // U+1F60E
    10   ctx.font = '2em sans-serif';
    11   ctx.fillStyle = 'black';
    12   ctx.textAlign = 'left';
    13   ctx.textBaseline = 'top';
    14   ctx.fillText(str, 10, 10);
    15 };
    16 </script>
    17 </head>
    18 <body>
    20 <div lang="en" style="margin:20px; height:100px;">
    21 <canvas id="c1" width="400" height="50"></canvas>
    22 <script type="text/javascript">
    23   test("c1");
    24 </script>
    25 </div>
    27 </body>
    28 </html>

mercurial