2 <?xml-stylesheet href=
"chrome://global/skin" type=
"text/css"?>
3 <?xml-stylesheet href=
"/tests/SimpleTest/test.css" type=
"text/css"?>
5 https://bugzilla.mozilla.org/show_bug.cgi?id=339494
7 <window title=
"Mozilla Bug 339494"
8 xmlns:
html=
"http://www.w3.org/1999/xhtml"
9 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
10 xmlns:
xul=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
12 <title>Test for Bug
339494</title>
13 <script type=
"application/javascript" src=
"/MochiKit/packed.js"></script>
14 <script type=
"application/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
16 <body xmlns=
"http://www.w3.org/1999/xhtml">
17 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=339494">Mozilla Bug
339494</a>
19 <div id=
"content" style=
"display: none">
27 <script class=
"testbody" type=
"application/javascript">
29 /** Test for Bug
339494 **/
31 var d = document.getElementById(
"d");
33 d.setAttribute(
"hhh",
"testvalue");
35 document.addEventListener(
"DOMAttrModified", removeItAgain, false);
36 d.removeAttribute(
"hhh");
37 document.removeEventListener(
"DOMAttrModified", removeItAgain, false);
39 function removeItAgain()
41 ok(!d.hasAttribute(
"hhh"),
"Value check 1",
42 "There should be no value");
43 isnot(d.getAttribute(
"hhh"),
"testvalue",
"Value check 2");
44 document.removeEventListener(
"DOMAttrModified", removeItAgain, false);
45 d.removeAttribute(
"hhh");
46 ok(true,
"Reachability",
"We shouldn't have crashed");
49 var s = document.getElementById(
"s");
51 s.setAttribute(
"ggg",
"testvalue");
53 document.addEventListener(
"DOMAttrModified", compareVal, false);
54 s.setAttribute(
"ggg",
"othervalue");
55 document.removeEventListener(
"DOMAttrModified", compareVal, false);
59 ok(s.hasAttribute(
"ggg"),
"Value check 3",
60 "There should be a value");
61 isnot(s.getAttribute(
"ggg"),
"testvalue",
"Value check 4");
62 is(s.getAttribute(
"ggg"),
"othervalue",
"Value check 5");