1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 10:34:58 +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

@ -2845,7 +2845,7 @@ void HTMLTokenizer::switch_to(Badge<HTMLParser>, State new_state)
void HTMLTokenizer::will_emit(HTMLToken& token)
{
if (token.is_start_tag())
m_last_emitted_start_tag_name = token.tag_name();
m_last_emitted_start_tag_name = token.tag_name().to_deprecated_fly_string();
auto is_start_or_end_tag = token.type() == HTMLToken::Type::StartTag || token.type() == HTMLToken::Type::EndTag;
token.set_end_position({}, nth_last_position(is_start_or_end_tag ? 1 : 0));
@ -2856,7 +2856,7 @@ bool HTMLTokenizer::current_end_tag_token_is_appropriate() const
VERIFY(m_current_token.is_end_tag());
if (!m_last_emitted_start_tag_name.has_value())
return false;
return m_current_token.tag_name() == m_last_emitted_start_tag_name.value();
return m_current_token.tag_name().to_deprecated_fly_string() == m_last_emitted_start_tag_name.value();
}
bool HTMLTokenizer::consumed_as_part_of_an_attribute() const