summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-24 15:47:42 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-24 15:49:04 +0200
commit71f371f6b1b2af3db373208fb7cbe87d4c38332e (patch)
treef0a1aa11fa4d76de5d1c079079065d3ac87d8864 /Userland/Libraries
parentf8dd3e14bae66bc9b3b26f4f896d9ca43f26e274 (diff)
downloadserenity-71f371f6b1b2af3db373208fb7cbe87d4c38332e.zip
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleComputer.cpp9
1 files 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;
+ }
}
}