Inserts a list of nodes at the given position, unwrapping the ancestors one level at a time, until we can validly insertNodes the root nodes.
This is useful for importing things in a situation where at least the text nodes should be retained, but an outer level may already exist. Note: this primitive will insert until only textNodes / comments / PIs are left, possibly removing more than you'd want.
Example, when given the following DOM: And the following nodes: O A A A '-- Insert here / \ | / \ B B '..' B '..' | | '..' '..'
An import will attempt the following insert:
O / | \ / | \ / | \ A A A / \ | | \ B B '..' B '..' | | '..' '..'
Assuming this will fail, the following will be attempted:
O / | \ / | \ / | \ / \ | | \ B B '..' B '..' | | '..' '..'
After that, the following (last possible configuration of nodes):
O / | \ /\ \ \ / | \ \ '..' '..' '..' '..'
Refer to primitives for more information on how to include this primitive.
The result of the primitive