• Home
  • Raw
  • Download

Lines Matching refs:newChild

81     def insertBefore(self, newChild, refChild):  argument
82 if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
83 for c in tuple(newChild.childNodes):
86 return newChild
87 if newChild.nodeType not in self._child_node_types:
89 "%s cannot be child of %s" % (repr(newChild), repr(self)))
90 if newChild.parentNode is not None:
91 newChild.parentNode.removeChild(newChild)
93 self.appendChild(newChild)
99 if newChild.nodeType in _nodeTypes_with_children:
101 self.childNodes.insert(index, newChild)
102 newChild.nextSibling = refChild
103 refChild.previousSibling = newChild
106 node.nextSibling = newChild
107 newChild.previousSibling = node
109 newChild.previousSibling = None
110 newChild.parentNode = self
111 return newChild
130 def replaceChild(self, newChild, oldChild): argument
131 if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
134 return self.insertBefore(newChild, refChild)
135 if newChild.nodeType not in self._child_node_types:
137 "%s cannot be child of %s" % (repr(newChild), repr(self)))
138 if newChild is oldChild:
140 if newChild.parentNode is not None:
141 newChild.parentNode.removeChild(newChild)
146 self.childNodes[index] = newChild
147 newChild.parentNode = self
149 if (newChild.nodeType in _nodeTypes_with_children
152 newChild.nextSibling = oldChild.nextSibling
153 newChild.previousSibling = oldChild.previousSibling
156 if newChild.previousSibling:
157 newChild.previousSibling.nextSibling = newChild
158 if newChild.nextSibling:
159 newChild.nextSibling.previousSibling = newChild
948 def insertBefore(self, newChild, refChild): argument
960 def replaceChild(self, newChild, oldChild): argument
1365 def appendChild(self, newChild): argument
1369 def insertBefore(self, newChild, refChild): argument
1377 def replaceChild(self, newChild, oldChild): argument