mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-15 23:01:52 +00:00
LibWeb: Port HTMLParser local name and value from DeprecatedString
This commit is contained in:
parent
e4f8c59210
commit
d8635fe541
Notes:
sideshowbarker
2024-07-17 11:30:54 +09:00
Author: https://github.com/shannonbooth
Commit: d8635fe541
Pull-request: https://github.com/SerenityOS/serenity/pull/21376
3 changed files with 85 additions and 86 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue