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

No interface pulls this in that requires DeprecatedString support.
This commit is contained in:
Shannon Booth 2023-10-06 07:53:36 +13:00 committed by Andreas Kling
parent d818bbf918
commit 57d7637b59
5 changed files with 0 additions and 52 deletions

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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);
}

View file

@ -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 thiss node document.

View file

@ -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)