mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
LibWeb: Propagate NaN in CSS clamp function
Gains us 10 WPT tests.
This commit is contained in:
parent
4ba54a7a1c
commit
e260ba54e0
Notes:
github-actions[bot]
2025-08-08 10:45:00 +00:00
Author: https://github.com/Calme1709
Commit: e260ba54e0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5719
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/gmta
6 changed files with 21 additions and 20 deletions
|
@ -1269,6 +1269,11 @@ Optional<CalculatedStyleValue::CalculationResult> ClampCalculationNode::run_oper
|
|||
if (!consistent_type.has_value())
|
||||
return {};
|
||||
|
||||
// https://drafts.csswg.org/css-values-4/#calc-ieee
|
||||
// Any operation with at least one NaN argument produces NaN.
|
||||
if (isnan(min_result->value()) || isnan(center_result->value()) || isnan(max_result->value()))
|
||||
return CalculatedStyleValue::CalculationResult { AK::NaN<double>, consistent_type.release_value() };
|
||||
|
||||
auto chosen_value = max(min_result->value(), min(center_result->value(), max_result->value()));
|
||||
return CalculatedStyleValue::CalculationResult { chosen_value, consistent_type.release_value() };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue