1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

LibWeb: Port Element::local_name and TagNames from Deprecated String

Which pretty much needs to be done together due to the amount of places
where they are compared together.

This also involves porting over StackOfOpenElements over to FlyString
from DeprecatedFly string to prevent a gazillion calls to
`.to_deprecated_fly_string` calls in HTMLParser.
This commit is contained in:
Shannon Booth 2023-10-01 20:07:44 +13:00 committed by Sam Atkins
parent bbfe0d3a82
commit 9303e9e76f
30 changed files with 163 additions and 158 deletions

View file

@ -9,6 +9,7 @@
#include <AK/DeprecatedFlyString.h>
#include <AK/DeprecatedString.h>
#include <AK/FlyString.h>
#include <AK/Function.h>
#include <AK/OwnPtr.h>
#include <AK/Types.h>
@ -145,10 +146,10 @@ public:
m_string_data = move(comment);
}
DeprecatedFlyString const& tag_name() const
FlyString tag_name() const
{
VERIFY(is_start_tag() || is_end_tag());
return m_string_data;
return MUST(FlyString::from_deprecated_fly_string(m_string_data));
}
void set_tag_name(DeprecatedString name)
@ -275,7 +276,7 @@ public:
void adjust_tag_name(DeprecatedFlyString const& old_name, DeprecatedFlyString const& new_name)
{
VERIFY(is_start_tag() || is_end_tag());
if (old_name == tag_name())
if (old_name == tag_name().to_deprecated_fly_string())
set_tag_name(new_name);
}