|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=339494 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 339494</title> |
|
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.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=339494">Mozilla Bug 339494</a> |
|
13 <p id="display"></p> |
|
14 <div id="content" style="display: none"> |
|
15 <div id="d"></div> |
|
16 <div id="s"></div> |
|
17 </div> |
|
18 <pre id="test"> |
|
19 <script class="testbody" type="text/javascript"> |
|
20 |
|
21 /** Test for Bug 339494 **/ |
|
22 |
|
23 var d = document.getElementById("d"); |
|
24 |
|
25 d.setAttribute("hhh", "testvalue"); |
|
26 |
|
27 document.addEventListener("DOMAttrModified", removeItAgain, false); |
|
28 d.removeAttribute("hhh"); |
|
29 document.removeEventListener("DOMAttrModified", removeItAgain, false); |
|
30 |
|
31 function removeItAgain() |
|
32 { |
|
33 ok(!d.hasAttribute("hhh"), "Value check 1", |
|
34 "There should be no value"); |
|
35 isnot(d.getAttribute("hhh"), "testvalue", "Value check 2"); |
|
36 document.removeEventListener("DOMAttrModified", removeItAgain, false); |
|
37 d.removeAttribute("hhh"); |
|
38 ok(true, "Reachability", "We shouldn't have crashed"); |
|
39 } |
|
40 |
|
41 var s = document.getElementById("s"); |
|
42 |
|
43 s.setAttribute("ggg", "testvalue"); |
|
44 |
|
45 document.addEventListener("DOMAttrModified", compareVal, false); |
|
46 s.setAttribute("ggg", "othervalue"); |
|
47 document.removeEventListener("DOMAttrModified", compareVal, false); |
|
48 |
|
49 function compareVal() |
|
50 { |
|
51 ok(s.hasAttribute("ggg"), "Value check 3", |
|
52 "There should be a value"); |
|
53 isnot(s.getAttribute("ggg"), "testvalue", "Value check 4"); |
|
54 is(s.getAttribute("ggg"), "othervalue", "Value check 5"); |
|
55 } |
|
56 |
|
57 </script> |
|
58 </pre> |
|
59 </body> |
|
60 </html> |
|
61 |