mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Fix greedy CSS Tokenizer whitespace parsing
Whitespace parsing was too greedy, consuming the first non- whitespace character after it.
This commit is contained in:
parent
06fc099310
commit
9115c23bd5
Notes:
sideshowbarker
2024-07-18 09:14:45 +09:00
Author: https://github.com/AtkinsSJ
Commit: 9115c23bd5
Pull-request: https://github.com/SerenityOS/serenity/pull/8341
1 changed files with 4 additions and 1 deletions
|
@ -725,8 +725,11 @@ Token Tokenizer::consume_a_token()
|
|||
if (is_whitespace(input)) {
|
||||
dbgln_if(CSS_TOKENIZER_TRACE, "is whitespace");
|
||||
|
||||
while (is_whitespace(peek_code_point().value()))
|
||||
auto next = peek_code_point();
|
||||
while (next.has_value() && is_whitespace(next.value())) {
|
||||
(void)next_code_point();
|
||||
next = peek_code_point();
|
||||
}
|
||||
|
||||
return create_new_token(Token::TokenType::Whitespace);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue