mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 01:51:03 +09:00
LibWeb/CSS: Make non-finite Numbers serialize as themselves
We're required to serialize NaN, infinity, and -infinity as their keyword names, even after they've been converted to Numbers.
This commit is contained in:
parent
c3d61020e7
commit
46b9497a66
Notes:
github-actions[bot]
2025-01-30 18:33:39 +00:00
Author: https://github.com/AtkinsSJ
Commit: 46b9497a66
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3383
5 changed files with 31 additions and 10 deletions
|
@ -871,11 +871,10 @@ CalculatedStyleValue::CalculationResult ConstantCalculationNode::resolve(Calcula
|
|||
return { AK::E<double>, CSSNumericType {} };
|
||||
case ConstantType::Pi:
|
||||
return { AK::Pi<double>, CSSNumericType {} };
|
||||
// FIXME: We need to keep track of Infinity and NaN across all nodes, since they require special handling.
|
||||
case ConstantType::Infinity:
|
||||
return { NumericLimits<double>::max(), CSSNumericType {} };
|
||||
return { AK::Infinity<double>, CSSNumericType {} };
|
||||
case ConstantType::MinusInfinity:
|
||||
return { NumericLimits<double>::lowest(), CSSNumericType {} };
|
||||
return { -AK::Infinity<double>, CSSNumericType {} };
|
||||
case ConstantType::NaN:
|
||||
return { AK::NaN<double>, CSSNumericType {} };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue