Why "target !== null" if above "target = /**@type{!Node}*/(getTarget(e))"? Either nullable or not :)
This typing hack deserves at least some comment, before somebody accidently removes the "target !== null" check, because it seems it is not needed by just this code.