mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 21:20:18 +00:00
LibWeb: Correctly resolve percentages against relative lengths in calcs
Previously we would always assume the percentage was 100%
This commit is contained in:
parent
b80e6a4d30
commit
1ca511b627
Notes:
github-actions[bot]
2025-09-19 09:09:20 +00:00
Author: https://github.com/Calme1709
Commit: 1ca511b627
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6072
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 1 additions and 1 deletions
|
@ -3269,7 +3269,7 @@ NonnullRefPtr<CalculationNode const> simplify_a_calculation_tree(CalculationNode
|
|||
if (length.is_absolute())
|
||||
return NumericCalculationNode::create(Length::make_px(length.absolute_length_to_px()).percentage_of(*percentage), context);
|
||||
if (resolution_context.length_resolution_context.has_value())
|
||||
return NumericCalculationNode::create(Length::make_px(length.to_px(resolution_context.length_resolution_context.value())), context);
|
||||
return NumericCalculationNode::create(Length::make_px(length.to_px(resolution_context.length_resolution_context.value())).percentage_of(*percentage), context);
|
||||
return nullptr;
|
||||
},
|
||||
[&](Time const& time) -> RefPtr<NumericCalculationNode const> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue