Bug 58921 - [chromium] linux chromium doesn't set click count for mouse up events in WebInputEventFactory.cpp.
Summary: [chromium] linux chromium doesn't set click count for mouse up events in WebI...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-19 13:11 PDT by yzshen
Modified: 2011-04-20 15:33 PDT (History)
3 users (show)

See Also:


Attachments
Set click count for mouse up events, using similar algorithm as win implementation. (7.45 KB, patch)
2011-04-19 14:05 PDT, yzshen
no flags Details | Formatted Diff | Diff
Revise the ChangeLog (7.62 KB, patch)
2011-04-19 14:42 PDT, yzshen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description yzshen 2011-04-19 13:11:30 PDT
WebKit/chromium/src/gtk/WebInputEventFactory.cpp doesn't set clickCount for mouse up events.

We probably want to have similar behavior as the win implementation.
Comment 1 yzshen 2011-04-19 13:12:00 PDT
I will upload a patch soon.
Comment 2 yzshen 2011-04-19 14:05:20 PDT
Created attachment 90248 [details]
Set click count for mouse up events, using similar algorithm as win implementation.
Comment 3 yzshen 2011-04-19 14:26:23 PDT
The reason why we need such a fix is that the Pepper API passes this information to plugins, and some consumers (e.g., Flash) need it to detect double-clicks.
Comment 4 Tony Chang 2011-04-19 14:33:58 PDT
Comment on attachment 90248 [details]
Set click count for mouse up events, using similar algorithm as win implementation.

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

> Source/WebKit/chromium/ChangeLog:6
> +        [chromium] linux chromium doesn't set click count for mouse up events.
> +        https://bugs.webkit.org/show_bug.cgi?id=58921

Please explain what this is breaking (ppapi, flash, whatever).

> Source/WebKit/chromium/src/gtk/WebInputEventFactory.cpp:492
> +    if (shouldForgetPreviousClick(event->window, event->time, event->x, event->y))
> +        resetClickCountState();

Why do we need to reset here?
Comment 5 yzshen 2011-04-19 14:42:52 PDT
Created attachment 90256 [details]
Revise the ChangeLog
Comment 6 yzshen 2011-04-19 14:44:08 PDT
Comment on attachment 90248 [details]
Set click count for mouse up events, using similar algorithm as win implementation.

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

>> Source/WebKit/chromium/ChangeLog:6
>> +        https://bugs.webkit.org/show_bug.cgi?id=58921
> 
> Please explain what this is breaking (ppapi, flash, whatever).

Done.

>> Source/WebKit/chromium/src/gtk/WebInputEventFactory.cpp:492
>> +        resetClickCountState();
> 
> Why do we need to reset here?

I am not sure whether this is very reasonable, but I tried to follow the behavior of the win implementation.
Comment 7 Tony Chang 2011-04-19 14:55:28 PDT
Comment on attachment 90256 [details]
Revise the ChangeLog

I think this patch is correct, but it would be nice to add a layout test for this.  The benefit of a layout test is that it would ensure that we get consistent results across platforms.  Specifically, you can use window.eventSender.leapForward and mouseDown/Up to simulate mouse events.  You might need to add eventSender.clickCount() for this.  This could be a follow up patch.
Comment 8 Tony Chang 2011-04-19 14:57:30 PDT
(+avi since I think he touched this code a bunch in the past)
Comment 9 yzshen 2011-04-19 15:00:06 PDT
Hi, Tony.

Thanks for your review!
I will work on a layout test in a follow up patch.

Do you mean I should wait for avi's feedback before committing the patch?
Comment 10 Tony Chang 2011-04-19 15:01:33 PDT
(In reply to comment #9)
> Do you mean I should wait for avi's feedback before committing the patch?

I think it's fine to commit now.  We can revert if avi has additional feedback.

Please make sure the layout tests pass before committing.

Thanks!
Comment 11 Avi Drissman 2011-04-19 16:05:29 PDT
(In reply to comment #9)
> Do you mean I should wait for avi's feedback before committing the patch?

The change looks good to me.
Comment 12 yzshen 2011-04-20 12:30:58 PDT
Hi, Tony.

Would you please help to get this patch committed? Thanks!
Comment 13 WebKit Commit Bot 2011-04-20 15:33:02 PDT
Comment on attachment 90256 [details]
Revise the ChangeLog

Clearing flags on attachment: 90256

Committed r84427: <http://trac.webkit.org/changeset/84427>
Comment 14 WebKit Commit Bot 2011-04-20 15:33:08 PDT
All reviewed patches have been landed.  Closing bug.