@@ -4526,30 +4526,30 @@ RefPtr<StyleValue const> Parser::parse_quotes_value(TokenStream<ComponentValue>&
45264526{
45274527 // https://www.w3.org/TR/css-content-3/#quotes-property
45284528 // auto | none | [ <string> <string> ]+
4529- auto transaction = tokens.begin_transaction ();
45304529
4531- if (tokens.remaining_token_count () == 1 ) {
4532- auto keyword = parse_keyword_value (tokens);
4533- if (keyword && property_accepts_keyword (PropertyID::Quotes, keyword->to_keyword ())) {
4534- transaction.commit ();
4535- return keyword;
4536- }
4537- return nullptr ;
4538- }
4530+ if (auto auto_keyword = parse_all_as_single_keyword_value (tokens, Keyword::Auto))
4531+ return auto_keyword.release_nonnull ();
45394532
4540- // Parse an even number of <string> values.
4541- if (tokens.remaining_token_count () % 2 != 0 )
4542- return nullptr ;
4533+ if (auto none_keyword = parse_all_as_single_keyword_value (tokens, Keyword::None))
4534+ return none_keyword.release_nonnull ();
4535+
4536+ auto transaction = tokens.begin_transaction ();
4537+ tokens.discard_whitespace ();
45434538
4539+ // Parse an even number of <string> values.
45444540 StyleValueVector string_values;
45454541 while (tokens.has_next_token ()) {
45464542 auto maybe_string = parse_string_value (tokens);
45474543 if (!maybe_string)
45484544 return nullptr ;
45494545
45504546 string_values.append (maybe_string.release_nonnull ());
4547+ tokens.discard_whitespace ();
45514548 }
45524549
4550+ if (string_values.size () % 2 != 0 )
4551+ return nullptr ;
4552+
45534553 transaction.commit ();
45544554 return StyleValueList::create (move (string_values), StyleValueList::Separator::Space);
45554555}
0 commit comments