Bug 1874684 - Part 37: Fix unified compilation. r=allstarschh
[gecko.git] / layout / style / test / test_units_angle.html
bloba4432b7650e3044c4bafeecc80fa26643866fa59
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test for serialization and equivalence of angle units</title>
5 <script 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
24 var tests = {
25 "45deg": "50grad",
26 "150grad": "135deg",
27 "1rad": null
30 var p = document.getElementById("display");
32 for (var test in tests) {
33 p.setAttribute("style", "transform: rotate(" + test + ")");
34 is(p.style.getPropertyValue("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. (transform doesn't help.)
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);
49 </script>
50 </pre>
51 </body>
52 </html>