Bug 1708734 - Part 4: Don't create the actor for some JSActor events, r=mconley,marionette-reviewers,whimboo

Differential Revision: https://phabricator.services.mozilla.com/D114794
This commit is contained in:
Nika Layzell 2021-05-11 17:29:25 +00:00
Родитель ad678cf076
Коммит f7e496bbeb
5 изменённых файлов: 13 добавлений и 19 удалений

Просмотреть файл

@ -22,14 +22,6 @@ class FormValidationChild extends JSWindowActorChild {
this._element = null;
}
actorCreated() {
// Listening to pageshow event is only relevant
// if an invalid form popup was open. So we add
// a listener here and not during registration to
// avoid a premature instantiation of the actor.
this.contentWindow.addEventListener("pageshow", this);
}
/*
* Events
*/

Просмотреть файл

@ -500,6 +500,9 @@ let JSWINDOWACTORS = {
moduleURI: "resource:///actors/FormValidationChild.jsm",
events: {
MozInvalidForm: {},
// Listening to pageshow event is only relevant if an invalid form
// popup was open, so don't create the actor when fired.
pageshow: { createActor: false },
},
},
@ -537,7 +540,9 @@ let JSWINDOWACTORS = {
DOMLinkAdded: {},
DOMLinkChanged: {},
pageshow: {},
pagehide: {},
// The `pagehide` event is only used to clean up state which will not be
// present if the actor hasn't been created.
pagehide: { createActor: false },
},
},
@ -656,7 +661,9 @@ let JSWINDOWACTORS = {
events: {
DOMContentLoaded: {},
pageshow: { mozSystemGroup: true },
unload: {},
// The 'unload' event is only used to clean up state, and should not
// force actor creation.
unload: { createActor: false },
},
},
},

Просмотреть файл

@ -71,7 +71,7 @@ function registerEventsActor() {
click: {},
dblclick: {},
unload: { capture: true },
unload: { capture: true, createActor: false },
},
},

Просмотреть файл

@ -20,14 +20,6 @@ class PopupBlockingChild extends JSWindowActorChild {
this.weakDocStates = new WeakMap();
}
actorCreated() {
this.contentWindow.addEventListener("pageshow", this);
}
didDestroy() {
this.contentWindow.removeEventListener("pageshow", this);
}
/**
* Returns the state for the current document referred to via
* this.document. If no such state exists, creates it, stores it

Просмотреть файл

@ -349,6 +349,9 @@ let JSWINDOWACTORS = {
moduleURI: "resource://gre/actors/PopupBlockingChild.jsm",
events: {
DOMPopupBlocked: { capture: true },
// Only listen for the `pageshow` event after the actor has already been
// created for some other reason.
pageshow: { createActor: false },
},
},
allFrames: true,