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

@ -298638,6 +298638,11 @@
{} {}
] ]
], ],
"html/semantics/embedded-content/the-iframe-element/support/iframe-that-checks-contentDocument.html": [
[
{}
]
],
"html/semantics/embedded-content/the-iframe-element/support/iframe-that-opens-modals.html": [ "html/semantics/embedded-content/the-iframe-element/support/iframe-that-opens-modals.html": [
[ [
{} {}
@ -633645,7 +633650,7 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html": [ "html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html": [
"2cb85700230c038d020acd099008ef48cebf1a87", "b657f26158a9c6526e3c734afb9ce2731e1b3dd4",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/the-iframe-element/cross_origin_child.html": [ "html/semantics/embedded-content/the-iframe-element/cross_origin_child.html": [
@ -633972,6 +633977,10 @@
"18ecdcb795c33d6ab7bbb43f647947defca5634d", "18ecdcb795c33d6ab7bbb43f647947defca5634d",
"support" "support"
], ],
"html/semantics/embedded-content/the-iframe-element/support/iframe-that-checks-contentDocument.html": [
"bc35a977e8b27360f75a901d44fedf47ad496e37",
"support"
],
"html/semantics/embedded-content/the-iframe-element/support/iframe-that-opens-modals.html": [ "html/semantics/embedded-content/the-iframe-element/support/iframe-that-opens-modals.html": [
"50f56c6278a77e5ff80e5036c7d600d0b1fa4b91", "50f56c6278a77e5ff80e5036c7d600d0b1fa4b91",
"support" "support"

View file

@ -8,13 +8,20 @@
async_test(function(t) { async_test(function(t) {
var iframe = document.createElement("iframe"); var iframe = document.createElement("iframe");
document.body.appendChild(iframe); document.body.appendChild(iframe);
iframe.onload = t.step_func(function() { var checkedDuringParse = false;
assert_true(iframe.contentDocument.location.toString().includes("support/blank.htm")); iframe.onload = t.step_func_done(function() {
t.done(); 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"); 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. // The location of the contentDocument should not change until the new document has matured.
assert_equals(iframe.contentDocument.location.toString(), "about:blank"); assert_equals(iframe.contentDocument.location.toString(), "about:blank");
}, "contentDocument should only change after a load matures."); }, "contentDocument should only change after a load matures.");

View file

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