1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:47:35 +00:00

LibWeb: Use a string instead of an internal Parser class in Supports

Now that we can serialize CSS tokens, we can just hold a string and then
re-parse it when the Supports is evaluated. This feels a little weird,
but it only happens once so it's not going to slow it down much, and it
keep the API cleaner.
This commit is contained in:
Sam Atkins 2021-11-24 16:11:04 +00:00 committed by Andreas Kling
parent 7d5c626276
commit dea4f83037
4 changed files with 4 additions and 7 deletions

View file

@ -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;