1 <html xmlns=
"http://www.w3.org/1999/xhtml">
3 https://bugzilla.mozilla.org/show_bug.cgi?id=338541
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" />
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=338541">Mozilla Bug
338541</a>
15 <script class=
"testbody" type=
"text/javascript">
17 /** Test for Bug
338541 **/
18 function getName(aNode, f)
20 return (aNode ? aNode.nodeName :
"(null)");
25 var walker = document.createTreeWalker($('content'), Components.interfaces.nsIDOMNodeFilter.SHOW_ELEMENT, null, true);
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");
36 SimpleTest.waitForExplicitFinish();
37 addLoadEvent(walkDOM, ok);
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>