diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /dom/html/test | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/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.toml | 2 | ||||
-rw-r--r-- | dom/html/test/forms/test_input_datetime_preventDefault.html | 23 |
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> |