Closed Bug 230281 Opened 21 years ago Closed 19 years ago

Contextmenu blocking doesn't work. Right Click always opens the standard Context menu.

Categories

(Core :: DOM: Core & HTML, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: traumwandler, Assigned: jst)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.0.1) Gecko/20030306 Camino/0.7
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.0.1) Gecko/20030306 Camino/0.7

IE and Mozilla support Context menu blocking with javascript. Camino does
handles this wrong 

Reproducible: Always

Steps to Reproduce:

Actual Results:  
Context menu appears next to special menu.

Expected Results:  
Hidden the Context Menu and placed the specialized menu correctly.
we're told to display the context menu from gecko. is this a regression in the
embedding layer? does it still work in winEmbed? Adam?
This works in latest Mozilla builds on MacOS X (2004011305), but in Camino I get
both the JavaScript context menu and Camino's normal context menu. Dupe search
shows no similar bugs anywhere, so confirming. Will investigate a bit further.

Mike, how would I set about telling if this is a regression in "WinEmbed"?
Status: UNCONFIRMED → NEW
Ever confirmed: true
winEmbed doesn't display popup menus, but mfcEmbed does. 

I can reproduce the behaviour there.

I can't reproduce it if I load up some chrome, e.g.
chrome://navigator/content/navigator.xul, load "www.mozilla.org" into that and
right mouse on the content area.
go to a windows machine and run winEmbed :)
adam, so that says to me it's a bug in the embedding layer, right?
Or in the DOM.

I know I haven't touched the embedding layer since July. The place which adds
the listener is here:

http://lxr.mozilla.org/seamonkey/source/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp#864

The actual contextMenu event handler impl is here:

http://lxr.mozilla.org/seamonkey/source/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp#1541

The code does call nsIDOMEvent::preventDefault() so perhaps that has broken, or
maybe it should be calling nsIDOMEvent::stopPropogation() too. It would be worth
CC'ing some of the DOM folks.
I bumbed into this a couple of weeks back as well. preventDefault did not seem
to do anything, but return false prevented the context menu from appearing (in
the context menu or click handler function).
So we're going to change the product to Mozilla right?
over to browser
Assignee: pinkerton → general
Component: General → DOM
Product: Camino → Browser
QA Contact: ian
Version: unspecified → Trunk
So what code in Mozilla handles opening the context menu? Is it the
http://lxr.mozilla.org/seamonkey/source/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
code?  Or not?

The embedding code is never checking whether the event has been consumed;
perhaps that's the issue?
Something like this then maybe? Someone care to test this?
Attachment #141006 - Flags: review?(adamlock)
Comment on attachment 141006 [details] [diff] [review]
Untested shot in the dark

isDefaultPrevented should probably be initialised to PR_TRUE but makes sense
otherwise, should probably be tested in mfcembed though.

r=adamlock
Attachment #141006 - Flags: review?(adamlock) → review+
Alexandre, do you happen to have a build you could give that patch a spin in?
I tested this in mfcEmbed.

This patch is fine.
Just misses:

#include "nsIDOMNSUIEvent.h"
Comment on attachment 141006 [details] [diff] [review]
Untested shot in the dark

sr=bzbarsky, with Adam's comment.
Attachment #141006 - Flags: superreview+
Assignee: general → jst
Actually, PR_FALSE is a better default... Checked in with that and the header
include.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: