1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00

LibWeb: Update <general-enclosed> definition to match spec change

See https://github.com/w3c/csswg-drafts/pull/6799
This commit is contained in:
Sam Atkins 2021-12-29 12:27:42 +00:00 committed by Andreas Kling
parent 7532ef78ad
commit 0a8e289f37

View file

@ -1130,16 +1130,13 @@ Optional<GeneralEnclosed> Parser::parse_general_enclosed(TokenStream<StyleCompon
auto& first_token = tokens.next_token();
// `[ <function-token> <any-value> ) ]`
// `[ <function-token> <any-value>? ) ]`
if (first_token.is_function())
return GeneralEnclosed { first_token.to_string() };
// `( <ident> <any-value> )`
if (first_token.is_block() && first_token.block().is_paren()) {
auto& block = first_token.block();
if (!block.values().is_empty() && block.values().first().is(Token::Type::Ident))
return GeneralEnclosed { first_token.to_string() };
}
// `( <any-value>? )`
if (first_token.is_block() && first_token.block().is_paren())
return GeneralEnclosed { first_token.to_string() };
tokens.rewind_to_position(start_position);
return {};