Lines Matching refs:newChild
82 def insertBefore(self, newChild, refChild):
83 if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
84 for c in tuple(newChild.childNodes):
87 return newChild
88 if newChild.nodeType not in self._child_node_types:
90 "%s cannot be child of %s" % (repr(newChild), repr(self)))
91 if newChild.parentNode is not None:
92 newChild.parentNode.removeChild(newChild)
94 self.appendChild(newChild)
100 if newChild.nodeType in _nodeTypes_with_children:
102 self.childNodes.insert(index, newChild)
103 newChild.nextSibling = refChild
104 refChild.previousSibling = newChild
107 node.nextSibling = newChild
108 newChild.previousSibling = node
110 newChild.previousSibling = None
111 newChild.parentNode = self
112 return newChild
131 def replaceChild(self, newChild, oldChild):
132 if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
135 return self.insertBefore(newChild, refChild)
136 if newChild.nodeType not in self._child_node_types:
138 "%s cannot be child of %s" % (repr(newChild), repr(self)))
139 if newChild is oldChild:
141 if newChild.parentNode is not None:
142 newChild.parentNode.removeChild(newChild)
147 self.childNodes[index] = newChild
148 newChild.parentNode = self
150 if (newChild.nodeType in _nodeTypes_with_children
153 newChild.nextSibling = oldChild.nextSibling
154 newChild.previousSibling = oldChild.previousSibling
157 if newChild.previousSibling:
158 newChild.previousSibling.nextSibling = newChild
159 if newChild.nextSibling:
160 newChild.nextSibling.previousSibling = newChild
975 def insertBefore(self, newChild, refChild):
987 def replaceChild(self, newChild, oldChild):
1392 def appendChild(self, newChild):
1396 def insertBefore(self, newChild, refChild):
1404 def replaceChild(self, newChild, oldChild):