Bug 122500

Summary: Simplify the loop in EventRetargeter::calculateEventPath
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: UI EventsAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, esprehn+autocc, kangil.han, kling, koivisto, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 122494    
Bug Blocks:    
Attachments:
Description Flags
Cleanup koivisto: review+

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.