mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 19:45:07 +00:00
LibWeb: Remove StringBuilders from HTMLToken::m_doctype
This commit is contained in:
parent
2150609590
commit
992964aa7d
5 changed files with 60 additions and 45 deletions
|
@ -262,11 +262,11 @@ DOM::QuirksMode HTMLDocumentParser::which_quirks_mode(const HTMLToken& doctype_t
|
|||
return DOM::QuirksMode::Yes;
|
||||
|
||||
// NOTE: The tokenizer puts the name into lower case for us.
|
||||
if (doctype_token.m_doctype.name.to_string() != "html")
|
||||
if (doctype_token.m_doctype.name != "html")
|
||||
return DOM::QuirksMode::Yes;
|
||||
|
||||
auto public_identifier = doctype_token.m_doctype.public_identifier.to_string();
|
||||
auto system_identifier = doctype_token.m_doctype.system_identifier.to_string();
|
||||
auto const& public_identifier = doctype_token.m_doctype.public_identifier;
|
||||
auto const& system_identifier = doctype_token.m_doctype.system_identifier;
|
||||
|
||||
if (public_identifier.equals_ignoring_case("-//W3O//DTD W3 HTML Strict 3.0//EN//"))
|
||||
return DOM::QuirksMode::Yes;
|
||||
|
@ -324,9 +324,9 @@ void HTMLDocumentParser::handle_initial(HTMLToken& token)
|
|||
|
||||
if (token.is_doctype()) {
|
||||
auto doctype = adopt_ref(*new DOM::DocumentType(document()));
|
||||
doctype->set_name(token.m_doctype.name.to_string());
|
||||
doctype->set_public_id(token.m_doctype.public_identifier.to_string());
|
||||
doctype->set_system_id(token.m_doctype.system_identifier.to_string());
|
||||
doctype->set_name(token.m_doctype.name);
|
||||
doctype->set_public_id(token.m_doctype.public_identifier);
|
||||
doctype->set_system_id(token.m_doctype.system_identifier);
|
||||
document().append_child(move(doctype));
|
||||
document().set_quirks_mode(which_quirks_mode(token));
|
||||
m_insertion_mode = InsertionMode::BeforeHTML;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue