summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fenced-frame/resources/navigate-by-name-inner.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/fenced-frame/resources/navigate-by-name-inner.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/fenced-frame/resources/navigate-by-name-inner.html')
-rw-r--r--testing/web-platform/tests/fenced-frame/resources/navigate-by-name-inner.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fenced-frame/resources/navigate-by-name-inner.html b/testing/web-platform/tests/fenced-frame/resources/navigate-by-name-inner.html
new file mode 100644
index 0000000000..c7d7d6f278
--- /dev/null
+++ b/testing/web-platform/tests/fenced-frame/resources/navigate-by-name-inner.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="utils.js"></script>
+<title>Fenced frame hosting named frames</title>
+
+<body>
+<script>
+async function init() {
+ // This file is meant to run in a <fencedframe>. It sets up multiple frames
+ // all with the name `target_frame` in the following arrangements:
+ // 1.) A top-level fenced frame
+ // 2.) An iframe within a fenced frame
+ // 3.) A nested fenced frame
+ // Navigations to all of the above should fail, and thus should open a new
+ // top-level popup window instead of navigating these frames.
+
+ const [ready_for_navigation_key, test_type] = parseKeylist();
+
+ switch (test_type) {
+ case "top-level fenced frame":
+ // Set up the named frame and report to the outer document that we're ready
+ // for it to try and navigate the named frame.
+ window.name = "target_frame";
+ writeValueToServer(ready_for_navigation_key, "READY");
+ break;
+ case "nested iframe":
+ const iframe = document.createElement('iframe');
+ iframe.name = "target_frame";
+ document.body.append(iframe);
+ writeValueToServer(ready_for_navigation_key, "READY");
+ break;
+ case "nested fenced frame":
+ // This fenced frame will report to the outermost document when it is ready.
+ const ff =
+ attachFencedFrame(generateURL(
+ "fenced-frame-set-name-and-report-ready-for-" +
+ "outermost-document-to-navigate.html",
+ [ready_for_navigation_key]));
+ break;
+ }
+}
+
+init();
+</script>
+</body>