LibWeb: Make CSS sign(A) behave correctly for negative zero

We were incorrectly returning 0 instead of -0 for sign(-0).

+7 new WPT subtest passes.
This commit is contained in:
Andreas Kling 2025-05-20 12:08:34 +02:00 committed by Andreas Kling
commit 4ef34ebd96
Notes: github-actions[bot] 2025-05-20 11:29:42 +00:00
2 changed files with 10 additions and 10 deletions

View file

@ -1400,7 +1400,7 @@ Optional<CalculatedStyleValue::CalculationResult> SignCalculationNode::run_opera
sign = 1;
} else {
FloatExtractor<double> const extractor { .d = child_value->value() };
sign = extractor.sign ? -0 : 0;
sign = extractor.sign ? -0.0 : 0.0;
}
return CalculatedStyleValue::CalculationResult { sign, CSSNumericType {}.made_consistent_with(child_value->type().value()) };