diff --git a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp index 2c9525c3bb..366c4e99cd 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp @@ -100,7 +100,7 @@ JS::NonnullGCPtr DOMImplementation::create_html_document(Optional(realm(), html_document); - doctype->set_name("html"); + doctype->set_name("html"_string); MUST(html_document->append_child(*doctype)); // 4. Append the result of creating an element given doc, html, and the HTML namespace, to doc. @@ -141,9 +141,9 @@ WebIDL::ExceptionOr> DOMImplementation::create_do // 2. Return a new doctype, with qualifiedName as its name, publicId as its public ID, and systemId as its system ID, and with its node document set to the associated document of this. auto document_type = DocumentType::create(document()); - document_type->set_name(qualified_name.to_deprecated_string()); - document_type->set_public_id(public_id.to_deprecated_string()); - document_type->set_system_id(system_id.to_deprecated_string()); + document_type->set_name(qualified_name); + document_type->set_public_id(public_id); + document_type->set_system_id(system_id); return document_type; } diff --git a/Userland/Libraries/LibWeb/DOM/DocumentType.h b/Userland/Libraries/LibWeb/DOM/DocumentType.h index d16464d69e..236ddadcb6 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentType.h +++ b/Userland/Libraries/LibWeb/DOM/DocumentType.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include @@ -24,23 +25,23 @@ public: virtual DeprecatedFlyString node_name() const override { return "#doctype"; } - DeprecatedString const& name() const { return m_name; } - void set_name(DeprecatedString const& name) { m_name = name; } + String const& name() const { return m_name; } + void set_name(String const& name) { m_name = name; } - DeprecatedString const& public_id() const { return m_public_id; } - void set_public_id(DeprecatedString const& public_id) { m_public_id = public_id; } + String const& public_id() const { return m_public_id; } + void set_public_id(String const& public_id) { m_public_id = public_id; } - DeprecatedString const& system_id() const { return m_system_id; } - void set_system_id(DeprecatedString const& system_id) { m_system_id = system_id; } + String const& system_id() const { return m_system_id; } + void set_system_id(String const& system_id) { m_system_id = system_id; } private: explicit DocumentType(Document&); virtual void initialize(JS::Realm&) override; - DeprecatedString m_name; - DeprecatedString m_public_id; - DeprecatedString m_system_id; + String m_name; + String m_public_id; + String m_system_id; }; template<> diff --git a/Userland/Libraries/LibWeb/DOM/DocumentType.idl b/Userland/Libraries/LibWeb/DOM/DocumentType.idl index 7834d9d49d..c23690f20c 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentType.idl +++ b/Userland/Libraries/LibWeb/DOM/DocumentType.idl @@ -2,7 +2,7 @@ #import // https://dom.spec.whatwg.org/#documenttype -[Exposed=Window] +[Exposed=Window, UseNewAKString] interface DocumentType : Node { readonly attribute DOMString name; readonly attribute DOMString publicId; diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index 09145b7b61..80dfb1d7bc 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -497,9 +497,9 @@ void HTMLParser::handle_initial(HTMLToken& token) if (token.is_doctype()) { auto doctype = realm().heap().allocate(realm(), document()); - doctype->set_name(token.doctype_data().name); - doctype->set_public_id(token.doctype_data().public_identifier); - doctype->set_system_id(token.doctype_data().system_identifier); + doctype->set_name(String::from_deprecated_string(token.doctype_data().name).release_value()); + doctype->set_public_id(String::from_deprecated_string(token.doctype_data().public_identifier).release_value()); + doctype->set_system_id(String::from_deprecated_string(token.doctype_data().system_identifier).release_value()); MUST(document().append_child(*doctype)); document().set_quirks_mode(which_quirks_mode(token)); m_insertion_mode = InsertionMode::BeforeHTML;