b=450088 backing out (new reftest failed)
[wine-gecko.git] / testing / mochitest / tests / test_bug339494.html
blob5a65c21fa330f1662f5b05b9a84f04ff8c029bba
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="/MochiKit/MochiKit.js"></script>
9 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339494">Mozilla Bug 339494</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
16 <div id="d"></div>
17 <div id="s"></div>
18 </div>
19 <pre id="test">
20 <script class="testbody" type="text/javascript">
22 /** Test for Bug 339494 **/
24 var d = document.getElementById("d");
26 d.setAttribute("hhh", "testvalue");
28 document.addEventListener("DOMAttrModified", removeItAgain, false);
29 d.removeAttribute("hhh");
30 document.removeEventListener("DOMAttrModified", removeItAgain, false);
32 function removeItAgain()
34 ok(!d.hasAttribute("hhh"), "Value check 1",
35 "There should be no value");
36 isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
37 document.removeEventListener("DOMAttrModified", removeItAgain, false);
38 d.removeAttribute("hhh");
39 ok(true, "Reachability", "We shouldn't have crashed");
42 var s = document.getElementById("s");
44 s.setAttribute("ggg", "testvalue");
46 document.addEventListener("DOMAttrModified", compareVal, false);
47 s.setAttribute("ggg", "othervalue");
48 document.removeEventListener("DOMAttrModified", compareVal, false);
50 function compareVal()
52 ok(s.hasAttribute("ggg"), "Value check 3",
53 "There should be a value");
54 isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
55 is(s.getAttribute("ggg"), "othervalue", "Value check 5");
58 </script>
59 </pre>
60 </body>
61 </html>