Bug 1147325 - Clear box model timer on markup view destroy. r=pbrosset
authorBrian Grinstead <bgrinstead@mozilla.com>
Wed, 25 Mar 2015 12:19:00 -0400
changeset 235883 36f19d3140edad28922804909c9c5c92a6721f9e
parent 235882 b53d8a0d5645af2f740487d11ce3b2e25141bb0f
child 235884 54f37e45c70b1b6e0079c422049d5b9e18f5cbf2
push id28485
push userkwierso@gmail.com
push dateFri, 27 Mar 2015 00:22:25 +0000
treeherdermozilla-central@e046475a75cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbrosset
bugs1147325
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
--- a/browser/devtools/markupview/markup-view.js
+++ b/browser/devtools/markupview/markup-view.js
@@ -312,24 +312,26 @@ MarkupView.prototype = {
    * hidden, taking into account that there could already be highlighter requests
    * queued up
    */
   _hideBoxModel: function(forceHide) {
     return this._inspector.toolbox.highlighterUtils.unhighlight(forceHide);
   },
 
   _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(() => {
       this._hideBoxModel();
     }, NEW_SELECTION_HIGHLIGHTER_TIMER);
   },
 
   template: function(aName, aDest, aOptions={stack: "markup-view.xhtml"}) {
@@ -1374,16 +1376,17 @@ MarkupView.prototype = {
 
     this._destroyer = promise.resolve();
 
     // 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.
     this._hideBoxModel();
+    this._clearBriefBoxModelTimer();
 
     this._elt.removeEventListener("click", this._onMouseClick, false);
 
     this._hoveredNode = null;
     this._inspector.toolbox.off("picker-node-hovered", this._onToolboxPickerHover);
 
     this.htmlEditor.destroy();
     this.htmlEditor = null;