1 <html> 2 <head> 3 <script> 4 if (window.layoutTestController) 5 layoutTestController.dumpAsText(); 6 7 function onLoad() 8 { 9 var theDiv = document.getElementById("theDiv"); 10 var theAttrs = theDiv.attributes; 11 12 var nameAttr = theAttrs.getNamedItem("name"); 13 var nameAttrChildNodes = nameAttr.childNodes; 14 var textNode = document.createTextNode("terday"); 15 var unused = nameAttrChildNodes.length; 16 nameAttr.appendChild(textNode); 17 18 var name2Attr = theAttrs.getNamedItem("name2"); 19 var name2AttrChildNodes = name2Attr.childNodes; 20 var textNode2 = document.createTextNode("terday"); 21 name2Attr.appendChild(textNode2); 22 23 if (nameAttrChildNodes.length != name2AttrChildNodes.length) 24 document.getElementById("result").innerHTML = "Failed: nameAttrChildNodes.length=" + nameAttrChildNodes.length + ", name2AttrChildNodes.length=" + name2AttrChildNodes.length; 25 else 26 document.getElementById("result").innerHTML = "Passed!!"; 27 28 document.body.removeChild(document.getElementById("theDiv")); 29 } 30 </script> 31 </head> 32 <body onload="onLoad();"> 33 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=19759">bug 19759</a>: 34 ChildNodeList for an attribute node is not properly invalidated after appending a child.</p> 35 <div id="theDiv" name="Yes" name2="Yes">Hello</div> 36 <div id="result">Testing...</div> 37 </body> 38 </html> 39