Closed Bug 521086 Opened 15 years ago Closed 15 years ago

DOMMenuItemActive not sent for menu elements on OS X

Categories

(Core :: Widget: Cocoa, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 420033

People

(Reporter: john.b, Unassigned)

Details

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 On OS X only, the DOMMenuItemActive event is only sent for menuitem elements, not menu elements. On XP and Ubuntu/Linux, the event is sent for both types of items. According to the Events documentation (https://developer.mozilla.org/En/XUL/Events#Common_XUL_events), it should be sent for both menu and menuitem. Reproducible: Always Steps to Reproduce: 1. Add the following to an object created by an overlay in an extension: this.console = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService); this._windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator); this.mainWindow = this._windowMediator.getMostRecentWindow("navigator:browser"); var ffMenuBar = this.mainWindow.document.getElementById("main-menubar"); if (ffMenuBar && ffMenuBar.firstChild) { var nextMenu = ffMenuBar.firstChild; var current = this; while (nextMenu) { nextMenu.addEventListener("DOMMenuItemActive", function(event) { current.console.logStringMessage("Menu selected: " + event.target.label); }, false); nextMenu = nextMenu.nextSibling; } } 2. Load the extension. 3. Select the Firefox View menu 4. Arrow down through the Toolbars, Status Bar and Sidebars elements in the menu. 5. Check the console log. Actual Results: Menu selected: Status Bar Expected Results: Menu selected: View ---------- Menu selected: Toolbars ---------- Menu selected: Status Bar ---------- Menu selected: Sidebar
The "expected results" are what I see when I run this on XP or Ubuntu.
nsMenuX.mm specifically includes only menuitems, but it should send this for any menu type.
Component: DOM: Events → Widget: Cocoa
QA Contact: events → cocoa
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Er, maybe I was too hasty; maybe we want a separate bug for this, which sounds like the <menu/> problem mentioned in bug 420033 comment 10? > Josh, I am not yet entirely happy with my patch. For one, it does not yet > behave the same as non-native XUL menus. For example, we can't dispatch > DOMMenuItem(In)Active events when a <menu/> is highlighted. Also, it dispatches > events for <menuseparator/>s, which non-native menus don't.
You need to log in before you can comment on or make changes to this bug.