See bug 198578. If we find a way to do this, The code would make ContainerNode::replaceChildren() more simpler.