mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 22:29:13 +00:00
LibWeb: Allow percentage tokens again when parsing calc()
I unintentionally broke this in my LengthPercentage PR, but it was not convenient to fix until now.
This commit is contained in:
committed by
Andreas Kling
parent
ce0de4b2b4
commit
b54cd17c1e
@@ -574,6 +574,7 @@ Optional<CalculatedStyleValue::ResolvedType> CalculatedStyleValue::CalcValue::re
|
||||
return value.visit(
|
||||
[](float) -> Optional<CalculatedStyleValue::ResolvedType> { return { ResolvedType::Number }; },
|
||||
[](Length const&) -> Optional<CalculatedStyleValue::ResolvedType> { return { ResolvedType::Length }; },
|
||||
[](Percentage const&) -> Optional<CalculatedStyleValue::ResolvedType> { return { ResolvedType::Percentage }; },
|
||||
[](NonnullOwnPtr<CalcSum> const& sum) { return sum->resolved_type(); });
|
||||
}
|
||||
|
||||
@@ -604,6 +605,9 @@ CalculatedStyleValue::CalculationResult CalculatedStyleValue::CalcValue::resolve
|
||||
[&](Length const& length) -> CalculatedStyleValue::CalculationResult {
|
||||
return CalculatedStyleValue::CalculationResult { length };
|
||||
},
|
||||
[&](Percentage const& percentage) -> CalculatedStyleValue::CalculationResult {
|
||||
return CalculatedStyleValue::CalculationResult { percentage };
|
||||
},
|
||||
[&](NonnullOwnPtr<CalcSum> const& sum) -> CalculatedStyleValue::CalculationResult {
|
||||
return sum->resolve(layout_node, percentage_basis);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user