1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 00:55:06 +00:00

LibWeb: Implement aborting the HTML parser

This is roughly on-spec, although I had to invent a simple "aborted"
state for the tokenizer.
This commit is contained in:
Andreas Kling 2022-09-20 21:08:14 +02:00
parent 37ed1b28fa
commit ab8432783e
4 changed files with 33 additions and 0 deletions

View file

@ -143,6 +143,9 @@ public:
m_insertion_point.position = m_utf8_view.iterator_offset(m_utf8_iterator);
}
// This permanently cuts off the tokenizer input stream.
void abort() { m_aborted = true; }
private:
void skip(size_t count);
Optional<u32> next_code_point();
@ -207,6 +210,8 @@ private:
bool m_blocked { false };
bool m_aborted { false };
Vector<HTMLToken::Position> m_source_positions;
};