Verify that contentDocument is updated during nested browsing context document parsing.

This commit is contained in:
Josh Matthews 2019-02-06 16:34:38 -05:00
parent a34c8f952e
commit 3315d94057
3 changed files with 24 additions and 5 deletions

View file

@ -8,13 +8,20 @@
async_test(function(t) {
var iframe = document.createElement("iframe");
document.body.appendChild(iframe);
iframe.onload = t.step_func(function() {
assert_true(iframe.contentDocument.location.toString().includes("support/blank.htm"));
t.done();
var checkedDuringParse = false;
iframe.onload = t.step_func_done(function() {
testContentDocument();
assert_true(checkedDuringParse);
});
let url = "support/iframe-that-checks-contentDocument.html";
window.testContentDocument = t.step_func(function() {
assert_true(iframe.contentDocument.location.toString().includes(url));
checkedDuringParse = true;
});
assert_equals(iframe.contentDocument.location.toString(), "about:blank");
iframe.src = "support/blank.htm?pipe=trickle(d2)";
iframe.src = url + "?pipe=trickle(d2)";
// The location of the contentDocument should not change until the new document has matured.
assert_equals(iframe.contentDocument.location.toString(), "about:blank");
}, "contentDocument should only change after a load matures.");

View file

@ -0,0 +1,3 @@
<script>
parent.testContentDocument();
</script>