Bug 57391

Summary: Introduce SimulatedClickEvent and move all simulated-click dispatch code there.
Product: WebKit Reporter: Dimitri Glazkov (Google) <dglazkov>
Component: New BugsAssignee: Dimitri Glazkov (Google) <dglazkov>
Status: RESOLVED INVALID    
Severity: Normal CC: darin, eric
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 55515    
Attachments:
Description Flags
Patch
none
Rebased to ToT and sorted xcodeproj. none

Dimitri Glazkov (Google)
Reported 2011-03-29 15:02:14 PDT
Introduce SimulatedClickEvent and move all simulated-click dispatch code there.
Attachments
Patch (28.84 KB, patch)
2011-03-29 15:10 PDT, Dimitri Glazkov (Google)
no flags
Rebased to ToT and sorted xcodeproj. (29.35 KB, patch)
2011-03-29 15:33 PDT, Dimitri Glazkov (Google)
no flags
Dimitri Glazkov (Google)
Comment 1 2011-03-29 15:10:26 PDT
Dimitri Glazkov (Google)
Comment 2 2011-03-29 15:33:09 PDT
Created attachment 87418 [details] Rebased to ToT and sorted xcodeproj.
Darin Adler
Comment 3 2011-03-29 15:43:28 PDT
Comment on attachment 87415 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=87415&action=review > Source/WebCore/ChangeLog:8 > + The SimulatedClickEvent, instead of dispatching self, fires one or more SimulatedMouseEvents. I don’t understand why a simulated click, which is a sequence of events, now needs to be a kind of event. Can’t we simulate clicks by sending a sequence of events? Why do we need to trigger that with yet another event?
Dimitri Glazkov (Google)
Comment 4 2011-03-29 15:51:11 PDT
(In reply to comment #3) > (From update of attachment 87415 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=87415&action=review > > > Source/WebCore/ChangeLog:8 > > + The SimulatedClickEvent, instead of dispatching self, fires one or more SimulatedMouseEvents. > > I don’t understand why a simulated click, which is a sequence of events, now needs to be a kind of event. Can’t we simulate clicks by sending a sequence of events? Why do we need to trigger that with yet another event? The fact that it fires multiple events is a detail that isn't exposed anywhere from the call site of Node::dispatchSimulatedClick, just like dispatchMouseEvent may fire an extra dblclick event. Wrapping this into an Event seems consistent with how any other event would be dispatched: dispatchEvent(FooEvent::create(...)). Also, it wraps the logic neatly into its own class.
Dimitri Glazkov (Google)
Comment 5 2011-03-29 15:55:26 PDT
(In reply to comment #4) > (In reply to comment #3) > > (From update of attachment 87415 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=87415&action=review > > > > > Source/WebCore/ChangeLog:8 > > > + The SimulatedClickEvent, instead of dispatching self, fires one or more SimulatedMouseEvents. > > > > I don’t understand why a simulated click, which is a sequence of events, now needs to be a kind of event. Can’t we simulate clicks by sending a sequence of events? Why do we need to trigger that with yet another event? > > The fact that it fires multiple events is a detail that isn't exposed anywhere from the call site of Node::dispatchSimulatedClick, just like dispatchMouseEvent may fire an extra dblclick event. > > Wrapping this into an Event seems consistent with how any other event would be dispatched: dispatchEvent(FooEvent::create(...)). > > Also, it wraps the logic neatly into its own class. I can also just have SimulatedMouseEvent (possibly put it the MouseEvent files), then leave EventDispatcher::dispatchSimulatedClick using them.
Darin Adler
Comment 6 2011-03-29 16:00:55 PDT
(In reply to comment #4) > The fact that it fires multiple events is a detail that isn't exposed anywhere from the call site of Node::dispatchSimulatedClick, just like dispatchMouseEvent may fire an extra dblclick event. Sure, we can encapsulate that into a function. > Wrapping this into an Event seems consistent with how any other event would be dispatched: dispatchEvent(FooEvent::create(...)). This seems to be the sole benefit, and I’m not sure it’s better. > Also, it wraps the logic neatly into its own class. You could do that without having the class be derived from Event.
Darin Adler
Comment 7 2011-03-29 16:01:13 PDT
(In reply to comment #5) > I can also just have SimulatedMouseEvent (possibly put it the MouseEvent files), then leave EventDispatcher::dispatchSimulatedClick using them. I’d prefer that.
Dimitri Glazkov (Google)
Comment 8 2011-03-29 16:05:48 PDT
(In reply to comment #7) > (In reply to comment #5) > > I can also just have SimulatedMouseEvent (possibly put it the MouseEvent files), then leave EventDispatcher::dispatchSimulatedClick using them. > > I’d prefer that. ok, patch coming up.
Note You need to log in before you can comment on or make changes to this bug.