script_013.html (900B)
1 <!doctype html> 2 <title>document.write</title> 3 <script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script> 4 <script> 5 var t = async_test(); 6 t.step(function() { 7 var s = "<script src='013.js'><" + "/script></svg>]]><path></svg>"; 8 for (var i=0; i<s.length; i++) { 9 document.write(s[i]); 10 } 11 }); 12 </script><script> 13 t.step(function() { 14 assert_equals(document.body.childNodes[0].nodeType, document.ELEMENT_NODE); 15 assert_equals(document.body.childNodes[0].localName, "svg"); 16 assert_equals(document.body.childNodes[0].childNodes[0].nodeType, document.TEXT_NODE); 17 assert_equals(document.body.childNodes[0].childNodes[0].data, "</svg>"); 18 assert_equals(document.body.childNodes[0].childNodes[1].nodeType, document.ELEMENT_NODE); 19 assert_equals(document.body.childNodes[0].childNodes[1].localName, "path"); 20 } 21 ); 22 t.done(); 23 </script> 24 <div id="log"></div>