summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_010.html
blob: 8dc21a013a546ac4fd8aa6e3eed710a9a9773117 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!doctype html>
<title>document.write plaintext</title>
<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
<iframe id="test"></iframe>
<script>
var t = async_test();
var iframe = document.getElementById("test");

function check_dom() {
  assert_equals(iframe.contentDocument.body.childNodes[0].localName, "plaintext")
  assert_equals(iframe.contentDocument.body.childNodes[0].textContent, "Filler ")
  assert_equals(iframe.contentDocument.body.childNodes[1].localName, "table")
}

t.step(function() {
  var s = "<script>document.write('<table><plaintext>Filler '); document.close(); top.t.step(function() {top.check_dom()})</script" + ">";
  for (var i=0; i<s.length; i++) {
    iframe.contentDocument.write(s[i]);
  }
  t.done();
});
</script>
<div id="log"></div>