[Bug 23863]: [Shadow] Fix event retargeting algorithms.