diff options
author | Moonchild <moonchild@palemoon.org> | 2019-12-28 10:14:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-28 10:14:29 +0000 |
commit | 357405f6356e28e5fa94cecc078b65c20433d236 (patch) | |
tree | 9716965ca2d9d03446fc9290d37e5ef42f80558e /parser/htmlparser | |
parent | f60bbaf9e49733e61aaec675276fcd898ef6bc73 (diff) | |
parent | 8b88623463bf30ae7e5fcc64ef7d8d5fb62354c9 (diff) | |
download | UXP-357405f6356e28e5fa94cecc078b65c20433d236.tar UXP-357405f6356e28e5fa94cecc078b65c20433d236.tar.gz UXP-357405f6356e28e5fa94cecc078b65c20433d236.tar.lz UXP-357405f6356e28e5fa94cecc078b65c20433d236.tar.xz UXP-357405f6356e28e5fa94cecc078b65c20433d236.zip |
Merge pull request #1335 from MoonchildProductions/document_open
Align document.open() with the overhauled specification
Diffstat (limited to 'parser/htmlparser')
-rw-r--r-- | parser/htmlparser/tests/mochitest/test_bug715739.html | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/parser/htmlparser/tests/mochitest/test_bug715739.html b/parser/htmlparser/tests/mochitest/test_bug715739.html index 597160a19..e59fdf332 100644 --- a/parser/htmlparser/tests/mochitest/test_bug715739.html +++ b/parser/htmlparser/tests/mochitest/test_bug715739.html @@ -33,24 +33,30 @@ function textChildren(node) { return s; } +var f, d; + function tick() { runNumber++; - var f = document.getElementsByTagName("iframe")[0]; - var d = f.contentDocument; + f = document.getElementsByTagName("iframe")[0]; + d = f.contentDocument; if (runNumber == 1) { - d.open(); - f.addEventListener("load", tick); - d.write("X"); - d.write("\u003cscript>document.write('Y');\u003c/script>"); - d.write("Z"); - d.close(); + frames[1].setTimeout(` + var d = parent.d; + var f = parent.f; + d.open(); + f.addEventListener("load", parent.tick); + d.write("X"); + d.write("\u003cscript>document.write('Y');\u003c/script>"); + d.write("Z"); + d.close(); + `); return; } if (runNumber == 2) { var text = textChildren(d.body); - is(text, "XYZ", "Wrong text before reload."); + is(text, "ABC", "Wrong text before reload."); f.contentWindow.location.reload(); return; } @@ -63,10 +69,20 @@ function tick() { } } +// We want to trigger a document.open/write with a different window as the +// entry global. Let's give that window a blob URL so we don't have to set up +// extra helper files. +var blob = new Blob(["ABC"], { type: "text/html" }); +var blobURL = URL.createObjectURL(blob); + </script> </pre> <div id="content" style="display: none"> <iframe></iframe> + <iframe></iframe> </div> +<script> + document.querySelectorAll("iframe")[1].src = blobURL; +</script> </body> </html> |