mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
LibWeb/CSS: Construct all CSS Tokens in a consistent way
Add `create_foo()` static methods for the missing Token::Types, and use them in the Tokenizer. This means we slightly deviate from the spec now: it says "create foo token... set its bar to 32", but we now just wait and construct the Token fully-formed. But those cases are short so it should still be clear what we're doing. This makes it possible to construct all kinds of Token elsewhere, such as for testing purposes.
This commit is contained in:
parent
57dd85e4ac
commit
d5bee680b0
Notes:
github-actions[bot]
2025-07-09 14:06:20 +00:00
Author: https://github.com/AtkinsSJ
Commit: d5bee680b0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5370
Reviewed-by: https://github.com/tcl3 ✅
4 changed files with 203 additions and 188 deletions
|
@ -79,9 +79,6 @@ private:
|
|||
[[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, FlyString&& value, String&& representation);
|
||||
[[nodiscard]] static Token create_value_token(Token::Type, u32 value, String&& representation);
|
||||
[[nodiscard]] Token consume_a_token();
|
||||
[[nodiscard]] Token consume_string_token(u32 ending_code_point);
|
||||
[[nodiscard]] Token consume_a_numeric_token();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue