Bug 1896249 - Use BrowserUtils.getRootEvent everywhere r=Gijs,places-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D210121
This commit is contained in:
Mathew Hodson 2024-05-15 09:23:19 +00:00
parent fe8d73eb88
commit 76da252271
4 changed files with 5 additions and 9 deletions

View File

@ -115,12 +115,13 @@ var StarUI = {
this.panel.hidePopup();
break;
// This case is for catching character-generating keypresses
case 0:
case 0: {
let accessKey = document.getElementById("key_close");
if (eventMatchesKey(aEvent, accessKey)) {
this.panel.hidePopup();
}
break;
}
}
break;
case "compositionend":
@ -704,7 +705,7 @@ class HistoryMenu extends PlacesMenu {
}
_onCommand(aEvent) {
aEvent = getRootEvent(aEvent);
aEvent = BrowserUtils.getRootEvent(aEvent);
let placesNode = aEvent.target._placesNode;
if (placesNode) {
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {

View File

@ -2525,7 +2525,7 @@ const BrowserSearch = {
csp,
event
) {
event = getRootEvent(event);
event = BrowserUtils.getRootEvent(event);
let where = BrowserUtils.whereToOpenLink(event);
if (where == "current") {
// override: historically search opens in new tab

View File

@ -108,11 +108,6 @@ function openUILink(
);
}
// This is here for historical reasons. bug 1742889 covers cleaning this up.
function getRootEvent(aEvent) {
return BrowserUtils.getRootEvent(aEvent);
}
function openTrustedLinkIn(url, where, params) {
URILoadingHelper.openTrustedLinkIn(window, url, where, params);
}

View File

@ -2096,7 +2096,7 @@ this.PlacesPanelview = class PlacesPanelview extends PlacesViewBase {
}
_onCommand(event) {
event = getRootEvent(event);
event = BrowserUtils.getRootEvent(event);
let button = event.originalTarget;
if (!button._placesNode) {
return;