From 2fa1df2ec4132fb99e290b4415fc50286b96287f Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 29 Sep 2023 12:47:20 +0100 Subject: [PATCH] LibWeb: Implement resolved style for line-height --- .../Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp index 1b6d3028d4..8f0d4ebaf3 100644 --- a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp @@ -177,8 +177,14 @@ RefPtr ResolvedCSSStyleDeclaration::style_value_for_property(L case PropertyID::TextDecorationColor: return ColorStyleValue::create(layout_node.computed_values().text_decoration_color()); - // FIXME: -> line-height + // -> line-height // The resolved value is normal if the computed value is normal, or the used value otherwise. + case PropertyID::LineHeight: { + auto line_height = static_cast(*layout_node.dom_node()).computed_css_values()->property(property_id); + if (line_height->is_identifier() && line_height->to_identifier() == ValueID::Normal) + return line_height; + return LengthStyleValue::create(Length::make_px(layout_node.line_height())); + } // FIXME: -> block-size // -> height