зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
ad678cf076
Коммит
f7e496bbeb
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче