Bug 1943761 - Add class alignment to the mozsearch analysis file. r=asuth
[gecko.git] / dom / svg / test / test_SVGNumberList.xhtml
blob2b622c6d47e1d190f6d0be37221deb6c03be1932
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <!--
3 https://bugzilla.mozilla.org/show_bug.cgi?id=629200
4 -->
5 <head>
6 <title>Tests specific to SVGNumberList</title>
7 <script src="/tests/SimpleTest/SimpleTest.js"></script>
8 <script type="text/javascript" src="MutationEventChecker.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
10 </head>
11 <body>
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=629200">Mozilla Bug 629200</a>
13 <p id="display"></p>
14 <div id="content" style="display:none;">
15 <svg id="svg" xmlns="http://www.w3.org/2000/svg" width="100" height="100">
16 <text id="text" rotate="10 20 30">abc</text>
17 </svg>
18 </div>
19 <pre id="test">
20 <script class="testbody" type="text/javascript">
21 <![CDATA[
23 SimpleTest.waitForExplicitFinish();
26 This file runs a series of SVGNumberList specific tests. Generic SVGXxxList
27 tests can be found in test_SVGxxxList.xhtml. Anything that can be generalized
28 to other list types belongs there.
31 function run_tests() {
32 document.getElementById("svg").pauseAnimations();
34 var text = document.getElementById("text");
35 var numbers = text.rotate.baseVal;
37 is(numbers.numberOfItems, 3, "Checking numberOfItems");
39 // Test mutation events
40 // --- Initialization
41 var eventChecker = new MutationEventChecker;
42 eventChecker.watchAttr(text, "rotate");
43 // -- Actual changes
44 eventChecker.expect("modify modify");
45 numbers[0].value = 15;
46 text.setAttribute("rotate", "17 20 30");
47 // -- Redundant changes
48 eventChecker.expect("");
49 numbers[0].value = 17;
50 numbers[1].value = 20;
51 text.setAttribute("rotate", "17 20 30");
52 // -- Invalid attribute
53 eventChecker.expect("modify");
54 text.setAttribute("rotate", ",20");
55 is(numbers.numberOfItems, 0, "Checking that parsing stops at invalid token");
56 // -- Attribute removal
57 eventChecker.expect("remove");
58 text.removeAttribute("rotate");
59 // -- Non-existent attribute removal
60 eventChecker.expect("");
61 text.removeAttribute("rotate");
62 text.removeAttributeNS(null, "rotate");
63 eventChecker.finish();
65 SimpleTest.finish();
68 window.addEventListener("load",
69 () => SpecialPowers.pushPrefEnv({"set": [["dom.mutation_events.enabled", true]]}, run_tests));
71 ]]>
72 </script>
73 </pre>
74 </body>
75 </html>