mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 21:20:18 +00:00
LibWeb/CSS: Support calculated percentages in line-height
Without this, the imported test will crash once we implement `CSSUnitValue::create_an_internal_representation()`.
This commit is contained in:
parent
6f31d9a40d
commit
bd545af210
Notes:
github-actions[bot]
2025-10-09 14:17:34 +00:00
Author: https://github.com/AtkinsSJ
Commit: bd545af210
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6378
Reviewed-by: https://github.com/tcl3
3 changed files with 74 additions and 1 deletions
|
@ -3592,7 +3592,7 @@ NonnullRefPtr<StyleValue const> StyleComputer::compute_line_height(NonnullRefPtr
|
|||
return specified_value->absolutized(computation_context);
|
||||
|
||||
// NOTE: We also support calc()'d lengths (percentages resolve to lengths so we don't have to handle them separately)
|
||||
if (specified_value->is_calculated() && specified_value->as_calculated().resolves_to_length())
|
||||
if (specified_value->is_calculated() && specified_value->as_calculated().resolves_to_length_percentage())
|
||||
return LengthStyleValue::create(specified_value->as_calculated().resolve_length(CalculationResolutionContext::from_computation_context(computation_context, Length(1, LengthUnit::Em))).value());
|
||||
|
||||
// <number [0,∞]>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue