From 3315d94057467a650e938756b924d57b5d8c3bb9 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Wed, 6 Feb 2019 16:34:38 -0500 Subject: [PATCH] Verify that contentDocument is updated during nested browsing context document parsing. --- tests/wpt/metadata/MANIFEST.json | 11 ++++++++++- ..._document_changes_only_after_load_matures.html | 15 +++++++++++---- .../iframe-that-checks-contentDocument.html | 3 +++ 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/support/iframe-that-checks-contentDocument.html diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 1a16a86c8eb..2527d98c5a2 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -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": [ [ {} @@ -633645,7 +633650,7 @@ "testharness" ], "html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html": [ - "2cb85700230c038d020acd099008ef48cebf1a87", + "b657f26158a9c6526e3c734afb9ce2731e1b3dd4", "testharness" ], "html/semantics/embedded-content/the-iframe-element/cross_origin_child.html": [ @@ -633972,6 +633977,10 @@ "18ecdcb795c33d6ab7bbb43f647947defca5634d", "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": [ "50f56c6278a77e5ff80e5036c7d600d0b1fa4b91", "support" diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html index 2cb85700230..b657f26158a 100644 --- a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html @@ -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."); diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/support/iframe-that-checks-contentDocument.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/support/iframe-that-checks-contentDocument.html new file mode 100644 index 00000000000..bc35a977e8b --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/support/iframe-that-checks-contentDocument.html @@ -0,0 +1,3 @@ +