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

LibWeb: Stop consuming too many tokens when parsing background-position

This was causing inputs like `0% 0%` to think only one value was
provided.
This commit is contained in:
Sam Atkins 2021-11-15 17:39:04 +00:00 committed by Andreas Kling
parent 7089681f68
commit 16d9ae0f88

View file

@ -2647,7 +2647,7 @@ RefPtr<StyleValue> Parser::parse_single_background_position_value(TokenStream<St
if (seen_items == 2)
break;
auto& token = tokens.next_token();
auto& token = tokens.peek_token();
auto maybe_value = parse_css_value(token);
if (!maybe_value || !property_accepts_value(PropertyID::BackgroundPosition, *maybe_value))
break;