mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 17:28:48 +00: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:
parent
82b540e501
commit
5c70436cb2
Notes:
github-actions[bot]
2024-11-24 10:46:43 +00:00
Author: https://github.com/awesomekling
Commit: 5c70436cb2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2545
6 changed files with 87 additions and 32 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue