From 71f371f6b1b2af3db373208fb7cbe87d4c38332e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 24 Sep 2021 15:47:42 +0200 Subject: [PATCH] LibWeb: Ignore `font-size: calc(...)` for now This doesn't work correctly in the new world where fonts are resolved during the CSS cascade. Let's patch it out with a FIXME and get back to it once everything has fallen into place. --- Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index aa88f855fd..994915fcb4 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -735,9 +735,12 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele maybe_length = length; } if (maybe_length.has_value()) { - auto calculated_size = maybe_length.value().to_px(viewport_rect, font_metrics, root_font_size); - if (calculated_size != 0) - size = calculated_size; + // FIXME: Support font-size: calc(...) + if (!maybe_length->is_calculated()) { + auto px = maybe_length.value().to_px(viewport_rect, font_metrics, root_font_size); + if (px != 0) + size = px; + } } }