1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

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.
This commit is contained in:
Sam Atkins 2023-09-04 10:52:40 +01:00 committed by Andreas Kling
parent 733ad57f39
commit cab8b3e180

View file

@ -1057,10 +1057,6 @@ bool StyleComputer::expand_variables(DOM::Element& element, Optional<CSS::Select
bool StyleComputer::expand_unresolved_values(DOM::Element& element, StringView property_name, Parser::TokenStream<Parser::ComponentValue>& source, Vector<Parser::ComponentValue>& 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<StyleValue> 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<Parser::ComponentValue> values_with_variables_expanded;