Closed Bug 578018 Opened 14 years ago Closed 14 years ago

Contextmenu is show even if preventDefault has been called

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: vingtetun, Assigned: vingtetun)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (obsolete) — Splinter Review
Some websites want to prevent showing a context menu for some elements and use the tricks to add a oncontextmenu="return false;" to do that.

Also if the preventDefault has been called by a chrome extension we should not show the context menu popup.
Attachment #456837 - Flags: review?(mark.finkle)
Attached patch Patch v0.2Splinter Review
This patch does the same as previous but also include a fix for the timeout to be slower because it was firing too fast because of the delay use to wait for the double click. (and other solution is potentially to fired a mouse cancel during the mouseup)
Attachment #456837 - Attachment is obsolete: true
Attachment #456844 - Flags: review?(mark.finkle)
Attachment #456837 - Flags: review?(mark.finkle)
Comment on attachment 456844 [details] [diff] [review]
Patch v0.2

>diff -r 4e38010bf28a chrome/content/content.js

>-        this._startContextTimeout(element);
>+        this._contextTimeout.once(700, function() {
>+          let event = content.document.createEvent("PopupEvents");
>+          event.initEvent("contextmenu", true, true);
>+          element.dispatchEvent(event);

Maybe we could use the preference for the timeout length. I think it is "ui.click_hold_context_menus.delay"
Attachment #456844 - Flags: review?(mark.finkle) → review+
http://hg.mozilla.org/mobile-browser/rev/364a7d0d3b25
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
verified FIXED based on a BFT run of FormFill Helper on build:

Mozilla/5.0 (X11; U; Linux armv71; Nokia N900; en-US; rv:2.0b2pre) Gecko/2010713 Namoroka/4.0b2pre Fennec/2.0a1pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: