LibWeb: Port HTMLParser local name and value from DeprecatedString

This commit is contained in:
Shannon Booth 2023-10-08 12:19:41 +13:00 committed by Tim Flynn
parent e4f8c59210
commit d8635fe541
Notes: sideshowbarker 2024-07-17 11:30:54 +09:00
3 changed files with 85 additions and 86 deletions

View file

@ -1108,31 +1108,31 @@ _StartOfFunction:
ON_WHITESPACE
{
m_current_token.last_attribute().name_end_position = nth_last_position(1);
m_current_token.last_attribute().local_name = consume_current_builder();
m_current_token.last_attribute().local_name = MUST(FlyString::from_deprecated_fly_string(consume_current_builder()));
RECONSUME_IN(AfterAttributeName);
}
ON('/')
{
m_current_token.last_attribute().name_end_position = nth_last_position(1);
m_current_token.last_attribute().local_name = consume_current_builder();
m_current_token.last_attribute().local_name = MUST(FlyString::from_deprecated_fly_string(consume_current_builder()));
RECONSUME_IN(AfterAttributeName);
}
ON('>')
{
m_current_token.last_attribute().name_end_position = nth_last_position(1);
m_current_token.last_attribute().local_name = consume_current_builder();
m_current_token.last_attribute().local_name = MUST(FlyString::from_deprecated_fly_string(consume_current_builder()));
RECONSUME_IN(AfterAttributeName);
}
ON_EOF
{
m_current_token.last_attribute().name_end_position = nth_last_position(1);
m_current_token.last_attribute().local_name = consume_current_builder();
m_current_token.last_attribute().local_name = MUST(FlyString::from_deprecated_fly_string(consume_current_builder()));
RECONSUME_IN(AfterAttributeName);
}
ON('=')
{
m_current_token.last_attribute().name_end_position = nth_last_position(1);
m_current_token.last_attribute().local_name = consume_current_builder();
m_current_token.last_attribute().local_name = MUST(FlyString::from_deprecated_fly_string(consume_current_builder()));
SWITCH_TO(BeforeAttributeValue);
}
ON_ASCII_UPPER_ALPHA
@ -1238,7 +1238,7 @@ _StartOfFunction:
{
ON('"')
{
m_current_token.last_attribute().value = consume_current_builder();
m_current_token.last_attribute().value = MUST(String::from_deprecated_string(consume_current_builder()));
SWITCH_TO(AfterAttributeValueQuoted);
}
ON('&')
@ -1270,7 +1270,7 @@ _StartOfFunction:
{
ON('\'')
{
m_current_token.last_attribute().value = consume_current_builder();
m_current_token.last_attribute().value = MUST(String::from_deprecated_string(consume_current_builder()));
SWITCH_TO(AfterAttributeValueQuoted);
}
ON('&')
@ -1302,7 +1302,7 @@ _StartOfFunction:
{
ON_WHITESPACE
{
m_current_token.last_attribute().value = consume_current_builder();
m_current_token.last_attribute().value = MUST(String::from_deprecated_string(consume_current_builder()));
m_current_token.last_attribute().value_end_position = nth_last_position(1);
SWITCH_TO(BeforeAttributeName);
}
@ -1313,7 +1313,7 @@ _StartOfFunction:
}
ON('>')
{
m_current_token.last_attribute().value = consume_current_builder();
m_current_token.last_attribute().value = MUST(String::from_deprecated_string(consume_current_builder()));
m_current_token.last_attribute().value_end_position = nth_last_position(1);
SWITCH_TO_AND_EMIT_CURRENT_TOKEN(Data);
}