mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +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:
parent
a14cc573b0
commit
b7a840fd0d
Notes:
sideshowbarker
2024-07-19 11:09:23 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b7a840fd0d1
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue