mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
LibWeb: Convert numeric tokens to numbers in CSS Tokenizer
The spec wants us to produce numeric values as the Tokenizer sees them, rather than waiting until the parse stage. This is a first step towards that.
This commit is contained in:
parent
d2ef8b29e8
commit
f6869797a7
3 changed files with 90 additions and 5 deletions
|
@ -59,7 +59,8 @@ public:
|
|||
|
||||
class CSSNumber {
|
||||
public:
|
||||
String value;
|
||||
String string;
|
||||
double value { 0 };
|
||||
Token::NumberType type {};
|
||||
};
|
||||
|
||||
|
@ -86,6 +87,7 @@ private:
|
|||
[[nodiscard]] Token consume_a_numeric_token();
|
||||
[[nodiscard]] Token consume_an_ident_like_token();
|
||||
[[nodiscard]] CSSNumber consume_a_number();
|
||||
[[nodiscard]] double convert_a_string_to_a_number(StringView);
|
||||
[[nodiscard]] String consume_a_name();
|
||||
[[nodiscard]] u32 consume_escaped_code_point();
|
||||
[[nodiscard]] Token consume_a_url_token();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue