Home | History | Annotate | Download | only in HTMLFormElement
      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <script src="../../js/resources/js-test-pre.js"></script>
      5 </head>
      6 <body>
      7 <div id="test">
      8     <div id="console"></div>
      9 </body>
     10 <script>
     11 window.jsTestIsAsync = true;
     12 
     13 var select, doc1, doc2, str;
     14 
     15 window.onload = function()
     16 {
     17     select = document.createElement("select");
     18     var option = select.appendChild(document.createElement("option"));
     19     option.id = "option";
     20 
     21     doc1 = document.implementation.createHTMLDocument();
     22     doc2 = document.implementation.createHTMLDocument();
     23 
     24     doc1.body.appendChild(select);
     25     select.options.namedItem("option");
     26 
     27     select.removeChild(option);
     28     option = null;
     29 
     30     gc();
     31     setTimeout(step2, 100);
     32 }
     33 
     34 function step2()
     35 {
     36     doc1.body.removeChild(select);
     37     doc2.body.appendChild(select);
     38     shouldBe("typeof select.options.namedItem('option')", "'undefined'");
     39     finishJSTest();
     40 }
     41 
     42 window.successfullyParsed = true;
     43 </script>
     44 <script src="../../js/resources/js-test-post.js"></script>
     45 </html>
     46