summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/links/following-hyperlinks/active-document.window.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/links/following-hyperlinks/active-document.window.js')
-rw-r--r--testing/web-platform/tests/html/semantics/links/following-hyperlinks/active-document.window.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/links/following-hyperlinks/active-document.window.js b/testing/web-platform/tests/html/semantics/links/following-hyperlinks/active-document.window.js
new file mode 100644
index 0000000000..efa16e7d17
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/following-hyperlinks/active-document.window.js
@@ -0,0 +1,23 @@
+["a",
+ "area",
+ "link"].forEach(type => {
+ async_test(t => {
+ const frame = document.createElement("iframe"),
+ link = document.createElement(type);
+ t.add_cleanup(() => frame.remove());
+ frame.onload = t.step_func(() => {
+ // See https://github.com/whatwg/html/issues/490
+ if(frame.contentWindow.location.href === "about:blank")
+ return;
+ link.click(); // must be ignored because document is not active
+ t.step_timeout(() => {
+ assert_equals(frame.contentWindow.location.pathname, "/common/blank.html");
+ t.done();
+ }, 500);
+ });
+ document.body.appendChild(frame);
+ frame.contentDocument.body.appendChild(link);
+ link.href = "/";
+ frame.src = "/common/blank.html";
+ }, "<" + type + "> in navigated away <iframe>'s document cannot follow hyperlinks");
+});