LibWeb/HTML: Only use maxlength <input> attribute when applicable

This commit is contained in:
Shannon Booth 2025-01-15 22:12:57 +13:00 committed by Jelle Raaijmakers
commit 7b637b1eee
Notes: github-actions[bot] 2025-01-15 10:42:38 +00:00
3 changed files with 44 additions and 2 deletions

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<title>input type=number maxlength</title>
<script src="../../../../resources/testharness.js"></script>
<script src="../../../../resources/testharnessreport.js"></script>
<script src="../../../../resources/testdriver.js"></script>
<script src="../../../../resources/testdriver-vendor.js"></script>
<input type="number" maxlength="1">
<script>
async_test(t => {
let elem = document.getElementsByTagName("input")[0];
test_driver.send_keys(elem, "1234")
.then(t.step_func(() => {
assert_equals(elem.value, "1234");
t.done();
}));
}, "maxlength doesn't apply to input type=number");
</script>