LibWeb: Implement enough HTML parsing to handle a small simple DOM :^)

We can now parse a little DOM like this:

<!DOCTYPE html>
<html>
    <head></head>
    <body>
        <div></div>
    </body>
</html>

This is pretty slow work, but the incremental progress is satisfying!
This commit is contained in:
Andreas Kling 2020-05-24 00:49:22 +02:00
parent fd1b31d0ff
commit e44c87cfff
Notes: sideshowbarker 2024-07-19 06:12:00 +09:00
5 changed files with 110 additions and 6 deletions

View file

@ -74,6 +74,9 @@
#define ANYTHING_ELSE if (1)
#define EMIT_EOF \
if (m_has_emitted_eof) \
return {}; \
m_has_emitted_eof = true; \
create_new_token(HTMLToken::Type::EndOfFile); \
return m_current_token;
@ -775,7 +778,7 @@ void HTMLTokenizer::will_reconsume_in([[maybe_unused]] State new_state)
void HTMLTokenizer::flush_current_character_or_comment_if_needed()
{
//if (m_current_token.type() == HTMLToken::Type::Character || m_current_token.type() == HTMLToken::Type::Comment)
// emit_current_token();
// emit_current_token();
}
}