mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-18 22:19:50 +00:00
LibWeb/HTML: Implement default value of range inputs
Range inputs now always uses the default value if the value attribute is not set and the input is not dirty.
This commit is contained in:
parent
aea8650d8b
commit
a127f77602
Notes:
github-actions[bot]
2025-08-14 15:06:56 +00:00
Author: https://github.com/skyz1
Commit: a127f77602
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5812
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/trflynn89
2 changed files with 5 additions and 4 deletions
|
@ -1728,6 +1728,8 @@ Utf16String HTMLInputElement::value_sanitization_algorithm(Utf16String const& va
|
|||
// as a floating-point number, of the default value.
|
||||
auto maybe_value = parse_floating_point_number(value);
|
||||
if (!is_valid_floating_point_number(value) ||
|
||||
// AD-HOC: Use the default value if the value has not been set.
|
||||
(!m_dirty_value && !has_attribute(AttributeNames::value)) ||
|
||||
// AD-HOC: The spec doesn't require these checks - but other engines do them.
|
||||
!maybe_value.has_value() || !isfinite(maybe_value.value())) {
|
||||
// The default value is the minimum plus half the difference between the minimum and the maximum, unless
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue