diff --git a/Userland/Libraries/LibWeb/DOM/Comment.cpp b/Userland/Libraries/LibWeb/DOM/Comment.cpp index 4bb02c55ec..1cbe7fefeb 100644 --- a/Userland/Libraries/LibWeb/DOM/Comment.cpp +++ b/Userland/Libraries/LibWeb/DOM/Comment.cpp @@ -11,13 +11,13 @@ namespace Web::DOM { -Comment::Comment(Document& document, DeprecatedString const& data) - : CharacterData(document, NodeType::COMMENT_NODE, data) +Comment::Comment(Document& document, String const& data) + : CharacterData(document, NodeType::COMMENT_NODE, data.to_deprecated_string()) { } // https://dom.spec.whatwg.org/#dom-comment-comment -WebIDL::ExceptionOr> Comment::construct_impl(JS::Realm& realm, DeprecatedString const& data) +WebIDL::ExceptionOr> Comment::construct_impl(JS::Realm& realm, String const& data) { auto& window = verify_cast(realm.global_object()); return realm.heap().allocate(realm, window.associated_document(), data); diff --git a/Userland/Libraries/LibWeb/DOM/Comment.h b/Userland/Libraries/LibWeb/DOM/Comment.h index cc2dd74370..f654d157f7 100644 --- a/Userland/Libraries/LibWeb/DOM/Comment.h +++ b/Userland/Libraries/LibWeb/DOM/Comment.h @@ -15,13 +15,13 @@ class Comment final : public CharacterData { WEB_PLATFORM_OBJECT(Comment, CharacterData); public: - static WebIDL::ExceptionOr> construct_impl(JS::Realm&, DeprecatedString const& data); + static WebIDL::ExceptionOr> construct_impl(JS::Realm&, String const& data); virtual ~Comment() override = default; virtual DeprecatedFlyString node_name() const override { return "#comment"; } private: - Comment(Document&, DeprecatedString const&); + Comment(Document&, String const&); virtual void initialize(JS::Realm&) override; }; diff --git a/Userland/Libraries/LibWeb/DOM/Comment.idl b/Userland/Libraries/LibWeb/DOM/Comment.idl index 39349af25b..bb3728dbf3 100644 --- a/Userland/Libraries/LibWeb/DOM/Comment.idl +++ b/Userland/Libraries/LibWeb/DOM/Comment.idl @@ -1,7 +1,7 @@ #import // https://dom.spec.whatwg.org/#comment -[Exposed=Window, UseDeprecatedAKString] +[Exposed=Window] interface Comment : CharacterData { constructor(optional DOMString data = ""); }; diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 5303309a3d..8f2e905074 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -1427,7 +1427,7 @@ JS::NonnullGCPtr Document::create_text_node(DeprecatedString const& data) JS::NonnullGCPtr Document::create_comment(DeprecatedString const& data) { - return heap().allocate(realm(), *this, data); + return heap().allocate(realm(), *this, MUST(String::from_deprecated_string(data))); } // https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index 4cd4895e7e..f7e7ee5720 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -812,7 +812,7 @@ JS::NonnullGCPtr Node::clone_node(Document* document, bool clone_children) auto comment = verify_cast(this); // Set copy’s data to that of node. - auto comment_copy = heap().allocate(realm(), *document, comment->data()); + auto comment_copy = heap().allocate(realm(), *document, MUST(String::from_deprecated_string(comment->data()))); copy = move(comment_copy); } else if (is(this)) { // ProcessingInstruction diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index c60e55a907..d451f2804f 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -490,7 +490,7 @@ void HTMLParser::handle_initial(HTMLToken& token) } if (token.is_comment()) { - auto comment = realm().heap().allocate(realm(), document(), token.comment()); + auto comment = realm().heap().allocate(realm(), document(), MUST(String::from_deprecated_string(token.comment()))); MUST(document().append_child(*comment)); return; } @@ -525,7 +525,7 @@ void HTMLParser::handle_before_html(HTMLToken& token) // -> A comment token if (token.is_comment()) { // Insert a comment as the last child of the Document object. - auto comment = realm().heap().allocate(realm(), document(), token.comment()); + auto comment = realm().heap().allocate(realm(), document(), MUST(String::from_deprecated_string(token.comment()))); MUST(document().append_child(*comment)); return; } @@ -822,7 +822,7 @@ AnythingElse: void HTMLParser::insert_comment(HTMLToken& token) { auto adjusted_insertion_location = find_appropriate_place_for_inserting_node(); - adjusted_insertion_location.parent->insert_before(realm().heap().allocate(realm(), document(), token.comment()), adjusted_insertion_location.insert_before_sibling); + adjusted_insertion_location.parent->insert_before(realm().heap().allocate(realm(), document(), MUST(String::from_deprecated_string(token.comment()))), adjusted_insertion_location.insert_before_sibling); } void HTMLParser::handle_in_head(HTMLToken& token) @@ -1142,7 +1142,7 @@ void HTMLParser::handle_after_body(HTMLToken& token) if (token.is_comment()) { auto& insertion_location = m_stack_of_open_elements.first(); - MUST(insertion_location.append_child(realm().heap().allocate(realm(), document(), token.comment()))); + MUST(insertion_location.append_child(realm().heap().allocate(realm(), document(), MUST(String::from_deprecated_string(token.comment()))))); return; } @@ -1178,7 +1178,7 @@ void HTMLParser::handle_after_body(HTMLToken& token) void HTMLParser::handle_after_after_body(HTMLToken& token) { if (token.is_comment()) { - auto comment = realm().heap().allocate(realm(), document(), token.comment()); + auto comment = realm().heap().allocate(realm(), document(), MUST(String::from_deprecated_string(token.comment()))); MUST(document().append_child(*comment)); return; } @@ -3407,7 +3407,7 @@ void HTMLParser::handle_after_frameset(HTMLToken& token) void HTMLParser::handle_after_after_frameset(HTMLToken& token) { if (token.is_comment()) { - auto comment = document().heap().allocate(document().realm(), document(), token.comment()); + auto comment = document().heap().allocate(document().realm(), document(), MUST(String::from_deprecated_string(token.comment()))); MUST(document().append_child(comment)); return; }