LibWeb: Dont try to fetch another token in an+b parsing

When parsing <ndash-dimension> <signless-integer>, we tried to parse
a new token from the stream instead of using the value we had already
extracted. This caused pages that used the syntax to crash.
This commit is contained in:
stelar7 2022-05-07 23:46:19 +02:00 committed by Linus Groh
parent 303b72d516
commit 5ca8e2a751

View file

@ -5327,7 +5327,7 @@ Optional<Selector::SimpleSelector::ANPlusBPattern> Parser::parse_a_n_plus_b_patt
auto& second_value = values.next_token();
if (is_signless_integer(second_value)) {
int a = first_value.token().dimension_value_int();
int b = -values.next_token().token().to_integer();
int b = -second_value.token().to_integer();
transaction.commit();
return Selector::SimpleSelector::ANPlusBPattern { a, b };
}