<html>
<body>
  <span>fix for <a href="http://bugs.webkit.org/show_bug.cgi?id=15274">bug 15274</a></span><br>
  <div name="my_a">div 1</div>
  <div name="my_a">div 2</div>
  <p></p>
  <p></p>
  <script>
    if (window.testRunner)
      testRunner.dumpAsText();
    try {
      var divs = document.getElementsByName("my_a");
      divs[0].parentNode.removeChild(divs[0]);
      document.write("Should be 1: " + divs.length + "<br>");
      divs[0].parentNode.removeChild(divs[0]);
      document.write("Should be 0: " + divs.length + "<br>");
      
      var divs = document.getElementsByTagName("p");
      divs[0].parentNode.removeChild(divs[0]);
      document.write("Should be 1: " + divs.length + "<br>");
      divs[0].parentNode.removeChild(divs[0]);
      document.write("Should be 0: " + divs.length + "<br>");
    } catch(ex) {
      document.write(ex + "<br>FAILED");
    }
  </script>
</body>
</html>
