Bug 142762

Summary: Generalize the Document code that maintains a set of nodes with event handlers
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: New BugsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch zalan: review+

Description Simon Fraser (smfr) 2015-03-16 18:57:17 PDT
Generalize the Document code that maintains a set of nodes with event handlers
Comment 1 Simon Fraser (smfr) 2015-03-16 19:05:21 PDT
Created attachment 248779 [details]
Patch
Comment 2 Simon Fraser (smfr) 2015-03-16 19:40:29 PDT
Created attachment 248783 [details]
Patch
Comment 3 Darin Adler 2015-03-16 20:21:39 PDT
Comment on attachment 248783 [details]
Patch

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

> Source/WebCore/testing/Internals.cpp:1216
> -    const TouchEventTargetSet* touchHandlers = document->touchEventTargets();
> +    const EventTargetSet* touchHandlers = document->touchEventTargets();

I think auto is better for things like this.

> Source/WebCore/testing/Internals.cpp:1222
> -    for (TouchEventTargetSet::const_iterator iter = touchHandlers->begin(); iter != touchHandlers->end(); ++iter)
> +    for (EventTargetSet::const_iterator iter = touchHandlers->begin(); iter != touchHandlers->end(); ++iter)
>          count += iter->value;

This should be a modern for loop:

    for (auto& handler : *touchHandlers)
        count += handler.value;
Comment 4 Simon Fraser (smfr) 2015-03-16 21:45:00 PDT
https://trac.webkit.org/r181615