1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

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.
This commit is contained in:
Andreas Kling 2019-11-18 16:54:20 +01:00
parent a14cc573b0
commit b7a840fd0d

View file

@ -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;
}