mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:17:34 +00:00
LibWeb: Add String versions for some functions in ParentNode
These functions are required in the porting of the DocumentFragment interface from DeprecatedString to String. Unfortunately since ParentNode is used by Document, we can't fully remove the deprecated versions of these functions yet.
This commit is contained in:
parent
3e0849eb4f
commit
bfc0773285
5 changed files with 49 additions and 10 deletions
|
@ -31,7 +31,7 @@ public:
|
|||
auto viable_previous_sibling = viable_previous_sibling_for_insertion(nodes);
|
||||
|
||||
// 4. Let node be the result of converting nodes into a node, given nodes and this’s node document.
|
||||
auto node_to_insert = TRY(convert_nodes_to_single_node(nodes, node->document()));
|
||||
auto node_to_insert = TRY(convert_nodes_to_single_node(from_deprecated_nodes(nodes), node->document()));
|
||||
|
||||
// 5. If viablePreviousSibling is null, then set it to parent’s first child; otherwise to viablePreviousSibling’s next sibling.
|
||||
if (!viable_previous_sibling)
|
||||
|
@ -61,7 +61,7 @@ public:
|
|||
auto viable_next_sibling = viable_nest_sibling_for_insertion(nodes);
|
||||
|
||||
// 4. Let node be the result of converting nodes into a node, given nodes and this’s node document.
|
||||
auto node_to_insert = TRY(convert_nodes_to_single_node(nodes, node->document()));
|
||||
auto node_to_insert = TRY(convert_nodes_to_single_node(from_deprecated_nodes(nodes), node->document()));
|
||||
|
||||
// 5. Pre-insert node into parent before viableNextSibling.
|
||||
(void)TRY(parent->pre_insert(node_to_insert, viable_next_sibling));
|
||||
|
@ -85,7 +85,7 @@ public:
|
|||
auto viable_next_sibling = viable_nest_sibling_for_insertion(nodes);
|
||||
|
||||
// 4. Let node be the result of converting nodes into a node, given nodes and this’s node document.
|
||||
auto node_to_insert = TRY(convert_nodes_to_single_node(nodes, node->document()));
|
||||
auto node_to_insert = TRY(convert_nodes_to_single_node(from_deprecated_nodes(nodes), node->document()));
|
||||
|
||||
// 5. If this’s parent is parent, replace this with node within parent.
|
||||
// Note: This could have been inserted into node.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue