зеркало из https://github.com/mozilla/gecko-dev.git
Bug 903573 - Get a reference to the style actor in the inspector panel. r=mratcliffe
This commit is contained in:
Родитель
a01c5c7e8c
Коммит
083c360416
|
@ -45,12 +45,8 @@ InspectorPanel.prototype = {
|
|||
*/
|
||||
open: function InspectorPanel_open() {
|
||||
return this.target.makeRemote().then(() => {
|
||||
return this.target.inspector.getWalker();
|
||||
}).then(walker => {
|
||||
if (this._destroyPromise) {
|
||||
walker.release().then(null, console.error);
|
||||
}
|
||||
this.walker = walker;
|
||||
return this._getWalker();
|
||||
}).then(() => {
|
||||
return this._getDefaultNodeForSelection();
|
||||
}).then(defaultSelection => {
|
||||
return this._deferredOpen(defaultSelection);
|
||||
|
@ -149,6 +145,16 @@ InspectorPanel.prototype = {
|
|||
return deferred.promise;
|
||||
},
|
||||
|
||||
_getWalker: function() {
|
||||
let inspector = this.target.inspector;
|
||||
return inspector.getWalker().then(walker => {
|
||||
this.walker = walker;
|
||||
return inspector.getPageStyle();
|
||||
}).then(pageStyle => {
|
||||
this.pageStyle = pageStyle;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Return a promise that will resolve to the default node for selection.
|
||||
*/
|
||||
|
@ -317,7 +323,7 @@ InspectorPanel.prototype = {
|
|||
try {
|
||||
selfUpdate(selection);
|
||||
} catch(ex) {
|
||||
console.error(ex);
|
||||
console.error(ex)
|
||||
}
|
||||
}, Ci.nsIThread.DISPATCH_NORMAL);
|
||||
},
|
||||
|
@ -403,6 +409,7 @@ InspectorPanel.prototype = {
|
|||
if (this.walker) {
|
||||
this._destroyPromise = this.walker.release().then(null, console.error);
|
||||
delete this.walker;
|
||||
delete this.pageStyle;
|
||||
} else {
|
||||
this._destroyPromise = promise.resolve(null);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ Selection.prototype = {
|
|||
attributeChange = true;
|
||||
}
|
||||
if (m.type == "childList") {
|
||||
if (!detached && !this.isConnected()) {
|
||||
if (!detached && this.isNode() && !this.isConnected()) {
|
||||
parentNode = m.target;
|
||||
detached = true;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче