| OLD | NEW |
| 1 <script> | 1 <script> |
| 2 function go() { | 2 function go() { |
| 3 document.open(); | 3 document.open(); |
| 4 var a = document.createElement("a"); | 4 var a = document.createElement("a"); |
| 5 document.appendChild(a); | 5 document.appendChild(a); |
| 6 document.write("<b id='b'></b>"); | 6 document.write("<b id='b'></b>"); |
| 7 var b = document.getElementById('b'); | 7 var b = document.getElementById('b'); |
| 8 | 8 |
| 9 // Ideally we would use the dump-as-markup test framework for this test, but | 9 // Ideally we would use the dump-as-markup test framework for this test, but |
| 10 // the contortions we go through here are too tricky for dump-as-markup. | 10 // the contortions we go through here are too tricky for dump-as-markup. |
| 11 | 11 // TODO(esprehn): Is this really true? |
| 12 var firstChildHTML = document.firstChild.outerHTML; | 12 alert("document.documentElement.outerHTML: " + document.documentElement.outerH
TML + "\n" + |
| 13 var secondChildHTML = document.firstChild.nextSibling.outerHTML; | 13 "document.childNodes.length: " + document.childNodes.length + "\n" + |
| 14 | 14 "b element: " + b + "\n"); |
| 15 alert("document.firstChild.outerHTML: " + firstChildHTML + "\n" + | |
| 16 "document.firstChild.nextSibling.outerHTML: " + secondChildHTML); | |
| 17 } | 15 } |
| 18 | 16 |
| 19 window.addEventListener("load", go, false); | 17 window.addEventListener("load", go, false); |
| 20 | 18 |
| 21 if (window.testRunner) | 19 if (window.testRunner) |
| 22 testRunner.dumpAsText(); | 20 testRunner.dumpAsText(); |
| 23 </script> | 21 </script> |
| 24 This test covers some tricky ground where we call appendChild between | 22 This test covers some tricky ground where we call appendChild between |
| 25 document.open an document.write. This sequence of calls results in an unusual | 23 document.open an document.write. This sequence of calls results in an unusual |
| 26 situation where the parser is in the Initial state but the document is not | 24 situation where the parser is in the Initial state but the document is not |
| 27 empty. | 25 empty. |
| OLD | NEW |