diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 1d511ce0eb..f684647903 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -1113,7 +1113,7 @@ Optional Parser::parse_supports_feature(TokenStreamto_string() }; } } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h index 191d5da917..7229a6bf40 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h @@ -113,9 +113,6 @@ public: RefPtr parse_as_css_value(PropertyID); - // FIXME: This is a hack, while CSS::Supports is using a StyleDeclarationRule - [[nodiscard]] Optional convert_to_style_property(StyleDeclarationRule const&); - private: enum class ParsingResult { Done, @@ -175,6 +172,7 @@ private: [[nodiscard]] RefPtr convert_to_rule(NonnullRefPtr); [[nodiscard]] RefPtr convert_to_declaration(NonnullRefPtr); + [[nodiscard]] Optional convert_to_style_property(StyleDeclarationRule const&); Optional parse_color(StyleComponentValueRule const&); Optional parse_length(StyleComponentValueRule const&); diff --git a/Userland/Libraries/LibWeb/CSS/Supports.cpp b/Userland/Libraries/LibWeb/CSS/Supports.cpp index 3ba725be03..ed375d7a11 100644 --- a/Userland/Libraries/LibWeb/CSS/Supports.cpp +++ b/Userland/Libraries/LibWeb/CSS/Supports.cpp @@ -48,7 +48,7 @@ MatchResult Supports::InParens::evaluate() const MatchResult Supports::Feature::evaluate() const { - auto style_property = Parser({}, "").convert_to_style_property(declaration); + auto style_property = Parser({}, declaration).parse_as_declaration(); if (style_property.has_value()) return MatchResult::True; return MatchResult::False; diff --git a/Userland/Libraries/LibWeb/CSS/Supports.h b/Userland/Libraries/LibWeb/CSS/Supports.h index b0d1f8a5ca..bf7d671313 100644 --- a/Userland/Libraries/LibWeb/CSS/Supports.h +++ b/Userland/Libraries/LibWeb/CSS/Supports.h @@ -21,8 +21,7 @@ class Supports final : public RefCounted { public: struct Feature { - // FIXME: Using this internal parser class is a bit of a hack. - StyleDeclarationRule declaration; + String declaration; MatchResult evaluate() const; };