diff --git a/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/url-entry-document-timer-frame.html b/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/url-entry-document-timer-frame.html new file mode 100644 index 00000000000000..b2c050768c7828 --- /dev/null +++ b/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/url-entry-document-timer-frame.html @@ -0,0 +1,3 @@ + diff --git a/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-entry-document.window.js b/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-entry-document.window.js new file mode 100644 index 00000000000000..c3a1c3a874f357 --- /dev/null +++ b/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-entry-document.window.js @@ -0,0 +1,18 @@ +async_test(t => { + const frame = document.body.appendChild(document.createElement("iframe")); + t.add_cleanup(() => frame.remove()); + const frameURL = new URL("resources/url-entry-document-timer-frame.html", document.URL).href; + window.timerTest = t.step_func_done(() => { + assert_equals(frame.contentDocument.URL, frameURL); + assert_equals(frame.contentWindow.location.href, frameURL); + + // In this case, the entry settings object was set when this function is + // executed in the timer task through Web IDL's "invoke a callback + // function" algorithm, to be the relevant settings object of this + // function. Therefore the URL of this document would be inherited. + assert_equals(frame.contentDocument.open(), frame.contentDocument); + assert_equals(frame.contentDocument.URL, document.URL); + assert_equals(frame.contentWindow.location.href, document.URL); + }); + frame.src = frameURL; +}, "document.open() changes document's URL to the entry settings object's responsible document's (through timeouts)"); diff --git a/lint.whitelist b/lint.whitelist index c3ff66bc0cf787..c9221883c51997 100644 --- a/lint.whitelist +++ b/lint.whitelist @@ -167,6 +167,7 @@ SET TIMEOUT: html/semantics/embedded-content/the-img-element/* SET TIMEOUT: html/semantics/scripting-1/the-script-element/* SET TIMEOUT: html/webappapis/dynamic-markup-insertion/opening-the-input-stream/0* SET TIMEOUT: html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/history-frame.html +SET TIMEOUT: html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/url-entry-document-timer-frame.html SET TIMEOUT: html/webappapis/dynamic-markup-insertion/opening-the-input-stream/tasks.window.js SET TIMEOUT: html/webappapis/scripting/event-loops/* SET TIMEOUT: html/webappapis/scripting/events/event-handler-processing-algorithm-error/*