mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 17:28:48 +00:00
LibWeb: Use an Optional<String> to track the last HTML start tag
Using an HTMLToken object here is unnecessary because the only attribute we're interested in is the tag_name.
This commit is contained in:
parent
d92548c5b0
commit
d9e52997e2
Notes:
sideshowbarker
2024-07-18 09:01:54 +09:00
Author: https://github.com/gunnarbeutner
Commit: d9e52997e2
Pull-request: https://github.com/SerenityOS/serenity/pull/8687
Reviewed-by: https://github.com/alimpfard
2 changed files with 4 additions and 4 deletions
|
@ -2649,16 +2649,16 @@ void HTMLTokenizer::switch_to(Badge<HTMLDocumentParser>, State new_state)
|
|||
void HTMLTokenizer::will_emit(HTMLToken& token)
|
||||
{
|
||||
if (token.is_start_tag())
|
||||
m_last_emitted_start_tag = token;
|
||||
m_last_emitted_start_tag_name = token.tag_name();
|
||||
token.m_end_position = nth_last_position(0);
|
||||
}
|
||||
|
||||
bool HTMLTokenizer::current_end_tag_token_is_appropriate() const
|
||||
{
|
||||
VERIFY(m_current_token.is_end_tag());
|
||||
if (!m_last_emitted_start_tag.is_start_tag())
|
||||
if (!m_last_emitted_start_tag_name.has_value())
|
||||
return false;
|
||||
return m_current_token.tag_name() == m_last_emitted_start_tag.tag_name();
|
||||
return m_current_token.tag_name() == m_last_emitted_start_tag_name.value();
|
||||
}
|
||||
|
||||
bool HTMLTokenizer::consumed_as_part_of_an_attribute() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue