From 6f2f91d1f50130b6060ccfb1af1faaa890e81618 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 18 Jul 2024 17:41:43 +0100 Subject: [PATCH] LibWeb: Stop computing `content` in `NodeWithStyle::apply_style()` This seems to have been required when pseudo-elements were first implemented, but has since become unused. It's also awkward because we don't have access to the DOM Element and its CountersSet at this point. So, let's remove it. For reference, Chrome&Firefox both return the computed value for `content: counter(foo)` as `counter(foo)`, not as the computed string. So not computing it here seems like the intended behaviour. --- Userland/Libraries/LibWeb/Layout/Node.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index d94955f8ea5..dd33d9e4630 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -751,8 +751,6 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style) if (auto outline_width = computed_style.property(CSS::PropertyID::OutlineWidth); outline_width->is_length()) computed_values.set_outline_width(outline_width->as_length().length()); - // FIXME: Stop generating the content twice. (First time is in TreeBuilder.) - computed_values.set_content(computed_style.content(initial_quote_nesting_level()).content_data); computed_values.set_grid_auto_columns(computed_style.grid_auto_columns()); computed_values.set_grid_auto_rows(computed_style.grid_auto_rows()); computed_values.set_grid_template_columns(computed_style.grid_template_columns());