mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:57:44 +00:00
LibWeb: Distinguish between integer and float in NumericStyleValue
We have this information when parsing, and some properties specifically only allow integers, so it makes sense to keep that around.
This commit is contained in:
parent
450b782c18
commit
78e57096e2
7 changed files with 55 additions and 30 deletions
|
@ -105,7 +105,7 @@ public:
|
|||
VERIFY(m_type == Type::Number);
|
||||
return m_value.string_view();
|
||||
}
|
||||
int to_integer() const
|
||||
i64 to_integer() const
|
||||
{
|
||||
VERIFY(m_type == Type::Number && m_number_type == NumberType::Integer);
|
||||
return number_string_value().to_int().value();
|
||||
|
@ -122,7 +122,7 @@ public:
|
|||
VERIFY(m_type == Type::Dimension);
|
||||
return m_value.string_view();
|
||||
}
|
||||
int dimension_value_int() const { return dimension_value().to_int().value(); }
|
||||
i64 dimension_value_int() const { return dimension_value().to_int().value(); }
|
||||
|
||||
NumberType number_type() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue