Quellcode durchsuchen

LibWeb: Remove DeprecatedString support from {Child,Parent}Node

No interface pulls this in that requires DeprecatedString support.
Shannon Booth vor 1 Jahr
Ursprung
Commit
57d7637b59

+ 0 - 15
Userland/Libraries/LibWeb/DOM/ChildNode.h

@@ -113,21 +113,6 @@ public:
         node->remove();
     }
 
-    WebIDL::ExceptionOr<void> before(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes)
-    {
-        return before(from_deprecated_nodes(nodes));
-    }
-
-    WebIDL::ExceptionOr<void> after(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes)
-    {
-        return after(from_deprecated_nodes(nodes));
-    }
-
-    WebIDL::ExceptionOr<void> replace_with(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes)
-    {
-        return replace_with(from_deprecated_nodes(nodes));
-    }
-
 protected:
     ChildNode() = default;
 

+ 0 - 16
Userland/Libraries/LibWeb/DOM/NodeOperations.cpp

@@ -42,20 +42,4 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Node>> convert_nodes_to_single_node(Vector<
     return document_fragment;
 }
 
-Vector<Variant<JS::Handle<Node>, String>> from_deprecated_nodes(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& deprecated_nodes)
-{
-    Vector<Variant<JS::Handle<Node>, String>> nodes;
-    nodes.ensure_capacity(deprecated_nodes.size());
-    for (auto const& deprecated_node : deprecated_nodes) {
-        deprecated_node.visit(
-            [&nodes](JS::Handle<Node> node) {
-                nodes.unchecked_append(node);
-            },
-            [&nodes](DeprecatedString const& deprecated_node) {
-                nodes.unchecked_append(MUST(String::from_deprecated_string(deprecated_node)));
-            });
-    }
-    return nodes;
-}
-
 }

+ 0 - 2
Userland/Libraries/LibWeb/DOM/NodeOperations.h

@@ -15,6 +15,4 @@ namespace Web::DOM {
 
 WebIDL::ExceptionOr<JS::NonnullGCPtr<Node>> convert_nodes_to_single_node(Vector<Variant<JS::Handle<Node>, String>> const& nodes, DOM::Document& document);
 
-Vector<Variant<JS::Handle<Node>, String>> from_deprecated_nodes(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& deprecated_nodes);
-
 }

+ 0 - 15
Userland/Libraries/LibWeb/DOM/ParentNode.cpp

@@ -213,21 +213,6 @@ WebIDL::ExceptionOr<void> ParentNode::prepend(Vector<Variant<JS::Handle<Node>, S
     return {};
 }
 
-WebIDL::ExceptionOr<void> ParentNode::prepend(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes)
-{
-    return prepend(from_deprecated_nodes(nodes));
-}
-
-WebIDL::ExceptionOr<void> ParentNode::append(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes)
-{
-    return append(from_deprecated_nodes(nodes));
-}
-
-WebIDL::ExceptionOr<void> ParentNode::replace_children(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes)
-{
-    return replace_children(from_deprecated_nodes(nodes));
-}
-
 WebIDL::ExceptionOr<void> ParentNode::append(Vector<Variant<JS::Handle<Node>, String>> const& nodes)
 {
     // 1. Let node be the result of converting nodes into a node given nodes and this’s node document.

+ 0 - 4
Userland/Libraries/LibWeb/DOM/ParentNode.h

@@ -38,10 +38,6 @@ public:
     WebIDL::ExceptionOr<void> append(Vector<Variant<JS::Handle<Node>, String>> const& nodes);
     WebIDL::ExceptionOr<void> replace_children(Vector<Variant<JS::Handle<Node>, String>> const& nodes);
 
-    WebIDL::ExceptionOr<void> prepend(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes);
-    WebIDL::ExceptionOr<void> append(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes);
-    WebIDL::ExceptionOr<void> replace_children(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes);
-
 protected:
     ParentNode(JS::Realm& realm, Document& document, NodeType type)
         : Node(realm, document, type)