1
Fork 0
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:
Hendiadyoin1 2022-03-13 17:34:08 +01:00 committed by Andreas Kling
parent 6119783027
commit 3f8347718c
2 changed files with 51 additions and 50 deletions

View file

@ -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