Bug 6595

Summary: Right-click does not fire mouseup event
Product: WebKit Reporter: Beau Hartshorne <beau>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: alice.barraclough, ap, ian, mietek, mjuhos, mrowe, rjkroege, sjoerdmulder
Priority: P2 Keywords: InRadar, PlatformOnly
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
clickReduction.html
none
patch to fix
none
Change log for patch
none
single unified patch: change log update, code changes, test file.
eric: review-
updated patch eric: review+

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.