LibWeb: Make input type state change handling specification compliant

This change ensures that the value sanitization algorithm is run and
the text cursor is set to the correct position when the type attribute
of an input is changed.
This commit is contained in:
Tim Ledbetter 2024-09-10 09:24:00 +01:00 committed by Tim Ledbetter
commit 1b74104c17
Notes: github-actions[bot] 2024-09-10 15:13:57 +00:00
6 changed files with 138 additions and 13 deletions

View file

@ -1,4 +1,6 @@
valueAsNumber getter:
number: 100
range: 100
hidden: NaN
text: NaN
search: NaN
@ -11,8 +13,6 @@ month: NaN
week: NaN
time: NaN
datetime-local: NaN
number: 100
range: 100
color: NaN
checkbox: NaN
radio: NaN
@ -22,6 +22,8 @@ image: NaN
reset: NaN
button: NaN
valueAsNumber setter:
number did not throw: 100
range did not throw: 100
hidden threw exception: InvalidStateError: valueAsNumber: Invalid input type used
text threw exception: InvalidStateError: valueAsNumber: Invalid input type used
search threw exception: InvalidStateError: valueAsNumber: Invalid input type used
@ -34,8 +36,6 @@ month did not throw: NaN
week did not throw: NaN
time did not throw: NaN
datetime-local did not throw: NaN
number did not throw: 100
range did not throw: 100
color threw exception: InvalidStateError: valueAsNumber: Invalid input type used
checkbox threw exception: InvalidStateError: valueAsNumber: Invalid input type used
radio threw exception: InvalidStateError: valueAsNumber: Invalid input type used