summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_02.html
blob: d82dafe3ceccfe1dfe2f1c42bc6dd86bdd6bff6d (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>moving modified IFRAME in document (original page about:blank, document.write modification)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
<iframe src="about:blank"></iframe>
<div id="target"></div>
<script>
setup({ single_test: true });
onload = function() {
  var ifr = document.getElementsByTagName('iframe')[0];
  ifr.contentDocument.open();
  ifr.contentDocument.write('Modified document');
  ifr.contentDocument.close();
  setTimeout(function() {
    ifr.onload = function() {
        assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
        done();
    };
    document.getElementById('target').appendChild(ifr);
  }, 100);
}
</script>