replaceChild method
Implementation
@override
@mustCallSuper
Node? replaceChild(Node newNode, Node oldNode) {
// Update renderStyle tree.
if (newNode is Element) {
newNode.renderStyle.parent = renderStyle;
}
if (oldNode is Element) {
oldNode.renderStyle.parent = null;
}
return super.replaceChild(newNode, oldNode);
}