mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:17:46 +00:00
LibWeb: Add CSS::Tokenizer::start_of_input_stream_[twin|triplet]()
These correspond to "If the input stream starts with..." in the spec, which up until now we were not handling correctly, which led to some fun bugs. As noted, reconsuming the input code point in order to read its value is hacky, but works. Keeping track of the current code point in Tokenizer would be nicer, when I'm feeling brave enough to mess with it!
This commit is contained in:
parent
8600d89407
commit
981badb45f
2 changed files with 27 additions and 0 deletions
|
@ -79,6 +79,9 @@ private:
|
|||
[[nodiscard]] U32Twin peek_twin() const;
|
||||
[[nodiscard]] U32Triplet peek_triplet() const;
|
||||
|
||||
[[nodiscard]] U32Twin start_of_input_stream_twin();
|
||||
[[nodiscard]] U32Triplet start_of_input_stream_triplet();
|
||||
|
||||
[[nodiscard]] static Token create_new_token(Token::Type);
|
||||
[[nodiscard]] static Token create_value_token(Token::Type, String value);
|
||||
[[nodiscard]] static Token create_value_token(Token::Type, u32 value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue