Bug 122494 - Use references in EventRetargeter::calculateEventPath and EventRetargeter::eventTargetRespectingTargetRules
Summary: Use references in EventRetargeter::calculateEventPath and EventRetargeter::ev...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 122500
  Show dependency treegraph
 
Reported: 2013-10-08 00:04 PDT by Ryosuke Niwa
Modified: 2013-10-08 11:02 PDT (History)
10 users (show)

See Also:


Attachments
Cleanup (10.40 KB, patch)
2013-10-08 00:07 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Fixed EFL build (10.45 KB, patch)
2013-10-08 00:19 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-10-08 00:04:02 PDT
Use references in EventRetargeter::calculateEventPath and EventRetargeter::eventTargetRespectingTargetRules
Comment 1 Ryosuke Niwa 2013-10-08 00:07:27 PDT
Created attachment 213665 [details]
Cleanup
Comment 2 EFL EWS Bot 2013-10-08 00:12:04 PDT
Comment on attachment 213665 [details]
Cleanup

Attachment 213665 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/3746045
Comment 3 EFL EWS Bot 2013-10-08 00:13:29 PDT
Comment on attachment 213665 [details]
Cleanup

Attachment 213665 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/3735038
Comment 4 Ryosuke Niwa 2013-10-08 00:19:20 PDT
Created attachment 213669 [details]
Fixed EFL build
Comment 5 Antti Koivisto 2013-10-08 05:35:18 PDT
Comment on attachment 213669 [details]
Fixed EFL build

View in context: https://bugs.webkit.org/attachment.cgi?id=213669&action=review

> Source/WebCore/dom/EventRetargeter.cpp:89
> +    EventTarget* target = 0;
>  
> -    for (Node* node = nodeOrHostIfPseudoElement(targetNode); node; node = node->parentOrShadowHostNode()) {
> -        if (targetStack.isEmpty())
> -            targetStack.append(eventTargetRespectingTargetRules(node));
> +    for (Node* node = nodeOrHostIfPseudoElement(&targetNode); node; node = node->parentOrShadowHostNode()) {
> +        if (!target)
> +            target = &eventTargetRespectingTargetRules(*node);
> +

You could make target a reference too by moving the initialisation out of the loop.

> Source/WebCore/dom/EventRetargeter.h:73
> +inline EventTarget& EventRetargeter::eventTargetRespectingTargetRules(Node& referenceNode)
>  {

This could probably be moved out of line.
Comment 6 Ryosuke Niwa 2013-10-08 10:36:19 PDT
Comment on attachment 213669 [details]
Fixed EFL build

View in context: https://bugs.webkit.org/attachment.cgi?id=213669&action=review

>> Source/WebCore/dom/EventRetargeter.cpp:89
>> +
> 
> You could make target a reference too by moving the initialisation out of the loop.

We can't. target is overridden in some iterations; namely when the last node was a non-SVG shadow root.

>> Source/WebCore/dom/EventRetargeter.h:73
>>  {
> 
> This could probably be moved out of line.

Let me do that in a separate patch.
Comment 7 Ryosuke Niwa 2013-10-08 10:36:53 PDT
Comment on attachment 213669 [details]
Fixed EFL build

Landing as is for now.
Comment 8 WebKit Commit Bot 2013-10-08 11:02:02 PDT
Comment on attachment 213669 [details]
Fixed EFL build

Clearing flags on attachment: 213669

Committed r157123: <http://trac.webkit.org/changeset/157123>
Comment 9 WebKit Commit Bot 2013-10-08 11:02:06 PDT
All reviewed patches have been landed.  Closing bug.