mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 18:47:15 +02: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:
committed by
Tim Flynn
parent
aea8650d8b
commit
a127f77602
Notes:
github-actions[bot]
2025-08-14 15:06:56 +00:00
Author: https://github.com/skyz1 Commit: https://github.com/LadybirdBrowser/ladybird/commit/a127f77602a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5812 Reviewed-by: https://github.com/gmta Reviewed-by: https://github.com/trflynn89
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user