mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibWeb/CSS: Remove inaccurate VERIFY from CalculationResult::from_value
The goal of this VERIFY was to ensure that we didn't mess up the logic for calculating the correct type. However, it's now unable to do so because it doesn't have access to the CalculationContext, which determines what type percentages are. This makes it crash when running the simplification algorithm. The benefits of this check are small, and it meant doing extra work, so let's just remove it.
This commit is contained in:
parent
b947ae60db
commit
581f5dfc86
Notes:
github-actions[bot]
2025-01-30 18:33:13 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/581f5dfc86c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3383
1 changed files with 1 additions and 6 deletions
|
@ -1735,11 +1735,6 @@ bool RemCalculationNode::equals(CalculationNode const& other) const
|
|||
|
||||
CalculatedStyleValue::CalculationResult CalculatedStyleValue::CalculationResult::from_value(Value const& value, CalculationResolutionContext const& context, Optional<CSSNumericType> numeric_type)
|
||||
{
|
||||
auto const expected_numeric_type = numeric_type_from_calculated_style_value(value, {});
|
||||
if (numeric_type.has_value()) {
|
||||
VERIFY(numeric_type.value() == expected_numeric_type);
|
||||
}
|
||||
|
||||
auto number = value.visit(
|
||||
[](Number const& number) { return number.value(); },
|
||||
[](Angle const& angle) { return angle.to_degrees(); },
|
||||
|
@ -1765,7 +1760,7 @@ CalculatedStyleValue::CalculationResult CalculatedStyleValue::CalculationResult:
|
|||
[](Time const& time) { return time.to_seconds(); },
|
||||
[](Percentage const& percentage) { return percentage.value(); });
|
||||
|
||||
return CalculationResult { number, numeric_type };
|
||||
return CalculationResult { number, move(numeric_type) };
|
||||
}
|
||||
|
||||
void CalculatedStyleValue::CalculationResult::add(CalculationResult const& other)
|
||||
|
|
Loading…
Add table
Reference in a new issue