|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> |
|
4 <!-- |
|
5 https://bugzilla.mozilla.org/show_bug.cgi?id=339494 |
|
6 --> |
|
7 <window title="Mozilla Bug 339494" |
|
8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
|
9 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
10 |
|
11 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
12 |
|
13 <body xmlns="http://www.w3.org/1999/xhtml"> |
|
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339494">Mozilla Bug 339494</a> |
|
15 <p id="display"></p> |
|
16 <div id="content" style="display: none"> |
|
17 <xul:hbox id="d"/> |
|
18 <xul:hbox id="s"/> |
|
19 </div> |
|
20 <pre id="test"> |
|
21 </pre> |
|
22 </body> |
|
23 |
|
24 <script class="testbody" type="application/javascript"> |
|
25 |
|
26 /** Test for Bug 339494 **/ |
|
27 |
|
28 var d = document.getElementById("d"); |
|
29 |
|
30 d.setAttribute("hhh", "testvalue"); |
|
31 |
|
32 document.addEventListener("DOMAttrModified", removeItAgain, false); |
|
33 d.removeAttribute("hhh"); |
|
34 document.removeEventListener("DOMAttrModified", removeItAgain, false); |
|
35 |
|
36 function removeItAgain() |
|
37 { |
|
38 ok(!d.hasAttribute("hhh"), "Value check 1", |
|
39 "There should be no value"); |
|
40 isnot(d.getAttribute("hhh"), "testvalue", "Value check 2"); |
|
41 document.removeEventListener("DOMAttrModified", removeItAgain, false); |
|
42 d.removeAttribute("hhh"); |
|
43 ok(true, "Reachability", "We shouldn't have crashed"); |
|
44 } |
|
45 |
|
46 var s = document.getElementById("s"); |
|
47 |
|
48 s.setAttribute("ggg", "testvalue"); |
|
49 |
|
50 document.addEventListener("DOMAttrModified", compareVal, false); |
|
51 s.setAttribute("ggg", "othervalue"); |
|
52 document.removeEventListener("DOMAttrModified", compareVal, false); |
|
53 |
|
54 function compareVal() |
|
55 { |
|
56 ok(s.hasAttribute("ggg"), "Value check 3", |
|
57 "There should be a value"); |
|
58 isnot(s.getAttribute("ggg"), "testvalue", "Value check 4"); |
|
59 is(s.getAttribute("ggg"), "othervalue", "Value check 5"); |
|
60 } |
|
61 |
|
62 </script> |
|
63 |
|
64 </window> |