зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 2672589e571e (bug 1161072) for test failures in browser_tilt_picking_inspector.js
This commit is contained in:
Родитель
b998607785
Коммит
2486d8a52b
|
@ -1743,52 +1743,52 @@ Toolbox.prototype = {
|
|||
* Returns a promise that resolves when the fronts are destroyed
|
||||
*/
|
||||
destroyInspector: function() {
|
||||
if (this._destroyingInspector) {
|
||||
return this._destroyingInspector;
|
||||
if (this._destroying) {
|
||||
return this._destroying;
|
||||
}
|
||||
|
||||
return this._destroyingInspector = Task.spawn(function*() {
|
||||
if (!this._inspector) {
|
||||
return;
|
||||
}
|
||||
if (!this._inspector) {
|
||||
return promise.resolve();
|
||||
}
|
||||
|
||||
// Releasing the walker (if it has been created)
|
||||
// This can fail, but in any case, we want to continue destroying the
|
||||
// inspector/highlighter/selection
|
||||
// FF42+: Inspector actor starts managing Walker actor and auto destroy it.
|
||||
if (this._walker && !this.walker.traits.autoReleased) {
|
||||
try {
|
||||
yield this._walker.release();
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
yield this.highlighterUtils.stopPicker();
|
||||
yield this._inspector.destroy();
|
||||
if (this._highlighter) {
|
||||
// Note that if the toolbox is closed, this will work fine, but will fail
|
||||
// in case the browser is closed and will trigger a noSuchActor message.
|
||||
// We ignore the promise that |_hideBoxModel| returns, since we should still
|
||||
// proceed with the rest of destruction if it fails.
|
||||
// FF42+ now does the cleanup from the actor.
|
||||
if (!this.highlighter.traits.autoHideOnDestroy) {
|
||||
this.highlighterUtils.unhighlight();
|
||||
let outstanding = () => {
|
||||
return Task.spawn(function*() {
|
||||
yield this.highlighterUtils.stopPicker();
|
||||
yield this._inspector.destroy();
|
||||
if (this._highlighter) {
|
||||
// Note that if the toolbox is closed, this will work fine, but will fail
|
||||
// in case the browser is closed and will trigger a noSuchActor message.
|
||||
// We ignore the promise that |_hideBoxModel| returns, since we should still
|
||||
// proceed with the rest of destruction if it fails.
|
||||
// FF42+ now does the cleanup from the actor.
|
||||
if (!this.highlighter.traits.autoHideOnDestroy) {
|
||||
this.highlighterUtils.unhighlight();
|
||||
}
|
||||
yield this._highlighter.destroy();
|
||||
}
|
||||
if (this._selection) {
|
||||
this._selection.destroy();
|
||||
}
|
||||
yield this._highlighter.destroy();
|
||||
}
|
||||
if (this._selection) {
|
||||
this._selection.destroy();
|
||||
}
|
||||
|
||||
if (this.walker) {
|
||||
this.walker.off("highlighter-ready", this._highlighterReady);
|
||||
this.walker.off("highlighter-hide", this._highlighterHidden);
|
||||
}
|
||||
if (this.walker) {
|
||||
this.walker.off("highlighter-ready", this._highlighterReady);
|
||||
this.walker.off("highlighter-hide", this._highlighterHidden);
|
||||
}
|
||||
|
||||
this._inspector = null;
|
||||
this._highlighter = null;
|
||||
this._selection = null;
|
||||
this._walker = null;
|
||||
}.bind(this));
|
||||
this._inspector = null;
|
||||
this._highlighter = null;
|
||||
this._selection = null;
|
||||
this._walker = null;
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
// Releasing the walker (if it has been created)
|
||||
// This can fail, but in any case, we want to continue destroying the
|
||||
// inspector/highlighter/selection
|
||||
let walker = (this._destroying = this._walker) ?
|
||||
this._walker.release() :
|
||||
promise.resolve();
|
||||
return walker.then(outstanding, outstanding);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -1298,13 +1298,7 @@ var WalkerActor = protocol.ActorClass({
|
|||
form: function() {
|
||||
return {
|
||||
actor: this.actorID,
|
||||
root: this.rootNode.form(),
|
||||
traits: {
|
||||
// FF42+ Inspector starts managing the Walker, while the inspector also
|
||||
// starts cleaning itself up automatically on client disconnection.
|
||||
// So that there is no need to manually release the walker anymore.
|
||||
autoReleased: true
|
||||
}
|
||||
root: this.rootNode.form()
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -3114,8 +3108,6 @@ var WalkerFront = exports.WalkerFront = protocol.FrontClass(WalkerActor, {
|
|||
this.actorID = json.actor;
|
||||
this.rootNode = types.getType("domnode").read(json.root, this);
|
||||
this._rootNodeDeferred.resolve(this.rootNode);
|
||||
// FF42+ the actor starts exposing traits
|
||||
this.traits = json.traits || {};
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -3530,7 +3522,6 @@ var InspectorActor = exports.InspectorActor = protocol.ActorClass({
|
|||
let tabActor = this.tabActor;
|
||||
window.removeEventListener("DOMContentLoaded", domReady, true);
|
||||
this.walker = WalkerActor(this.conn, tabActor, options);
|
||||
this.manage(this.walker);
|
||||
events.once(this.walker, "destroyed", () => {
|
||||
this._walkerPromise = null;
|
||||
this._pageStylePromise = null;
|
||||
|
|
Загрузка…
Ссылка в новой задаче