gecko-dev/browser/base
Gijs Kruitbosch f7af2c33b1 Bug 1742801 - do not consume the user gesture from ClickHandlerChild if ClickHandlerParent will ignore the click anyway, r=edgar
This commit does a couple of things:
- move whereToOpenLink and getRootEvent implementations into BrowserUtils,
  so they can be used from the child process.
- forward callers in utilityOverlay.js to the BrowserUtils ones
  (bug 1742889 will get rid of the forwarding and update all the callers;
   we might be able to get this and bug 1739929 into beta if risk is low
   enough, and touching a bunch of extra files really doesn't help with
   that)
- move the lazy-load of BrowserUtils from browser.js to utilityOverlay.js
  This is safe because everywhere that loads browser.js also loads
  utilityOverlay.js. It's needed because there are some places that use
  utilityOverlay.js but not browser.js, and so now they need access to
  BrowserUtils.jsm.
- use whereToOpenLink to determine if we should avoid consuming the transient
  user gesture activation in the child click handling code.
- add an automated test based on the testcase in the bug.

When working on this, I initially put the check using whereToOpenLink in
the toplevel of the function, and then when I ran places test to check that
I hadn't broken any places consumers of whereToOpenLink or getRootEvent,
realized that I had broken `browser_markPageAsFollowedLink.js`, because it
relies on "normal" (ie no modifier key, left button) link clicks making it
to ClickHandlerParent.jsm . I filed bug 1742894 about this. I've not tried
to fix that here, instead I've tried to ensure that paths through this
function are as untouched as possible while still fixing bug 1739929 and
bug 1742801.

Differential Revision: https://phabricator.services.mozilla.com/D132102
2021-11-25 22:49:00 +00:00
..
content Bug 1742801 - do not consume the user gesture from ClickHandlerChild if ClickHandlerParent will ignore the click anyway, r=edgar 2021-11-25 22:49:00 +00:00
jar.mn Bug 1708243 - Part 4: Remove tab-content.js and onExtensionBrowser.js, stop touching .content eagerly r=robwu 2021-10-09 22:45:28 +00:00
moz.build Bug 1711991 - Remove -proton from pageActions-proton and browser-proton directory names r=Gijs 2021-05-26 20:36:52 +00:00