Bug 1527139 [wpt PR 15188] - HTML: target=_blank implies noopener; opener support, a=testonly
authorAnne van Kesteren <annevk@annevk.nl>
Tue, 19 Feb 2019 14:38:52 +0000
changeset 519234 eca5d888e47f18532896f5671d22f463fab67bf5
parent 519233 a489a398a5e73a15d8c395f79168e4946e678b99
child 519235 0dec93e4ebd2ba049322e204eae1b330ff174a58
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1527139, 15188
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1527139 [wpt PR 15188] - HTML: target=_blank implies noopener; opener support, a=testonly Automatic update from web-platform-tests HTML: target=_blank implies noopener; opener support (#15188) For https://github.com/whatwg/html/pull/4330. -- wpt-commits: e81ca209b45fbe73c1bb7a20e1c7af51ef46258b wpt-pr: 15188
testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/target_blank_implicit_noopener.html
testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/target_blank_iplicit_noopener.html
testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener.html
testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener.tentative.html
testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base.html
rename from testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/target_blank_iplicit_noopener.html
rename to testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/target_blank_implicit_noopener.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset=utf-8>
+  <title>Test behavior of target=_blank links</title>
+  <script src=/resources/testharness.js></script>
+  <script src=/resources/testharnessreport.js></script>
+</head>
+<body>
+  <a href="support/target_blank_implicit_noopener.html?a1" id="a1" rel="noopener" target="_blank">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a2" id="a2" rel="opener" target="_blank">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a3" id="a3" target="_blank">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a4" id="a4" rel="opener noopener" target="_blank">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a5" id="a5" rel="noopener opener" target="_blank">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a6" id="a6" rel="noreferrer" target="_blank">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a7" id="a7" rel="opener noreferrer" target="_blank">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a8" id="a8" rel="noopener opener noreferrer" target="_blank">Click me</a>
+
+  <img src="/images/threecolors.png" />
+    <area shape="rect" coords="0,0,99,50" href="support/target_blank_implicit_noopener.html?area1" id="area1" rel="noopener" target="_blank" />
+  </img>
+  <img src="/images/threecolors.png" />
+    <area shape="rect" coords="0,0,99,50" href="support/target_blank_implicit_noopener.html?area2" id="area2" rel="opener" target="_blank" />
+  </img>
+  <img src="/images/threecolors.png" />
+    <area shape="rect" coords="0,0,99,50" href="support/target_blank_implicit_noopener.html?area3" id="area3" target="_blank" />
+  </img>
+  <img src="/images/threecolors.png" />
+    <area shape="rect" coords="0,0,99,50" href="support/target_blank_implicit_noopener.html?area4" id="area4" rel="opener noopener" target="_blank" />
+  </img>
+  <img src="/images/threecolors.png" />
+    <area shape="rect" coords="0,0,99,50" href="support/target_blank_implicit_noopener.html?area5" id="area5" rel="noopener opener" target="_blank" />
+  </img>
+
+  <script>
+
+  let tests = [
+    { id: "a1", hasOpener: false, name: "Anchor element with target=_blank with rel=noopener" },
+    { id: "a2", hasOpener: true, name: "Anchor element with target=_blank with rel=opener" },
+    { id: "a3", hasOpener: false, name: "Anchor element with target=_blank with implicit rel=noopener" },
+    { id: "a4", hasOpener: false, name: "Anchor element with target=_blank with rel=opener+noopener" },
+    { id: "a5", hasOpener: false, name: "Anchor element with target=_blank with rel=noopener+opener" },
+    { id: "a6", hasOpener: false, name: "Anchor element with target=_blank with rel=noreferrer" },
+    { id: "a7", hasOpener: false, name: "Anchor element with target=_blank with rel=opener+noreferrer" },
+    { id: "a8", hasOpener: false, name: "Anchor element with target=_blank with rel=noopener+opener+noreferrer" },
+    { id: "area1", hasOpener: false, name: "Area element with target=_blank with rel=noopener" },
+    { id: "area2", hasOpener: true, name: "Area element with target=_blank with rel=opener" },
+    { id: "area3", hasOpener: false, name: "Area element with target=_blank with implicit rel=noopener" },
+    { id: "area4", hasOpener: false, name: "Area element with target=_blank with rel=opener+noopener" },
+    { id: "area5", hasOpener: false, name: "Area element with target=_blank with rel=noopener+opener" },
+  ];
+
+  tests.forEach(data => {
+    async_test(
+      test => {
+        let bc = new BroadcastChannel(data.id);
+        bc.addEventListener("message", test.step_func_done(e => {
+          assert_equals(e.data.hasOpener, data.hasOpener);
+        }), {once: true});
+
+        document.getElementById(data.id).click();
+      }, data.name);
+  });
+  </script>
+</body>
+</html>
deleted file mode 100644
--- a/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener.tentative.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset=utf-8>
-  <title>Test behavior of rel="noopener" links</title>
-  <script src=/resources/testharness.js></script>
-  <script src=/resources/testharnessreport.js></script>
-</head>
-<body>
-  <a href="support/target_blank_iplicit_noopener.html?a1" id="a1" rel="noopener" target="_blank">Click me</a>
-  <a href="support/target_blank_iplicit_noopener.html?a2" id="a2" rel="opener" target="_blank">Click me</a>
-  <a href="support/target_blank_iplicit_noopener.html?a3" id="a3" target="_blank">Click me</a>
-  <a href="support/target_blank_iplicit_noopener.html?a4" id="a4" rel="opener noopener" target="_blank">Click me</a>
-  <a href="support/target_blank_iplicit_noopener.html?a5" id="a5" rel="noopener opener" target="_blank">Click me</a>
-
-  <img src="/images/threecolors.png" />
-    <area shape="rect" coords="0,0,99,50" href="support/target_blank_iplicit_noopener.html?area1" id="area1" rel="noopener" target="_blank" />
-  </img>
-  <img src="/images/threecolors.png" />
-    <area shape="rect" coords="0,0,99,50" href="support/target_blank_iplicit_noopener.html?area2" id="area2" rel="opener" target="_blank" />
-  </img>
-  <img src="/images/threecolors.png" />
-    <area shape="rect" coords="0,0,99,50" href="support/target_blank_iplicit_noopener.html?area3" id="area3" target="_blank" />
-  </img>
-  <img src="/images/threecolors.png" />
-    <area shape="rect" coords="0,0,99,50" href="support/target_blank_iplicit_noopener.html?area4" id="area4" rel="opener noopener" target="_blank" />
-  </img>
-  <img src="/images/threecolors.png" />
-    <area shape="rect" coords="0,0,99,50" href="support/target_blank_iplicit_noopener.html?area5" id="area5" rel="noopener opener" target="_blank" />
-  </img>
-
-  <script>
-
-  let tests = [
-    { id: "a1", hasOpener: false, name: "Anchor element with target=_blank with rel=noopener" },
-    { id: "a2", hasOpener: true, name: "Anchor element with target=_blank with rel=opener" },
-    { id: "a3", hasOpener: false, name: "Anchor element with target=_blank with implicit rel=noopener" },
-    { id: "a4", hasOpener: false, name: "Anchor element with target=_blank with rel=opener+noopener" },
-    { id: "a5", hasOpener: false, name: "Anchor element with target=_blank with rel=noopener+opener" },
-    { id: "area1", hasOpener: false, name: "Area element with target=_blank with rel=noopener" },
-    { id: "area2", hasOpener: true, name: "Area element with target=_blank with rel=opener" },
-    { id: "area3", hasOpener: false, name: "Area element with target=_blank with implicit rel=noopener" },
-    { id: "area4", hasOpener: false, name: "Area element with target=_blank with rel=opener+noopener" },
-    { id: "area5", hasOpener: false, name: "Area element with target=_blank with rel=noopener+opener" },
-  ];
-
-  tests.forEach(data => {
-    async_test(
-      test => {
-        let bc = new BroadcastChannel(data.id);
-        bc.addEventListener("message", test.step_func_done(e => {
-          assert_equals(e.data.hasOpener, data.hasOpener);
-        }), {once: true});
-
-        document.getElementById(data.id).click();
-      }, data.name);
-  });
-  </script>
-</body>
-</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset=utf-8>
+  <title>Test behavior of base target=_blank links</title>
+  <script src=/resources/testharness.js></script>
+  <script src=/resources/testharnessreport.js></script>
+  <base target=_blank>
+</head>
+<body>
+  <a href="support/target_blank_implicit_noopener.html?a1" id="a1" rel="noopener">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a2" id="a2" rel="opener">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a3" id="a3">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a4" id="a4" rel="opener noopener">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a5" id="a5" rel="noopener opener">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a6" id="a6" rel="noreferrer">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a7" id="a7" rel="opener noreferrer">Click me</a>
+  <a href="support/target_blank_implicit_noopener.html?a8" id="a8" rel="noopener opener noreferrer">Click me</a>
+
+  <img src="/images/threecolors.png" />
+    <area shape="rect" coords="0,0,99,50" href="support/target_blank_implicit_noopener.html?area1" id="area1" rel="noopener">
+  </img>
+  <img src="/images/threecolors.png" />
+    <area shape="rect" coords="0,0,99,50" href="support/target_blank_implicit_noopener.html?area2" id="area2" rel="opener">
+  </img>
+  <img src="/images/threecolors.png" />
+    <area shape="rect" coords="0,0,99,50" href="support/target_blank_implicit_noopener.html?area3" id="area3">
+  </img>
+  <img src="/images/threecolors.png" />
+    <area shape="rect" coords="0,0,99,50" href="support/target_blank_implicit_noopener.html?area4" id="area4" rel="opener noopener">
+  </img>
+  <img src="/images/threecolors.png" />
+    <area shape="rect" coords="0,0,99,50" href="support/target_blank_implicit_noopener.html?area5" id="area5" rel="noopener opener">
+  </img>
+
+  <script>
+
+  let tests = [
+    { id: "a1", hasOpener: false, name: "Anchor element with base target=_blank with rel=noopener" },
+    { id: "a2", hasOpener: true, name: "Anchor element with base target=_blank with rel=opener" },
+    { id: "a3", hasOpener: false, name: "Anchor element with base target=_blank with implicit rel=noopener" },
+    { id: "a4", hasOpener: false, name: "Anchor element with base target=_blank with rel=opener+noopener" },
+    { id: "a5", hasOpener: false, name: "Anchor element with base target=_blank with rel=noopener+opener" },
+    { id: "a6", hasOpener: false, name: "Anchor element with base target=_blank with rel=noreferrer" },
+    { id: "a7", hasOpener: false, name: "Anchor element with base target=_blank with rel=opener+noreferrer" },
+    { id: "a8", hasOpener: false, name: "Anchor element with base target=_blank with rel=noopener+opener+noreferrer" },
+    { id: "area1", hasOpener: false, name: "Area element with base target=_blank with rel=noopener" },
+    { id: "area2", hasOpener: true, name: "Area element with base target=_blank with rel=opener" },
+    { id: "area3", hasOpener: false, name: "Area element with base target=_blank with implicit rel=noopener" },
+    { id: "area4", hasOpener: false, name: "Area element with base target=_blank with rel=opener+noopener" },
+    { id: "area5", hasOpener: false, name: "Area element with base target=_blank with rel=noopener+opener" },
+  ];
+
+  tests.forEach(data => {
+    async_test(
+      test => {
+        let bc = new BroadcastChannel(data.id);
+        bc.addEventListener("message", test.step_func_done(e => {
+          assert_equals(e.data.hasOpener, data.hasOpener);
+        }), {once: true});
+
+        document.getElementById(data.id).click();
+      }, data.name);
+  });
+  </script>
+</body>
+</html>