1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

LibWeb: Forbid using CSS::Length as reference value in resolved()

CSSPixels should not be wrapped into CSS::Length before being passed
to resolved() to end up resolving percentages without losing
precision.

Fixes thrashing layout when 33.3333% width is used together with
"box-sizing: border-box".
This commit is contained in:
Aliaksandr Kalenik 2024-01-07 01:09:09 +01:00 committed by Andreas Kling
parent f2cd120fd3
commit 4bc38300ad
10 changed files with 40 additions and 17 deletions

View file

@ -509,7 +509,7 @@ void paint_text_decoration(PaintContext& context, Layout::Node const& text_node,
auto line_color = text_node.computed_values().text_decoration_color();
CSSPixels css_line_thickness = [&] {
CSS::Length computed_thickness = text_node.computed_values().text_decoration_thickness().resolved(text_node, CSS::Length(1, CSS::Length::Type::Em));
CSS::Length computed_thickness = text_node.computed_values().text_decoration_thickness().resolved(text_node, CSS::Length(1, CSS::Length::Type::Em).to_px(text_node));
if (computed_thickness.is_auto())
return max(glyph_height.scaled(0.1), 1);