iframe_010.html (820B)
1 <!doctype html> 2 <title>document.write plaintext</title> 3 <script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script> 4 <iframe id="test"></iframe> 5 <script> 6 var t = async_test(); 7 var iframe = document.getElementById("test"); 8 9 function check_dom() { 10 assert_equals(iframe.contentDocument.body.childNodes[0].localName, "plaintext") 11 assert_equals(iframe.contentDocument.body.childNodes[0].textContent, "Filler ") 12 assert_equals(iframe.contentDocument.body.childNodes[1].localName, "table") 13 } 14 15 t.step(function() { 16 var s = "<script>document.write('<table><plaintext>Filler '); document.close(); top.t.step(function() {top.check_dom()})</script" + ">"; 17 for (var i=0; i<s.length; i++) { 18 iframe.contentDocument.write(s[i]); 19 } 20 t.done(); 21 }); 22 </script> 23 <div id="log"></div>