From cab8b3e18074efc4cce65d471f0ac47ed813c6f2 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Mon, 4 Sep 2023 10:52:40 +0100 Subject: [PATCH] LibWeb: Move a FIXME comment where it belongs `var()` is now handled in `expand_variables()`, so let's have the FIXME where it applies to the entire process. --- Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index e52af875c4..607056dd2a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -1057,10 +1057,6 @@ bool StyleComputer::expand_variables(DOM::Element& element, Optional& source, Vector& dest) const { - // FIXME: Do this better! - // We build a copy of the tree of ComponentValues, with all var()s and attr()s replaced with their contents. - // This is a very naive solution, and we could do better if the CSS Parser could accept tokens one at a time. - while (source.has_next_token()) { auto const& value = source.next_token(); if (value.is_function()) { @@ -1168,6 +1164,10 @@ NonnullRefPtr StyleComputer::resolve_unresolved_style_value(DOM::Ele // If the value is invalid, we fall back to `unset`: https://www.w3.org/TR/css-variables-1/#invalid-at-computed-value-time + // FIXME: Do this better! + // We build a copy of the tree of ComponentValues, with all var()s and attr()s replaced with their contents. + // This is a very naive solution, and we could do better if the CSS Parser could accept tokens one at a time. + Parser::TokenStream unresolved_values_without_variables_expanded { unresolved.values() }; Vector values_with_variables_expanded;