summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/the-button-element/button-type-enumerated-ascii-case-insensitive.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/the-button-element/button-type-enumerated-ascii-case-insensitive.html')
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-button-element/button-type-enumerated-ascii-case-insensitive.html34
1 files changed, 34 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/the-button-element/button-type-enumerated-ascii-case-insensitive.html b/testing/web-platform/tests/html/semantics/forms/the-button-element/button-type-enumerated-ascii-case-insensitive.html
new file mode 100644
index 0000000000..30a2c24a80
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-button-element/button-type-enumerated-ascii-case-insensitive.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<link rel="help" href="https://html.spec.whatwg.org/#attr-button-type">
+<link rel="help" href="https://html.spec.whatwg.org/#enumerated-attribute">
+<meta name="assert" content="button@type values are ASCII case-insensitive">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<button type="reset">
+<button type="ReSeT">
+<button type="reſet">
+<button type="submit">
+<button type="SuBmIt">
+<button type="ſubmit">
+<script>
+const button = document.querySelectorAll("button");
+
+test(() => {
+ assert_equals(button[0].type, "reset", "lowercase valid");
+ assert_equals(button[1].type, "reset", "mixed case valid");
+ assert_equals(button[2].type, "submit", "non-ASCII invalid");
+}, "keyword reset");
+
+test(() => {
+ assert_equals(button[3].type, "submit", "lowercase valid");
+
+ // vacuous: the invalid value default is currently submit, so even if the UA
+ // treats this as invalid, the observable behaviour would still be correct
+ assert_equals(button[4].type, "submit", "mixed case valid");
+
+ // vacuous: the invalid value default is currently submit, so even if the UA
+ // treats this as valid, the observable behaviour would still be correct
+ assert_equals(button[5].type, "submit", "non-ASCII invalid");
+}, "keyword submit");
+</script>