blob: 30a2c24a80bab390c3401ee70c8bdc985cd8a21d [file] [log] [blame]
<!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>