diff options
Diffstat (limited to 'testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/document-write/iframe_003.html')
-rw-r--r-- | testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/document-write/iframe_003.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/document-write/iframe_003.html b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/document-write/iframe_003.html new file mode 100644 index 0000000000..9865874da4 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/document-write/iframe_003.html @@ -0,0 +1,23 @@ +<!doctype html> +<title>document.write script into iframe</title> +<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script> +<iframe id="test"></iframe> +<script> +test( +function() { + var iframe = document.getElementById("test"); + var s = "<script>document.write(\"<i id='a'>Filler Text</i>\")</script" + "><b id=b>Filler Text</b>" + for (var i=0; i<s.length; i++) { + iframe.contentDocument.write(s[i]); + } + iframe.contentDocument.close(); + //Note: <script> ends up in <head> + assert_equals(iframe.contentDocument.body.childNodes[0].textContent, "Filler Text"); + assert_equals(iframe.contentDocument.body.childNodes[0].localName, "i"); + assert_equals(iframe.contentDocument.body.childNodes[0].getAttribute('id'), "a"); + assert_equals(iframe.contentDocument.body.childNodes[1].textContent, "Filler Text"); + assert_equals(iframe.contentDocument.body.childNodes[1].localName, "b"); + assert_equals(iframe.contentDocument.body.childNodes[1].getAttribute('id'), "b"); +}); +</script> +<div id="log"></div>
\ No newline at end of file |