LibWeb: Remember when HTML parser should ignore next line feed character

There's a quirk in HTML where the parser should ignore any line feed
character immediately following a `pre` or `textarea` start tag.

This was working fine when we could peek ahead in the input stream and
see the next token, but didn't work in character-at-a-time parsing with
document.write().

This commit adds the "can ignore next line feed character" as a parser
flag that is maintained across invocations, making it work in this
parsing mode as well.

20 new passes in WPT/html/syntax/parsing/ :^)
This commit is contained in:
Andreas Kling 2025-02-19 16:54:28 +01:00 committed by Andreas Kling
parent 611833429a
commit 550613e526
Notes: github-actions[bot] 2025-02-20 13:33:19 +00:00
11 changed files with 51 additions and 61 deletions

View file

@ -187,6 +187,8 @@ private:
HTMLTokenizer m_tokenizer;
bool m_next_line_feed_can_be_ignored { false };
bool m_foster_parenting { false };
bool m_frameset_ok { true };
bool m_parsing_fragment { false };