mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibWeb: Implement IntegerStyleValue, for holding <integer>
Having one StyleValue for `<number>` and `<integer>` is making user code more complicated than it needs to be. We know based on the property being parsed, whether it wants a `<number>` or an `<integer>`, so we can use separate StyleValue types for these.
This commit is contained in:
parent
ad8565011c
commit
1160d8186b
10 changed files with 105 additions and 23 deletions
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "IntegerStyleValue.h"
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
ErrorOr<String> IntegerStyleValue::to_string() const
|
||||
{
|
||||
return String::number(m_value);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue