From 1f53727a3f8386ecd9c746ca0e1097afcd2531bf Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Sun, 17 Mar 2024 17:27:38 -0700 Subject: [PATCH] LibWeb: Remove Badge from CSS::Parser::resolve_unresolved_style_value KeyframeEffect needs to use this method to resolve unresolved properties in the same way that StyleComputer does. --- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 2 +- Userland/Libraries/LibWeb/CSS/Parser/Parser.h | 2 +- Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 501ecaa663a..3a157e3cbe1 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -6929,7 +6929,7 @@ bool Parser::has_ignored_vendor_prefix(StringView string) return true; } -NonnullRefPtr Parser::resolve_unresolved_style_value(Badge, ParsingContext const& context, DOM::Element& element, Optional pseudo_element, PropertyID property_id, UnresolvedStyleValue const& unresolved) +NonnullRefPtr Parser::resolve_unresolved_style_value(ParsingContext const& context, DOM::Element& element, Optional pseudo_element, PropertyID property_id, UnresolvedStyleValue const& unresolved) { // Unresolved always contains a var() or attr(), unless it is a custom property's value, in which case we shouldn't be trying // to produce a different StyleValue from it. diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h index 64ba9bfab2f..90a85f06250 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h @@ -69,7 +69,7 @@ public: Optional parse_as_component_value(); - static NonnullRefPtr resolve_unresolved_style_value(Badge, ParsingContext const&, DOM::Element&, Optional, PropertyID, UnresolvedStyleValue const&); + static NonnullRefPtr resolve_unresolved_style_value(ParsingContext const&, DOM::Element&, Optional, PropertyID, UnresolvedStyleValue const&); [[nodiscard]] LengthOrCalculated parse_as_sizes_attribute(); diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index a4974692d94..c243ea24644 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -715,7 +715,7 @@ void StyleComputer::set_all_properties(DOM::Element& element, Optional property_value = value; if (property_value->is_unresolved()) - property_value = Parser::Parser::resolve_unresolved_style_value({}, Parser::ParsingContext { document }, element, pseudo_element, property_id, property_value->as_unresolved()); + property_value = Parser::Parser::resolve_unresolved_style_value(Parser::ParsingContext { document }, element, pseudo_element, property_id, property_value->as_unresolved()); if (!property_value->is_unresolved()) set_property_expanding_shorthands(style, property_id, property_value, declaration, properties_for_revert); @@ -741,7 +741,7 @@ void StyleComputer::cascade_declarations(StyleProperties& style, DOM::Element& e auto property_value = property.value; if (property.value->is_unresolved()) - property_value = Parser::Parser::resolve_unresolved_style_value({}, Parser::ParsingContext { document() }, element, pseudo_element, property.property_id, property.value->as_unresolved()); + property_value = Parser::Parser::resolve_unresolved_style_value(Parser::ParsingContext { document() }, element, pseudo_element, property.property_id, property.value->as_unresolved()); if (!property_value->is_unresolved()) set_property_expanding_shorthands(style, property.property_id, property_value, &match.rule->declaration(), properties_for_revert, important == Important::Yes ? StyleProperties::Important::Yes : StyleProperties::Important::No); } @@ -760,7 +760,7 @@ void StyleComputer::cascade_declarations(StyleProperties& style, DOM::Element& e auto property_value = property.value; if (property.value->is_unresolved()) - property_value = Parser::Parser::resolve_unresolved_style_value({}, Parser::ParsingContext { document() }, element, pseudo_element, property.property_id, property.value->as_unresolved()); + property_value = Parser::Parser::resolve_unresolved_style_value(Parser::ParsingContext { document() }, element, pseudo_element, property.property_id, property.value->as_unresolved()); if (!property_value->is_unresolved()) set_property_expanding_shorthands(style, property.property_id, property_value, inline_style, properties_for_revert, important == Important::Yes ? StyleProperties::Important::Yes : StyleProperties::Important::No); } @@ -1498,7 +1498,7 @@ void StyleComputer::compute_cascaded_values(StyleProperties& style, DOM::Element auto property_id = (CSS::PropertyID)i; auto& property = style.m_property_values[i]; if (property.style && property.style->is_unresolved()) - property.style = Parser::Parser::resolve_unresolved_style_value({}, Parser::ParsingContext { document() }, element, pseudo_element, property_id, property.style->as_unresolved()); + property.style = Parser::Parser::resolve_unresolved_style_value(Parser::ParsingContext { document() }, element, pseudo_element, property_id, property.style->as_unresolved()); } } }