File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -951,6 +951,14 @@ def testNormalizeRecursion(self):
951951 doc .unlink ()
952952
953953
954+ def testBug0777884 (self ):
955+ doc = parseString ("<o>text</o>" )
956+ text = doc .documentElement .childNodes [0 ]
957+ self .assertEquals (text .nodeType , Node .TEXT_NODE )
958+ # Should run quietly, doing nothing.
959+ text .normalize ()
960+ doc .unlink ()
961+
954962 def testBug1433694 (self ):
955963 doc = parseString ("<o><i/>t</o>" )
956964 node = doc .documentElement
Original file line number Diff line number Diff line change @@ -920,6 +920,10 @@ def removeChild(self, oldChild):
920920 raise xml .dom .NotFoundErr (
921921 self .nodeName + " nodes do not have children" )
922922
923+ def normalize (self ):
924+ # For childless nodes, normalize() has nothing to do.
925+ pass
926+
923927 def replaceChild (self , newChild , oldChild ):
924928 raise xml .dom .HierarchyRequestErr (
925929 self .nodeName + " nodes do not have children" )
You can’t perform that action at this time.
0 commit comments