mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-29 05:38:24 +00:00
LibWeb: Fix “step base” computation for HTMLInputElement
This change fixes a bug in our implementation of the “step base” algorithm at https://html.spec.whatwg.org/#concept-input-min-zero. We were using the “value” IDL/DOM attribute in a particular step, where the spec instead actually requires using the “value” content attribute.
This commit is contained in:
parent
9ca25eed7f
commit
13f9670f20
Notes:
github-actions[bot]
2025-03-06 14:01:24 +00:00
Author: https://github.com/sideshowbarker
Commit: 13f9670f20
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3806
Reviewed-by: https://github.com/trflynn89 ✅
4 changed files with 11 additions and 6 deletions
|
@ -104,6 +104,7 @@
|
|||
{conditions: {max: "5", value: "6"}, expected: false, name: "[target] suffering from an overflow"},
|
||||
{conditions: {min: "5", value: "4"}, expected: false, name: "[target] suffering from an underflow"},
|
||||
{conditions: {step: 2 * 1 * 1, value: "3"}, expected: false, name: "[target] suffering from a step mismatch"},
|
||||
{conditions: {step: 10, value: "20", content_value: "9"}, expected: false, name: "[target] (with 'value' content attribute) suffering from a step mismatch"},
|
||||
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -340,6 +340,8 @@ var validator = {
|
|||
for (var attr in obj) {
|
||||
if (attr === "message")
|
||||
ctl.setCustomValidity(obj[attr]);
|
||||
else if (attr === "content_value")
|
||||
ctl.setAttribute("value", obj["content_value"])
|
||||
else if (attr === "checked" || obj[attr] || obj[attr] === "")
|
||||
ctl[attr] = obj[attr];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue