Bug 1346781 - do not attempt to hide highlighters if currentNode is falsy;r=zer0
This commit updates part of the logic changed in
Bug 1333714 (e3a0d990896d)
The hide method of the auto refresh highlighters were modified to allow
hide() to be called as long as the highlighter env window was still valid.
This could lead to calling hide on highlighters where show() had not been
previously called, slowing down closing the inspector for no reason.
This changes the hide() method to also bail out in case this.currentNode
is not truthy, which means show() was not called previously.
MozReview-Commit-ID: 4EOgjD6W2QB
--- a/devtools/server/actors/highlighters/auto-refresh.js
+++ b/devtools/server/actors/highlighters/auto-refresh.js
@@ -114,17 +114,17 @@ AutoRefreshHighlighter.prototype = {
}
return shown;
},
/**
* Hide the highlighter
*/
hide: function () {
- if (Cu.isDeadWrapper(this.highlighterEnv.window)) {
+ if (!this.currentNode || !this.highlighterEnv.window) {
return;
}
this._hide();
this._stopRefreshLoop();
this.currentNode = null;
this.currentQuads = {};
this.options = null;