content/canvas/test/test_mozDashOffset.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 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <title>Test for mozDashOffset</title>
     5   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     6   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     7 </head>
     8 <body>
     9 <p id="display">
    10 <canvas id="c" width="100" height="100"><p class="fallback">FAIL (fallback content)</p></canvas>
    11 </p>
    12 <div id="content" style="display: none">
    13 </div>
    14 <pre id="test">
    15 <script>
    16 try {
    17   var canvas = document.getElementById('c');
    18   var ctx = canvas.getContext('2d');
    20   ctx.mozDash = [1, 1];
    22   ctx.mozDashOffset = 1;
    23   ctx.mozDashOffset = Infinity;
    24   ok(ctx.mozDashOffset === 1, "ctx.mozDashOffset === 1");
    26   ctx.mozDashOffset = 1;
    27   ctx.mozDashOffset = -Infinity;
    28   ok(ctx.mozDashOffset === 1, "ctx.mozDashOffset === 1");
    30   ctx.mozDashOffset = 1;
    31   ctx.mozDashOffset = NaN;
    32   ok(ctx.mozDashOffset === 1, "ctx.mozDashOffset === 1");
    33 } catch(e) {
    34   ok(false, "unexpected exception thrown in: test_mozDashOffset.html");
    35 }
    36 </script>
    37 </pre>
    38 </body>
    39 </html>

mercurial