RESOLVED FIXED122500
Simplify the loop in EventRetargeter::calculateEventPath
https://bugs.webkit.org/show_bug.cgi?id=122500
Summary Simplify the loop in EventRetargeter::calculateEventPath
Ryosuke Niwa
Reported 2013-10-08 02:00:59 PDT
The loop in EventRetargeter::calculateEventPath is better expressed as two nested loops along the line of: for (Node* node = nodeOrHostIfPseudoElement(targetNode); node; node = toShadowRoot(node)->hostElement()) { if (!target || !isSVGElement) target = &eventTargetRespectingTargetRules(*node); for (; node; node = node->parentNode()) { ... if (!inDocument) return; if (node->isShadowRoot()) break; } if (!shouldEventCrossShadowBoundary(event, toShadowRoot(node), targetStack.last())) return; } This codifies the semantics much more clearly.
Attachments
Cleanup (2.96 KB, patch)
2013-10-08 12:39 PDT, Ryosuke Niwa
koivisto: review+
Ryosuke Niwa
Comment 1 2013-10-08 12:39:09 PDT
Ryosuke Niwa
Comment 2 2013-10-08 12:43:05 PDT
Note You need to log in before you can comment on or make changes to this bug.