1 <html xmlns=
"http://www.w3.org/1999/xhtml">
3 https://bugzilla.mozilla.org/show_bug.cgi?id=629200
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" />
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=629200">Mozilla Bug
629200</a>
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>
20 <script class=
"testbody" type=
"text/javascript">
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
41 var eventChecker = new MutationEventChecker;
42 eventChecker.watchAttr(text,
"rotate");
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();
68 window.addEventListener(
"load",
69 () =
> SpecialPowers.pushPrefEnv({
"set": [[
"dom.mutation_events.enabled", true]]}, run_tests));