4 Test adapted from http://mxr.mozilla.org/mozilla-central/source/content/base/test/test_bug590771.html
6 https://bugzilla.mozilla.org/show_bug.cgi?id=590771
9 <title>Test for Bug 590771</title>
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=590771">Mozilla Bug 590771</a>
15 <script type="application/javascript">
17 if (window.testRunner)
18 testRunner.dumpAsText();
20 /** Test for Bug 590771 **/
24 var attr = document.createAttribute("foo");
26 var ni = document.createNodeIterator(attr, -1, null, false);
29 console.log("test1: iterator should be on the first child attribute: " + (ni.referenceNode === attr.firstChild));
31 attr.removeChild(attr.firstChild);
32 console.log("test1: iterator should be on the attribute now: " + (ni.referenceNode === attr));
37 var attr = document.createAttribute("foo");
39 var ni = document.createNodeIterator(attr, -1, null, false);
42 console.log("test2: iterator should be on the first child attribute: " + (ni.referenceNode === attr.firstChild));
45 console.log("test2: iterator should be on the attribute now: " + (ni.referenceNode === attr));
50 var attr = document.createAttribute("foo");
52 var node = document.createElement("div");
53 node.setAttributeNode(attr);
54 var ni = document.createNodeIterator(attr, -1, null, false);
57 console.log("test3: iterator should be on the first child attribute: " + (ni.referenceNode === attr.firstChild));
59 node.setAttribute("foo", "");
60 console.log("test3: iterator should be on the attribute now: " + (ni.referenceNode === attr));