Bug 6595 - Right-click does not fire mouseup event
Summary: Right-click does not fire mouseup event
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar, PlatformOnly
Depends on:
Blocks:
 
Reported: 2006-01-16 11:51 PST by Beau Hartshorne
Modified: 2008-08-27 17:50 PDT (History)
8 users (show)

See Also:


Attachments
clickReduction.html (1.16 KB, text/html)
2006-01-16 11:53 PST, Beau Hartshorne
no flags Details
patch to fix (9.44 KB, patch)
2008-06-29 04:10 PDT, Robert Kroeger
no flags Details | Formatted Diff | Diff
Change log for patch (3.00 KB, patch)
2008-06-29 04:11 PDT, Robert Kroeger
no flags Details | Formatted Diff | Diff
single unified patch: change log update, code changes, test file. (12.20 KB, patch)
2008-06-30 16:45 PDT, Robert Kroeger
eric: review-
Details | Formatted Diff | Diff
updated patch (6.07 KB, patch)
2008-08-27 16:06 PDT, Sam Weinig
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beau Hartshorne 2006-01-16 11:51:54 PST
Firefox Mac, PC, and Win IE will fire a click, dblclick, mousedown, and mouseup event handlers on a 
control- or right-click. Safari does not. Safari will fire on a contextmenu event though. I suggest Safari 
adopts the Firefox Mac behavior. I suggest Safari also set the button parameter of the event object on 
right clicks as well.
Comment 1 Beau Hartshorne 2006-01-16 11:53:48 PST
Created attachment 5723 [details]
clickReduction.html

Note that the only event fired in Safari on a control- or right-click is
'contextmenu'.
Comment 2 Joost de Valk (AlthA) 2006-01-16 11:56:42 PST
Confirmed, very nice testcase.
Comment 3 Mark Rowe (bdash) 2006-01-16 12:18:58 PST
Testing in Camino and Firefox shows that they show slightly different behaviour.  On a right-click, both 
fire the oncontextmenu event.  Camino never fires the mousedown event, and will sometimes fire the 
mouseup.  Firefox always fires the mousedown and mouseup.  Neither browser fires the click event for a 
right-click, contrary to what the original report describes.

[Tested using Firefox 1.5 and Camino 1.0b1+].
Comment 4 Beau Hartshorne 2006-01-16 12:22:39 PST
Correction: Win IE will fire mousedown and mouseup on a right click (but nothing else), and Win Firefox 
will fire mousedown, mouseup, and click (but nothing else) on a right click.
Comment 5 Beau Hartshorne 2006-01-16 12:24:03 PST
Further correction: 

Correction: Win IE will fire contextmenu, mousedown and mouseup on a right click (but nothing else), and 
Win Firefox will fire contextmenu, mousedown, mouseup, and click (but nothing else) on a right click.

(In reply to comment #4)

> Correction: Win IE will fire mousedown and mouseup on a right click (but nothing else), and Win Firefox 
> will fire mousedown, mouseup, and click (but nothing else) on a right click.

Comment 6 Mark Rowe (bdash) 2006-01-16 12:28:15 PST
I don't think it makes sense to fire the click event on a right-click.  I think Safari should match the 
behaviour of WinIE and Firefox on OS X -- a right-click should trigger a mousedown, contextmenu, and 
mouseup.
Comment 7 Sjoerd Mulder 2006-02-03 00:28:50 PST
This bug is also in Radar: <rdar://4432150>
Comment 8 Mark Rowe (bdash) 2008-06-20 20:49:22 PDT
Retitling bug.  When using ctrl-click, the mouseup does appear to be dispatched, along with an extraneous click event.
Comment 9 Robert Kroeger 2008-06-29 04:10:32 PDT
Created attachment 21994 [details]
patch to fix
Comment 10 Robert Kroeger 2008-06-29 04:11:01 PDT
Created attachment 21995 [details]
Change log for patch
Comment 11 Mark Rowe (bdash) 2008-06-29 04:18:54 PDT
Robert, can you please include the ChangeLog entries as part of the patch?
Comment 12 Robert Kroeger 2008-06-30 16:45:12 PDT
Created attachment 22011 [details]
single unified patch: change log update, code changes, test file.
Comment 13 Eric Seidel (no email) 2008-07-04 11:26:11 PDT
Comment on attachment 22011 [details]
single unified patch: change log update, code changes, test file.

I already landed similar functionality in eventSender as part of another patch.  I don't care a whole lot which approach we take, but my additional changes will make this patch invalid.  So marking r-.
Comment 14 Eric Seidel (no email) 2008-07-06 09:52:03 PDT
http://trac.webkit.org/changeset/34871 is the patch I was referring to in my above comments.
Comment 15 Sam Weinig 2008-08-27 16:06:33 PDT
Created attachment 23044 [details]
updated patch
Comment 16 Eric Seidel (no email) 2008-08-27 16:11:02 PDT
Comment on attachment 23044 [details]
updated patch

Looks sane enough.
Comment 17 Sam Weinig 2008-08-27 17:50:36 PDT
Landed in r35956.