From 2cb62768ded72ee38bb03748b70795dc57c5a680 Mon Sep 17 00:00:00 2001 From: Brian Grinstead Date: Wed, 25 Mar 2015 12:19:00 -0400 Subject: [PATCH] Bug 1147325 - Clear box model timer on markup view destroy. r=pbrosset Prevents 'this._inspector.toolbox is null' spam in mochitest-dt --- browser/devtools/markupview/markup-view.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/browser/devtools/markupview/markup-view.js b/browser/devtools/markupview/markup-view.js index 4a60774a7bf..31e8eb06355 100644 --- a/browser/devtools/markupview/markup-view.js +++ b/browser/devtools/markupview/markup-view.js @@ -317,14 +317,16 @@ MarkupView.prototype = { }, _briefBoxModelTimer: null, - _brieflyShowBoxModel: function(nodeFront) { - let win = this._frame.contentWindow; + _clearBriefBoxModelTimer: function() { if (this._briefBoxModelTimer) { clearTimeout(this._briefBoxModelTimer); this._briefBoxModelTimer = null; } + }, + _brieflyShowBoxModel: function(nodeFront) { + this._clearBriefBoxModelTimer(); this._showBoxModel(nodeFront); this._briefBoxModelTimer = setTimeout(() => { @@ -1379,6 +1381,7 @@ MarkupView.prototype = { // We ignore the promise that |_hideBoxModel| returns, since we should still // proceed with the rest of destruction if it fails. this._hideBoxModel(); + this._clearBriefBoxModelTimer(); this._elt.removeEventListener("click", this._onMouseClick, false);