(nodeImpl)
| 1043 | |
| 1044 | // https://dom.spec.whatwg.org/#concept-node-replace-all |
| 1045 | _replaceAll(nodeImpl) { |
| 1046 | if (nodeImpl !== null) { |
| 1047 | this._ownerDocument._adoptNode(nodeImpl); |
| 1048 | } |
| 1049 | |
| 1050 | const removedNodesImpl = domSymbolTree.childrenToArray(this); |
| 1051 | |
| 1052 | let addedNodesImpl; |
| 1053 | if (nodeImpl === null) { |
| 1054 | addedNodesImpl = []; |
| 1055 | } else if (nodeImpl.nodeType === NODE_TYPE.DOCUMENT_FRAGMENT_NODE) { |
| 1056 | addedNodesImpl = domSymbolTree.childrenToArray(nodeImpl); |
| 1057 | } else { |
| 1058 | addedNodesImpl = [nodeImpl]; |
| 1059 | } |
| 1060 | |
| 1061 | for (const childImpl of domSymbolTree.childrenIterator(this)) { |
| 1062 | this._remove(childImpl, true); |
| 1063 | } |
| 1064 | |
| 1065 | if (nodeImpl !== null) { |
| 1066 | this._insert(nodeImpl, null, true); |
| 1067 | } |
| 1068 | |
| 1069 | if (addedNodesImpl.length > 0 || removedNodesImpl.length > 0) { |
| 1070 | queueTreeMutationRecord(this, addedNodesImpl, removedNodesImpl, null, null); |
| 1071 | } |
| 1072 | } |
| 1073 | |
| 1074 | // https://dom.spec.whatwg.org/#concept-node-pre-remove |
| 1075 | _preRemove(childImpl) { |
no test coverage detected