summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fenced-frame/resources/popup-noopener-inner.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/fenced-frame/resources/popup-noopener-inner.html
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/fenced-frame/resources/popup-noopener-inner.html')
-rw-r--r--testing/web-platform/tests/fenced-frame/resources/popup-noopener-inner.html48
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fenced-frame/resources/popup-noopener-inner.html b/testing/web-platform/tests/fenced-frame/resources/popup-noopener-inner.html
new file mode 100644
index 0000000000..6a79fd21b2
--- /dev/null
+++ b/testing/web-platform/tests/fenced-frame/resources/popup-noopener-inner.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="utils.js"></script>
+<title>Fenced frame creating popups</title>
+
+<body>
+<script>
+async function init() {
+ // This file is meant to run in a <fencedframe>. It sets up multiple frames
+ // in the following arrangements:
+ // 1.) A top-level fenced frame
+ // 2.) An iframe within a fenced frame
+ // 3.) A nested fenced frame
+ // All of the above frames create a popup which should not return a reference
+ // to the new window.
+
+ const [popup_noopener_key, popup_openee_key, popup_name_key, test_type] =
+ parseKeylist();
+
+ switch (test_type) {
+ case "top-level fenced frame":
+ src_popup = generateURL(`popup-noopener-destination.html`,
+ [popup_noopener_key, popup_name_key]);
+ const popup = window.open(src_popup, "foo");
+ if (popup) {
+ writeValueToServer(popup_openee_key, "FAIL");
+ } else {
+ writeValueToServer(popup_openee_key, "PASS");
+ }
+ break;
+ case "nested iframe":
+ const iframe = document.createElement('iframe');
+ document.body.append(iframe);
+ iframe.src = generateURL(`create-popup.html`,
+ [popup_noopener_key, popup_openee_key, popup_name_key]);
+ break;
+ case "nested fenced frame":
+ const ff =
+ attachFencedFrame(generateURL(`create-popup.html`,
+ [popup_noopener_key, popup_openee_key, popup_name_key]));
+ break;
+ }
+
+}
+
+init();
+</script>
+</body>