Bug 1147325 - Clear box model timer on markup view destroy. r=pbrosset

Prevents 'this._inspector.toolbox is null' spam in mochitest-dt
This commit is contained in:
Brian Grinstead 2015-03-25 12:19:00 -04:00
parent b75e920d56
commit 2cb62768de

View File

@ -317,14 +317,16 @@ MarkupView.prototype = {
}, },
_briefBoxModelTimer: null, _briefBoxModelTimer: null,
_brieflyShowBoxModel: function(nodeFront) {
let win = this._frame.contentWindow;
_clearBriefBoxModelTimer: function() {
if (this._briefBoxModelTimer) { if (this._briefBoxModelTimer) {
clearTimeout(this._briefBoxModelTimer); clearTimeout(this._briefBoxModelTimer);
this._briefBoxModelTimer = null; this._briefBoxModelTimer = null;
} }
},
_brieflyShowBoxModel: function(nodeFront) {
this._clearBriefBoxModelTimer();
this._showBoxModel(nodeFront); this._showBoxModel(nodeFront);
this._briefBoxModelTimer = setTimeout(() => { this._briefBoxModelTimer = setTimeout(() => {
@ -1379,6 +1381,7 @@ MarkupView.prototype = {
// We ignore the promise that |_hideBoxModel| returns, since we should still // We ignore the promise that |_hideBoxModel| returns, since we should still
// proceed with the rest of destruction if it fails. // proceed with the rest of destruction if it fails.
this._hideBoxModel(); this._hideBoxModel();
this._clearBriefBoxModelTimer();
this._elt.removeEventListener("click", this._onMouseClick, false); this._elt.removeEventListener("click", this._onMouseClick, false);