From 675d919dd23533d412327f20125da232eef649d9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 16 Sep 2023 13:26:42 +0200 Subject: [PATCH] LibWeb: Handle custom ident values for the CSS font-family property We were parsing these all right, but ignoring them in StyleComputer. No test unfortunately, since we don't currently have a way to delay the load event until a @font-face has been fully loaded. (Any test of this right now would be flaky.) --- Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index 301a1f320e..b8010f11e3 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -2136,6 +2137,8 @@ RefPtr StyleComputer::compute_font_for_style_values(DOM::Elemen found_font = find_generic_font(family->to_identifier()); } else if (family->is_string()) { found_font = find_font(family->as_string().string_value()); + } else if (family->is_custom_ident()) { + found_font = find_font(family->as_custom_ident().custom_ident()); } if (found_font) break; @@ -2144,6 +2147,8 @@ RefPtr StyleComputer::compute_font_for_style_values(DOM::Elemen found_font = find_generic_font(font_family.to_identifier()); } else if (font_family.is_string()) { found_font = find_font(font_family.as_string().string_value()); + } else if (font_family.is_custom_ident()) { + found_font = find_font(font_family.as_custom_ident().custom_ident()); } if (!found_font) {