mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:47:35 +00:00
LibWeb: Use a u32 for a delim tokens value
The spec says: > <delim-token> has a value composed of a single code point. So using StringView is a bit overkill. This also allows us to use switch statements in the future.
This commit is contained in:
parent
6119783027
commit
3f8347718c
2 changed files with 51 additions and 50 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <math.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
@ -76,10 +77,10 @@ public:
|
|||
return m_value.view();
|
||||
}
|
||||
|
||||
StringView delim() const
|
||||
u32 delim() const
|
||||
{
|
||||
VERIFY(m_type == Type::Delim);
|
||||
return m_value.view();
|
||||
return *Utf8View(m_value.view()).begin();
|
||||
}
|
||||
|
||||
StringView string() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue