mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb: Use i32 max for clamping 'infinite' calculated integers
This required us to change our range values from `float`s to `double`s since `float` can't exactly represent i32 max
This commit is contained in:
committed by
Jelle Raaijmakers
parent
0e8956ee30
commit
0ab06e119e
Notes:
github-actions[bot]
2026-03-26 11:31:28 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/0ab06e119e8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8609 Reviewed-by: https://github.com/gmta ✅
@@ -5145,7 +5145,7 @@ RefPtr<CalculatedStyleValue const> Parser::parse_calculated_value(ComponentValue
|
||||
switch (descriptor_context.descriptor) {
|
||||
case DescriptorID::AdditiveSymbols:
|
||||
case DescriptorID::Pad:
|
||||
return CalculationContext { .resolve_numbers_as_integers = true, .accepted_type_ranges = { { ValueType::Integer, { 0, NumericLimits<float>::max() } } } };
|
||||
return CalculationContext { .resolve_numbers_as_integers = true, .accepted_type_ranges = { { ValueType::Integer, { 0, NumericLimits<i32>::max() } } } };
|
||||
default:
|
||||
return CalculationContext {};
|
||||
}
|
||||
@@ -5176,9 +5176,9 @@ RefPtr<CalculatedStyleValue const> Parser::parse_calculated_value(ComponentValue
|
||||
case SpecialContext::RatioComponent:
|
||||
return CalculationContext { .accepted_type_ranges = { { ValueType::Number, { 0, NumericLimits<float>::max() } } } };
|
||||
case SpecialContext::StepsIntervalsJumpNone:
|
||||
return CalculationContext { .resolve_numbers_as_integers = true, .accepted_type_ranges = { { ValueType::Integer, { 2, NumericLimits<float>::max() } } } };
|
||||
return CalculationContext { .resolve_numbers_as_integers = true, .accepted_type_ranges = { { ValueType::Integer, { 2, NumericLimits<i32>::max() } } } };
|
||||
case SpecialContext::StepsIntervalsNormal:
|
||||
return CalculationContext { .resolve_numbers_as_integers = true, .accepted_type_ranges = { { ValueType::Integer, { 1, NumericLimits<float>::max() } } } };
|
||||
return CalculationContext { .resolve_numbers_as_integers = true, .accepted_type_ranges = { { ValueType::Integer, { 1, NumericLimits<i32>::max() } } } };
|
||||
case SpecialContext::ShadowBlurRadius:
|
||||
return CalculationContext { .accepted_type_ranges = { { ValueType::Length, { 0, NumericLimits<float>::max() } } } };
|
||||
case SpecialContext::TranslateZArgument:
|
||||
|
||||
Reference in New Issue
Block a user