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 /testing/web-platform/tests/html/semantics/forms/the-input-element/email-set-value.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 'testing/web-platform/tests/html/semantics/forms/the-input-element/email-set-value.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/forms/the-input-element/email-set-value.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/email-set-value.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/email-set-value.html new file mode 100644 index 0000000000..95245fb824 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/email-set-value.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<title>Input Email setValue</title> +<link rel="author" href="mailto:atotic@chromium.org"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#e-mail-state-(type=email)"> +<link rel="help" href="https://crbug.com/423785"> +<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> + +<input type="email"> + +<script> +promise_test(async () => { + let input = document.querySelector("input"); + let unsanitized = ' foo@bar '; + let sanitized = unsanitized.trim(); + await test_driver.send_keys(input, unsanitized); + input.select(); + assert_equals(input.value, sanitized, "value is sanitized"); + assert_equals(window.getSelection().toString(), unsanitized, + "visible value is unsanitized"); + input.value = sanitized; + input.select(); + assert_equals(window.getSelection().toString(), sanitized, + "visible value is sanitized after setValue(sanitized)"); +}, +"setValue(sanitizedValue) is reflected in visible text field content"); +</script> |