mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 23:39:02 +00:00
LibWeb: Remove StringBuilder from HTMLToken::m_comment_or_character
This commit is contained in:
parent
3aa202c432
commit
c3ad8e9a52
Notes:
sideshowbarker
2024-07-18 09:01:37 +09:00
Author: https://github.com/gunnarbeutner
Commit: c3ad8e9a52
Pull-request: https://github.com/SerenityOS/serenity/pull/8687
Reviewed-by: https://github.com/alimpfard
5 changed files with 54 additions and 46 deletions
|
@ -317,7 +317,7 @@ void HTMLDocumentParser::handle_initial(HTMLToken& token)
|
|||
}
|
||||
|
||||
if (token.is_comment()) {
|
||||
auto comment = adopt_ref(*new DOM::Comment(document(), token.m_comment_or_character.data.to_string()));
|
||||
auto comment = adopt_ref(*new DOM::Comment(document(), token.m_comment_or_character.data));
|
||||
document().append_child(move(comment));
|
||||
return;
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ void HTMLDocumentParser::handle_before_html(HTMLToken& token)
|
|||
}
|
||||
|
||||
if (token.is_comment()) {
|
||||
auto comment = adopt_ref(*new DOM::Comment(document(), token.m_comment_or_character.data.to_string()));
|
||||
auto comment = adopt_ref(*new DOM::Comment(document(), token.m_comment_or_character.data));
|
||||
document().append_child(move(comment));
|
||||
return;
|
||||
}
|
||||
|
@ -520,7 +520,7 @@ AnythingElse:
|
|||
|
||||
void HTMLDocumentParser::insert_comment(HTMLToken& token)
|
||||
{
|
||||
auto data = token.m_comment_or_character.data.to_string();
|
||||
auto data = token.m_comment_or_character.data;
|
||||
auto adjusted_insertion_location = find_appropriate_place_for_inserting_node();
|
||||
adjusted_insertion_location.parent->insert_before(adopt_ref(*new DOM::Comment(document(), data)), adjusted_insertion_location.insert_before_sibling);
|
||||
}
|
||||
|
@ -832,7 +832,7 @@ void HTMLDocumentParser::handle_after_body(HTMLToken& token)
|
|||
}
|
||||
|
||||
if (token.is_comment()) {
|
||||
auto data = token.m_comment_or_character.data.to_string();
|
||||
auto data = token.m_comment_or_character.data;
|
||||
auto& insertion_location = m_stack_of_open_elements.first();
|
||||
insertion_location.append_child(adopt_ref(*new DOM::Comment(document(), data)));
|
||||
return;
|
||||
|
@ -870,7 +870,7 @@ void HTMLDocumentParser::handle_after_body(HTMLToken& token)
|
|||
void HTMLDocumentParser::handle_after_after_body(HTMLToken& token)
|
||||
{
|
||||
if (token.is_comment()) {
|
||||
auto comment = adopt_ref(*new DOM::Comment(document(), token.m_comment_or_character.data.to_string()));
|
||||
auto comment = adopt_ref(*new DOM::Comment(document(), token.m_comment_or_character.data));
|
||||
document().append_child(move(comment));
|
||||
return;
|
||||
}
|
||||
|
@ -2751,7 +2751,7 @@ void HTMLDocumentParser::handle_after_frameset(HTMLToken& token)
|
|||
void HTMLDocumentParser::handle_after_after_frameset(HTMLToken& token)
|
||||
{
|
||||
if (token.is_comment()) {
|
||||
auto comment = adopt_ref(*new DOM::Comment(document(), token.m_comment_or_character.data.to_string()));
|
||||
auto comment = adopt_ref(*new DOM::Comment(document(), token.m_comment_or_character.data));
|
||||
document().append_child(move(comment));
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue