mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 04:59:23 +00:00
LibWeb/CSS: Replace resolve_number_deprecated() with resolve_number()
This commit is contained in:
parent
d9a386fa81
commit
0dba531772
Notes:
github-actions[bot]
2025-09-24 15:36:31 +00:00
Author: https://github.com/AtkinsSJ
Commit: 0dba531772
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6290
Reviewed-by: https://github.com/tcl3 ✅
8 changed files with 6 additions and 22 deletions
|
@ -3067,21 +3067,6 @@ Optional<Time> CalculatedStyleValue::resolve_time(CalculationResolutionContext c
|
|||
return {};
|
||||
}
|
||||
|
||||
Optional<double> CalculatedStyleValue::resolve_number_deprecated(CalculationResolutionContext const& context) const
|
||||
{
|
||||
auto result = m_calculation->resolve(context);
|
||||
if (!result.type().has_value() || !result.type()->matches_number(m_context.percentages_resolve_as))
|
||||
return {};
|
||||
|
||||
// https://drafts.csswg.org/css-values/#calc-ieee
|
||||
// NaN does not escape a top-level calculation; it’s censored into a zero value.
|
||||
auto value = result.value();
|
||||
if (isnan(value))
|
||||
return 0.;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
Optional<double> CalculatedStyleValue::resolve_number(CalculationResolutionContext const& context) const
|
||||
{
|
||||
auto result = resolve_value(context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue