From b7a840fd0d18b002dbecc8553c52b514321472c6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 18 Nov 2019 16:54:20 +0100 Subject: [PATCH] LibHTML: Respect the line-height property if set It's now possible to override the line-height via CSS. It will still default to 1.4 if not specified. --- Libraries/LibHTML/CSS/StyleProperties.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/LibHTML/CSS/StyleProperties.cpp b/Libraries/LibHTML/CSS/StyleProperties.cpp index 0f1abe6977..512bce4bbc 100644 --- a/Libraries/LibHTML/CSS/StyleProperties.cpp +++ b/Libraries/LibHTML/CSS/StyleProperties.cpp @@ -103,6 +103,9 @@ void StyleProperties::load_font() const float StyleProperties::line_height() const { + auto line_height_length = length_or_fallback(CSS::PropertyID::LineHeight, {}); + if (line_height_length.is_absolute()) + return (float)font().glyph_height() * line_height_length.to_px(); return (float)font().glyph_height() * 1.4f; }