Bug 17335 - Calling event.preventDefault() in contextmenu handler disables other mouse event handlers.
Summary: Calling event.preventDefault() in contextmenu handler disables other mouse ev...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 17978 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-12 17:20 PST by Khoo Yit Phang
Modified: 2010-06-30 22:10 PDT (History)
2 users (show)

See Also:


Attachments
Testcase demonstrating contextmenu misbehavior. (1.29 KB, application/xhtml+xml)
2008-02-12 17:22 PST, Khoo Yit Phang
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Khoo Yit Phang 2008-02-12 17:20:43 PST
If I have a contextmenu event handler and call preventDefault() to disable the standard context menu:

document.addEventListener("contextmenu", function(evt) {
    evt.preventDefault();
    println("contextmenu");
}, true);

all other mouse event handlers seem to be incorrectly disabled (or at least, no events are fired), until the next click.

This misbehavior occurs in the nightlies (tested 30070+).

It works correctly (events keep firing) in Safari 3, as well as Camino and Firefox.
Comment 1 Khoo Yit Phang 2008-02-12 17:22:16 PST
Created attachment 19100 [details]
Testcase demonstrating contextmenu misbehavior.
Comment 2 Måns Gustafsson 2008-03-28 07:39:01 PDT
*** Bug 17978 has been marked as a duplicate of this bug. ***
Comment 3 Tom Brown 2008-05-30 09:17:17 PDT
This is occurs under Safari 3.1.

Also, I found that if the oncontextmenu event happens in an IFRAME, the problem does not occur.