internalCloneWithOwnerDocument method
Implementation
@visibleForTesting
@override
Element internalCloneWithOwnerDocument(Document ownerDocument, bool deep) {
// Create a new instance of the same class
final clone = _newInstance(ownerDocument);
// Clone attributes
clone._firstAttribute = _firstAttribute?.cloneChain();
// Clone style
clone._style = _style?._clone();
// Clone children
if (deep != false) {
Node._cloneChildrenFrom(ownerDocument, newParent: clone, oldParent: this);
}
return clone;
}