From c103269a8e673482c19f234cefa8b02374ec7eaa Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Tue, 26 Sep 2023 16:17:02 +0100 Subject: [PATCH] LibWeb: Fill out `font` property data --- Userland/Libraries/LibWeb/CSS/Properties.json | 5 ++++- .../LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/Properties.json b/Userland/Libraries/LibWeb/CSS/Properties.json index 22326b88449..8240dcab6b5 100644 --- a/Userland/Libraries/LibWeb/CSS/Properties.json +++ b/Userland/Libraries/LibWeb/CSS/Properties.json @@ -839,8 +839,11 @@ "longhands": [ "font-family", "font-size", + "font-stretch", + "font-style", "font-variant", - "font-weight" + "font-weight", + "line-height" ] }, "font-family": { diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp index 5b886250d91..5eac22a8b40 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp @@ -97,6 +97,15 @@ String ShorthandStyleValue::to_string() const return MUST(String::formatted("{} {} {}", longhand(PropertyID::FlexGrow)->to_string(), longhand(PropertyID::FlexShrink)->to_string(), longhand(PropertyID::FlexBasis)->to_string())); case PropertyID::FlexFlow: return MUST(String::formatted("{} {}", longhand(PropertyID::FlexDirection)->to_string(), longhand(PropertyID::FlexWrap)->to_string())); + case PropertyID::Font: + return MUST(String::formatted("{} {} {} {} {} / {} {}", + longhand(PropertyID::FontStyle)->to_string(), + longhand(PropertyID::FontVariant)->to_string(), + longhand(PropertyID::FontWeight)->to_string(), + longhand(PropertyID::FontStretch)->to_string(), + longhand(PropertyID::FontSize)->to_string(), + longhand(PropertyID::LineHeight)->to_string(), + longhand(PropertyID::FontFamily)->to_string())); case PropertyID::GridArea: { auto& row_start = longhand(PropertyID::GridRowStart)->as_grid_track_placement(); auto& column_start = longhand(PropertyID::GridColumnStart)->as_grid_track_placement();