Closed Bug 1704216 Opened 4 years ago Closed 4 years ago

Make menuitem.click() work with native context menus

Categories

(Core :: Widget: Cocoa, task)

All
macOS
task

Tracking

()

RESOLVED INVALID

People

(Reporter: mstange, Assigned: mstange)

References

Details

(Whiteboard: [proton-context-menus][mac:mr1])

Attachments

(1 obsolete file)

Some tests, such as toolkit/components/viewsource/test/browser/browser_contextmenu.js, open a context menu and then call menuitem.click() to activate the menu item and close the menu.

This is currently not supported by native menus but we can make it work pretty easily.

I made a bad assumption here.

With non-native menus, calling menuitem.click() only executes the command but does not close the menu. That's because nsMenuFrame::ProcessEvent isn't actually being called during menuitem.click(). Tests which currently use .click() also call .hidePopup(). I missed that.

So I think we should use menupopup.activateItem(menuitem) everywhere and not support .click().

No longer blocks: 1700724
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
Attachment #9214845 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: