LibWeb/CSS: Separate IntegerSV and NumberSV from CSSUnitValue

This inheritance exists for typed-om classes, but StyleValues aren't
typed-om.

Somehow this makes our z-index interpolation slightly more correct. 🎉
This commit is contained in:
Sam Atkins 2025-08-08 10:55:30 +01:00 committed by Tim Ledbetter
commit 7157d19f56
Notes: github-actions[bot] 2025-08-08 14:20:36 +00:00
10 changed files with 23 additions and 25 deletions

View file

@ -5,6 +5,7 @@
*/
#include "IntegerStyleValue.h"
#include <LibWeb/CSS/Parser/ComponentValue.h>
namespace Web::CSS {
@ -15,7 +16,7 @@ String IntegerStyleValue::to_string(SerializationMode) const
Vector<Parser::ComponentValue> IntegerStyleValue::tokenize() const
{
return { Parser::Token::create_number(Number { Number::Type::Integer, value() }) };
return { Parser::Token::create_number(Number { Number::Type::Integer, static_cast<double>(m_value) }) };
}
}