b=450088 backing out (new reftest failed)
[wine-gecko.git] / testing / mochitest / tests / test_bug338541.xhtml
blobfb61249dc7fc9ad87db27d2a27d415d2a705998f
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <!--
3 https://bugzilla.mozilla.org/show_bug.cgi?id=338541
4 -->
5 <head>
6 <title>Test for Bug 338541</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=338541">Mozilla Bug 338541</a>
13 <p id="display"></p>
14 <pre id="test">
15 <script class="testbody" type="text/javascript">
17 /** Test for Bug 338541 **/
18 function getName(aNode, f)
20 return (aNode ? aNode.nodeName : "(null)");
23 function walkDOM()
25 var walker = document.createTreeWalker($('content'), Components.interfaces.nsIDOMNodeFilter.SHOW_ELEMENT, null, true);
26 var output = "";
27 while (walker.nextNode())
29 output += getName(walker.currentNode) + "\n";
31 output += "Final currentNode: " + getName(walker.currentNode);
32 is(output, "foo\nbar\nhtml:b\nqux\nbaz\nFinal currentNode: baz","treewalker returns correct nodeName");
33 SimpleTest.finish();
36 SimpleTest.waitForExplicitFinish();
37 addLoadEvent(walkDOM, ok);
39 </script>
40 </pre>
41 <div id="content" style="display: none">
42 <foo xmlns="http://example.com">
43 <bar><html:b xmlns:html="http://www.w3.org/1999/xhtml"><qux/></html:b>
44 <baz/>
45 </bar>
46 </foo>
47 </div>
48 </body>
49 </html>