Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_01.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>moving modified IFRAME in document (original page about:blank, DOM modification)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe src="about:blank"></iframe>
<div id="target"></div>
<script>
setup({ single_test: true });
onload = function() {
var ifr = document.getElementsByTagName('iframe')[0];
ifr.contentDocument.body.appendChild(ifr.contentDocument.createElement('p')).textContent = 'Modified document';
setTimeout(function() {
ifr.onload = function() {
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
done();
};
document.getElementById('target').appendChild(ifr);
}, 100);
}
</script>