summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/Parser/Token.h
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Parser/Token.h')
-rw-r--r--Userland/Libraries/LibWeb/CSS/Parser/Token.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Token.h b/Userland/Libraries/LibWeb/CSS/Parser/Token.h
index 430b2033cf..4337f22d1b 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/Token.h
+++ b/Userland/Libraries/LibWeb/CSS/Parser/Token.h
@@ -159,6 +159,22 @@ public:
return token;
}
+ static Token create_number(float value)
+ {
+ Token token;
+ token.m_type = Type::Number;
+ token.m_number_value = Number(Number::Type::Number, value);
+ return token;
+ }
+
+ static Token create_percentage(float value)
+ {
+ Token token;
+ token.m_type = Type::Percentage;
+ token.m_number_value = Number(Number::Type::Number, value);
+ return token;
+ }
+
private:
Type m_type { Type::Invalid };