#NEWLINE# def isOrHasChild( parent , child ) : #NEWLINE# #INDENT# while parent : #NEWLINE# #INDENT# if compare ( parent , child ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# child = child . parentNode #NEWLINE# if ( not child ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( child . nodeType != 1 ) : #NEWLINE# #INDENT# child = None #NEWLINE# #UNINDENT# #UNINDENT# return False