Malte Helmert <[email protected]> added the comment:
I eyeballed the new patch and wonder if the case where text nodes are
collapsed is handled correctly. Assume that self.childNodes contains
nodes [A, B, C], where A and B are non-empty text nodes and C is a
non-text node.
The algorithm would collapse A and B into A and then unlink B, and I
think C.previousSibling would still reference the unlinked B, rather
than the correct A. Am I missing something?
If this is indeed a bug in the proposed patch, I suggest adding an
additional test for this case.
The bug itself should not be too hard to fix; the "elif" case would need
the same
if child.nextSibling:
child.nextSibling.previousSibling = child.previousSibling
assignment as the "if" case.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue2170>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com