4 https://bugzilla.mozilla.org/show_bug.cgi?id=339494
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" />
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=339494">Mozilla Bug
339494</a>
15 <div id=
"content" style=
"display: none">
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);
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");