mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibWeb: Teach more of HTMLTokenizer to stop at the insertion point
In particular, input character lookahead now knows how to stop at the insertion point marker if needed. This makes it possible to do amazing things like having document.write() insert doctypes one character at a time.
This commit is contained in:
committed by
Andreas Kling
parent
82b540e501
commit
5c70436cb2
Notes:
github-actions[bot]
2024-11-24 10:46:43 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/5c70436cb2f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2545
@@ -153,9 +153,16 @@ public:
|
||||
|
||||
private:
|
||||
void skip(size_t count);
|
||||
Optional<u32> next_code_point();
|
||||
Optional<u32> peek_code_point(size_t offset) const;
|
||||
bool consume_next_if_match(StringView, CaseSensitivity = CaseSensitivity::CaseSensitive);
|
||||
Optional<u32> next_code_point(StopAtInsertionPoint);
|
||||
Optional<u32> peek_code_point(size_t offset, StopAtInsertionPoint) const;
|
||||
|
||||
enum class ConsumeNextResult {
|
||||
Consumed,
|
||||
NotConsumed,
|
||||
RanOutOfCharacters,
|
||||
};
|
||||
[[nodiscard]] ConsumeNextResult consume_next_if_match(StringView, StopAtInsertionPoint, CaseSensitivity = CaseSensitivity::CaseSensitive);
|
||||
|
||||
void create_new_token(HTMLToken::Type);
|
||||
bool current_end_tag_token_is_appropriate() const;
|
||||
String consume_current_builder();
|
||||
|
||||
Reference in New Issue
Block a user