diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /dom/html/test/bug1260704_iframe.html | |
parent | Initial commit. (diff) | |
download | firefox-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 'dom/html/test/bug1260704_iframe.html')
-rw-r--r-- | dom/html/test/bug1260704_iframe.html | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/dom/html/test/bug1260704_iframe.html b/dom/html/test/bug1260704_iframe.html new file mode 100644 index 0000000000..695dc7c1ac --- /dev/null +++ b/dom/html/test/bug1260704_iframe.html @@ -0,0 +1,38 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <script type="text/javascript"> + var noDefault = (location.search.includes("noDefault=true")); + var isMap = (location.search.includes("isMap=true")); + + window.addEventListener("load", () => { + let image = document.getElementById("testImage"); + isMap ? image.setAttribute("ismap", "") : image.removeAttribute("ismap"); + image.addEventListener("click", event => { + if (noDefault) { + ok(true, "image element prevents default"); + event.preventDefault(); + } + }); + + window.addEventListener("click", event => { + ok(true, "expected prevent default = " + noDefault); + ok(true, "actual prevent default = " + event.defaultPrevented); + ok(event.defaultPrevented == noDefault, "PreventDefault should work fine"); + if (noDefault) { + window.parent.postMessage("finished", "http://mochi.test:8888"); + } + }); + window.parent.postMessage("started", "http://mochi.test:8888"); + }); + </script> +</head> +<body> +<a href="bug1260704_iframe_empty.html"> + <img id="testImage" src="file_bug1260704.png" width="100" height="100"/> +</a> +</body> +</html> |