b=450088 backing out (new reftest failed)
[wine-gecko.git] / testing / mochitest / tests / test_bug362391.xhtml
blob99948d8ab025dbd77a7a0ac4f960ae88d4c8be57
1 <?xml version="1.0"?>
2 <html xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:foobar="http://www.foobar.com">
4 <!--
5 https://bugzilla.mozilla.org/show_bug.cgi?id=362391
6 -->
7 <head>
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" />
16 </head>
17 <body>
18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=362391">Mozilla Bug 362391</a>
19 <p id="display"></p>
20 <div id="content" style="display: none">
22 </div>
23 <div id="test1"/>
24 <div id="test2"/>
25 <div id="test3" attr="null"/>
26 <div id="test4" foobar:attr="http://www.foobar.com"/>
27 <pre id="test">
28 <script class="testbody" type="text/javascript">
30 /** Test for Bug 362391 **/
32 var currentTest = 0;
33 var expected = "";
34 function listener(evt) {
35 var r = document.getElementById("result");
36 ++currentTest;
37 ok(((evt.relatedNode.namespaceURI + "") == expected),
38 evt.relatedNode.namespaceURI + " == "+ expected);
41 document.addEventListener("DOMAttrModified", listener, true);
43 function test() {
44 expected = "null";
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");
56 expected = "null";
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");
64 expected = "null";
65 document.getElementById("test4")
66 .removeAttribute("attr");
69 test();
70 </script>
71 </pre>
73 </body>
74 </html>