fune/browser/components/screenshots
Emilio Cobos Álvarez a14c746228 Bug 1805415 - Use activateItem() rather than click() to activate menuitems. r=Gijs,extension-reviewers,pip-reviewers,search-reviewers
Bug 1805414 will move menu event handling to the DOM.

With that change the current synthetic click behavior of XUL menuitems
breaks. On current central, we rely on nsMenuFrame::HandleEvent not
getting called at all for synthetic clicks, and instead we just fire a
command event synchronously here:

  https://searchfox.org/mozilla-central/rev/a0d4f8f112c5c792ae272bf6ce50763ddd23ffa2/dom/xul/nsXULElement.cpp#1071

After my patch the command event is fired properly (potentially
asynchronously too) by the regular menu activation machinery, which is
preferable.

 * They fire a command event synchronously (even though on some
   platforms like macOS activating a context menu item is async).

 * They use a totally different codepath from what a user does.

 * They don't deal with native menus, etc.

We have a proper API for this (activateItem) which takes a much more
closer codepath to what users do, requires that the menu is shown, etc.
Use that API instead for testing.

As a benefit, tests now do not need to close the context menu manually
when clicking on a menu item (because we trigger the same code path as
users clicking the menu).

Differential Revision: https://phabricator.services.mozilla.com/D164567
2022-12-15 03:11:55 +00:00
..
content Bug 1785293 - Downloading screenshot respects 'Always ask you where to save files'. r=sfoster 2022-12-06 00:06:20 +00:00
overlay Bug 1794142 - Screenshots module buttom HCM r=sfoster 2022-11-17 22:50:18 +00:00
tests/browser Bug 1805415 - Use activateItem() rather than click() to activate menuitems. r=Gijs,extension-reviewers,pip-reviewers,search-reviewers 2022-12-15 03:11:55 +00:00
fileHelpers.mjs Bug 1785293 - Downloading screenshot respects 'Always ask you where to save files'. r=sfoster 2022-12-06 00:06:20 +00:00
jar.mn Bug 1785293 - Downloading screenshot respects 'Always ask you where to save files'. r=sfoster 2022-12-06 00:06:20 +00:00
moz.build Bug 1788776 - Convert screenshots component from JSM to ESM. r=niklas. 2022-09-11 19:08:38 +00:00
screenshots-buttons.css Bug 1739209 - Border color to follow theme in svg for screenshots buttons. r=sfoster 2021-11-11 19:50:59 +00:00
screenshots-buttons.js Bug 1667455 - Part 6: Stop importing Services.jsm from chrome-priv JS code, non-top-level or multi-line cases. r=kmag,perftest-reviewers,AlexandruIonescu,sparky 2022-07-11 12:41:51 +00:00
ScreenshotsOverlayChild.sys.mjs Bug 1748730 - The screenshots overlay and panel are now always in sync. r=sfoster 2022-10-28 19:05:18 +00:00
ScreenshotsUtils.sys.mjs Bug 1785293 - Downloading screenshot respects 'Always ask you where to save files'. r=sfoster 2022-12-06 00:06:20 +00:00