mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
Paul Prescod <paul@prescod.net>:
Correct the chaining between siblings.
This commit is contained in:
parent
eca576c68b
commit
13a3069c2b
1 changed files with 7 additions and 0 deletions
|
@ -102,6 +102,13 @@ class Node:
|
||||||
newChild.parentNode = self
|
newChild.parentNode = self
|
||||||
|
|
||||||
def appendChild(self, node):
|
def appendChild(self, node):
|
||||||
|
if self.childNodes:
|
||||||
|
last = self.lastChild
|
||||||
|
node.previousSibling = last
|
||||||
|
last.nextSibling = node
|
||||||
|
else:
|
||||||
|
node.previousSibling = None
|
||||||
|
node.nextSibling = None
|
||||||
self.childNodes.append(node)
|
self.childNodes.append(node)
|
||||||
return node
|
return node
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue