b=450088 backing out (new reftest failed)
[wine-gecko.git] / testing / mochitest / tests / test_bug339494.xhtml
blob92894e607f8e0a1bb139567cf1c764a20dbcee8f
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <!--
3 https://bugzilla.mozilla.org/show_bug.cgi?id=339494
4 -->
5 <head>
6 <title>Test for Bug 339494</title>
7 <script type="text/javascript" src="/MochiKit/packed.js"></script>
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" />
16 <div id="s" />
17 </div>
18 <pre id="test">
19 <script class="testbody" type="text/javascript">
21 /** Test for Bug 339494 **/
23 var d = document.getElementById("d");
25 d.setAttribute("hhh", "testvalue");
27 document.addEventListener("DOMAttrModified", removeItAgain, false);
28 d.removeAttribute("hhh");
29 document.removeEventListener("DOMAttrModified", removeItAgain, false);
31 function removeItAgain()
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");
41 var s = document.getElementById("s");
43 s.setAttribute("ggg", "testvalue");
45 document.addEventListener("DOMAttrModified", compareVal, false);
46 s.setAttribute("ggg", "othervalue");
47 document.removeEventListener("DOMAttrModified", compareVal, false);
49 function compareVal()
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");
57 </script>
58 </pre>
59 </body>
60 </html>