summaryrefslogtreecommitdiffstats
path: root/dom/html/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /dom/html/test
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/html/test')
-rw-r--r--dom/html/test/forms/mochitest.toml2
-rw-r--r--dom/html/test/forms/test_input_datetime_preventDefault.html23
2 files changed, 25 insertions, 0 deletions
diff --git a/dom/html/test/forms/mochitest.toml b/dom/html/test/forms/mochitest.toml
index 80d6d3530f..82a8639659 100644
--- a/dom/html/test/forms/mochitest.toml
+++ b/dom/html/test/forms/mochitest.toml
@@ -73,6 +73,8 @@ support-files = ["file_double_submit.html"]
["test_input_datetime_input_change_events.html"]
+["test_input_datetime_preventDefault.html"]
+
["test_input_datetime_readonly.html"]
["test_input_datetime_reset_default_value_input_change_event.html"]
diff --git a/dom/html/test/forms/test_input_datetime_preventDefault.html b/dom/html/test/forms/test_input_datetime_preventDefault.html
new file mode 100644
index 0000000000..76e5928c18
--- /dev/null
+++ b/dom/html/test/forms/test_input_datetime_preventDefault.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>Test for bug 1848158</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<script src="/tests/SimpleTest/EventUtils.js"></script>
+<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+<input id="input" type="date" value="1998-01-22">
+<script>
+SimpleTest.waitForExplicitFinish();
+SimpleTest.waitForFocus(function() {
+ let value = input.value;
+
+ input.addEventListener("keydown", function(e) {
+ e.preventDefault();
+ });
+
+ isnot(value, "", "should have a value");
+
+ input.focus();
+ synthesizeKey("KEY_Backspace");
+ is(input.value, value, "Value shouldn't change");
+ SimpleTest.finish();
+});
+</script>