summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/activation
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/html/editing/activation
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/editing/activation')
-rw-r--r--testing/web-platform/tests/html/editing/activation/click.html18
-rw-r--r--testing/web-platform/tests/html/editing/activation/click_checkbox.html23
2 files changed, 41 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/editing/activation/click.html b/testing/web-platform/tests/html/editing/activation/click.html
new file mode 100644
index 0000000000..edbc477db6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/activation/click.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLElement#click</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function() {
+ var element = document.createElement("div");
+ var received = false;
+ element.addEventListener("click", this.step_func(function(e) {
+ received = true;
+ assert_false(e.isTrusted, "Event should not be trusted")
+ }));
+ element.click();
+ assert_true(received, "click event should have been dispatched synchronously");
+})
+</script>
diff --git a/testing/web-platform/tests/html/editing/activation/click_checkbox.html b/testing/web-platform/tests/html/editing/activation/click_checkbox.html
new file mode 100644
index 0000000000..ab81cbf063
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/activation/click_checkbox.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>Interaction of UI input and the click in progress flag</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-actions.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<p>When you mouse click the checkbox below it should not be checked:</p>
+<p><input type=checkbox onclick=this.click() id="target"></p>
+<p>Now keyboard "click" the checkbox and confirm it's still not checked.</p>
+<script>
+promise_test(async t => {
+ var target = document.getElementById("target");
+ var received = false;
+ target.addEventListener("click", t.step_func(function(e) {
+ received = true;
+ assert_false(target.checked, "The checkbox should not be checked")
+ }));
+
+ await test_driver.click(target);
+ assert_true(received, "click event should have been dispatched synchronously");
+});
+</script>