2 <html xmlns=
"http://www.w3.org/1999/xhtml"
3 xmlns:
foobar=
"http://www.foobar.com">
5 https://bugzilla.mozilla.org/show_bug.cgi?id=362391
8 <title>Test for Bug
362391</title>
9 <!-- XHTML needs explicit script elements -->
10 <script type=
"text/javascript" src=
"../MochiKit/Base.js"></script>
11 <script type=
"text/javascript" src=
"../MochiKit/Iter.js"></script>
12 <script type=
"text/javascript" src=
"../MochiKit/DOM.js"></script>
13 <script type=
"text/javascript" src=
"../MochiKit/Style.js"></script>
14 <script type=
"text/javascript" src=
"SimpleTest/SimpleTest.js"></script>
15 <link rel=
"stylesheet" type=
"text/css" href=
"SimpleTest/test.css" />
18 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=362391">Mozilla Bug
362391</a>
20 <div id=
"content" style=
"display: none">
25 <div id=
"test3" attr=
"null"/>
26 <div id=
"test4" foobar:
attr=
"http://www.foobar.com"/>
28 <script class=
"testbody" type=
"text/javascript">
30 /** Test for Bug
362391 **/
34 function listener(evt) {
35 var r = document.getElementById(
"result");
37 ok(((evt.relatedNode.namespaceURI +
"") == expected),
38 evt.relatedNode.namespaceURI +
" == "+ expected);
41 document.addEventListener(
"DOMAttrModified", listener, true);
45 document.getElementById(
"test1")
46 .setAttribute(
"attr",
"null");
48 expected =
"http://www.foobar.com";
49 document.getElementById(
"test2")
50 .setAttributeNS(
"http://www.foobar.com",
"attr",
"http://www.foobar.com");
52 expected =
"http://www.foobar.com";
53 document.getElementById(
"test3")
54 .setAttributeNS(
"http://www.foobar.com",
"attr",
"http://www.foobar.com");
57 document.getElementById(
"test4")
58 .setAttribute(
"attr",
"null");
60 expected =
"http://www.foobar.com";
61 document.getElementById(
"test3")
62 .removeAttributeNS(
"http://www.foobar.com",
"attr");
65 document.getElementById(
"test4")
66 .removeAttribute(
"attr");