layout/style/test/test_units_angle.html

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <title>Test for serialization and equivalence of angle units</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 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a>
    10 <p id="display"></p>
    11 <div id="content" style="display: none">
    13 </div>
    14 <pre id="test">
    15 <script type="application/javascript">
    17 /** Test for serialization and equivalence of angle units **/
    19 /**
    20  * We test that for each of the following:
    21  *  + they reserialize to exactly what is given
    22  *  + if a mapping is provided, they compute to the same result as the mapping
    23  */
    24 var tests = {
    25   "45deg": "50grad",
    26   "150grad": "135deg",
    27   "1rad": null
    28 };
    30 var p = document.getElementById("display");
    32 for (var test in tests) {
    33   p.setAttribute("style", "-moz-transform: rotate(" + test + ")");
    34   is(p.style.getPropertyValue("-moz-transform"), "rotate(" + test + ")",
    35      test + " serializes to exactly itself");
    36   // We can't test any equivalence since we don't have any properties
    37   // with angle values that we compute.  (-moz-transform doesn't help.)
    38 /*
    39   var equiv = tests[test];
    40   if (equiv) {
    41     var cm1 = getComputedStyle(p, "").elevation;
    42     p.style.elevation = equiv;
    43     var cm2 = getComputedStyle(p, "").elevation;
    44     is(cm1, cm2, test + " should compute to the same as " + equiv);
    45   }
    46 */
    47 }
    49 </script>
    50 </pre>
    51 </body>
    52 </html>

mercurial