Bug 102468

Summary: Simulated events instances do not all have the same underlying event
Product: WebKit Reporter: Jon Lee <jonlee>
Component: UI EventsAssignee: Jon Lee <jonlee>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, ap, beidson, mitz, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.8   
Attachments:
Description Flags
Patch
none
Patch
none
Patch ap: review+, webkit.review.bot: commit-queue-

Jon Lee
Reported 2012-11-16 00:22:29 PST
I believe this is a bug in how simulated events are constructed. The PassRefPtr with the underlying event is included as an argument for the mouse down, up, and click events. But the PassRefPtr loses its underlying pointer after the first simulated mouse down event because it gets assigned to that event's private m_underlyingEvent variable. We therefore send NULL to the other events.
Attachments
Patch (3.04 KB, patch)
2012-11-16 01:16 PST, Jon Lee
no flags
Patch (4.32 KB, patch)
2012-11-16 09:49 PST, Jon Lee
no flags
Patch (4.58 KB, patch)
2012-11-16 12:02 PST, Jon Lee
ap: review+
webkit.review.bot: commit-queue-
Jon Lee
Comment 1 2012-11-16 00:58:30 PST
Jon Lee
Comment 2 2012-11-16 01:16:13 PST
mitz
Comment 3 2012-11-16 08:38:50 PST
Please follow the advice of <http://www.webkit.org/coding/RefPtr.html> and rename the function parameter prpUnderlyingEvent, and transfer to a RefPtr with the old name at the beginning of the function.
Brady Eidson
Comment 4 2012-11-16 08:58:32 PST
(In reply to comment #3) > Please follow the advice of <http://www.webkit.org/coding/RefPtr.html> and rename the function parameter prpUnderlyingEvent, and transfer to a RefPtr with the old name at the beginning of the function. Yay! Idioms!!!
Brady Eidson
Comment 5 2012-11-16 08:59:10 PST
Comment on attachment 174630 [details] Patch Yay idioms! (do the prp thing)
Alexey Proskuryakov
Comment 6 2012-11-16 09:45:21 PST
A better solution (and one you should use) would be to change the argument type form PassRefPtr to a plain pointer.
Brady Eidson
Comment 7 2012-11-16 09:47:22 PST
(In reply to comment #6) > A better solution (and one you should use) would be to change the argument type form PassRefPtr to a plain pointer. Great point - ownership (a reference) is not actually being passed in this case, and the arguments to the 3 callees are all plain ptrs.
Jon Lee
Comment 8 2012-11-16 09:49:12 PST
Alexey Proskuryakov
Comment 9 2012-11-16 10:06:08 PST
Comment on attachment 174711 [details] Patch Please do use plain pointers.
Jon Lee
Comment 10 2012-11-16 12:02:54 PST
Jon Lee
Comment 11 2012-11-16 13:42:17 PST
WebKit Review Bot
Comment 12 2012-11-16 13:42:20 PST
Comment on attachment 174736 [details] Patch Attachment 174736 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/14878003
Jon Lee
Comment 13 2012-11-17 22:10:16 PST
Chromium fix in r135000.
Note You need to log in before you can comment on or make changes to this bug.