diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index cf996e4c59..8d87624c78 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -3038,7 +3038,7 @@ RefPtr Parser::parse_builtin_value(ComponentValue const& component_v return {}; } -RefPtr Parser::parse_calculated_value(Vector const& component_values) +RefPtr Parser::parse_calculated_value(Vector const& component_values) { auto calc_expression = parse_calc_expression(component_values); if (calc_expression == nullptr) @@ -6960,6 +6960,15 @@ bool Parser::is_builtin(StringView name) || name.equals_ignoring_case("unset"sv); } +RefPtr Parser::parse_calculated_value(Badge, ParsingContext const& context, Vector const& tokens) +{ + if (tokens.is_empty()) + return {}; + + Parser parser(context, ""sv); + return parser.parse_calculated_value(tokens); +} + RefPtr Parser::parse_css_value(Badge, ParsingContext const& context, PropertyID property_id, Vector const& tokens) { if (tokens.is_empty() || property_id == CSS::PropertyID::Invalid || property_id == CSS::PropertyID::Custom) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h index 28f0e6e2ea..d224023bbc 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h @@ -86,6 +86,7 @@ public: RefPtr parse_as_css_value(PropertyID); static RefPtr parse_css_value(Badge, ParsingContext const&, PropertyID, Vector const&); + static RefPtr parse_calculated_value(Badge, ParsingContext const&, Vector const&); private: enum class ParseError { @@ -270,7 +271,7 @@ private: RefPtr parse_css_value(ComponentValue const&); RefPtr parse_builtin_value(ComponentValue const&); RefPtr parse_dynamic_value(ComponentValue const&); - RefPtr parse_calculated_value(Vector const&); + RefPtr parse_calculated_value(Vector const&); RefPtr parse_dimension_value(ComponentValue const&); RefPtr parse_numeric_value(ComponentValue const&); RefPtr parse_identifier_value(ComponentValue const&);