Bug 928278 - BreadcrumbsWidget should use setNamedTimeout, r=past
authorVictor Porof <vporof@mozilla.com>
Fri, 18 Oct 2013 11:13:36 +0300
changeset 151138 8904c520ed403ffecca9f40fe3a1ab9fac699e37
parent 151137 7ad9821dd3c3ebfcf9a8bda7d249c5c85cabc367
child 151256 5952f0bdecd268cc0858b324bfd5756097aed39c
push id3107
push uservporof@mozilla.com
push dateFri, 18 Oct 2013 08:13:47 +0000
treeherderfx-team@8904c520ed40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs928278
milestone27.0a1
Bug 928278 - BreadcrumbsWidget should use setNamedTimeout, r=past
browser/devtools/shared/widgets/BreadcrumbsWidget.jsm
--- a/browser/devtools/shared/widgets/BreadcrumbsWidget.jsm
+++ b/browser/devtools/shared/widgets/BreadcrumbsWidget.jsm
@@ -131,22 +131,21 @@ BreadcrumbsWidget.prototype = {
         this._selectedItem = node;
       } else {
         node.removeAttribute("checked");
       }
     }
 
     // Repeated calls to ensureElementIsVisible would interfere with each other
     // and may sometimes result in incorrect scroll positions.
-    this.window.clearTimeout(this._ensureVisibleTimeout);
-    this._ensureVisibleTimeout = this.window.setTimeout(() => {
+    setNamedTimeout("breadcrumb-select", ENSURE_SELECTION_VISIBLE_DELAY, () => {
       if (this._selectedItem) {
         this._list.ensureElementIsVisible(this._selectedItem);
       }
-    }, ENSURE_SELECTION_VISIBLE_DELAY);
+    });
   },
 
   /**
    * The underflow and overflow listener for the arrowscrollbox container.
    */
   _onUnderflow: function({ target }) {
     if (target != this._list) {
       return;
@@ -167,18 +166,17 @@ BreadcrumbsWidget.prototype = {
     target._scrollButtonDown.collapsed = false;
     target.setAttribute("overflows", "");
   },
 
   window: null,
   document: null,
   _parent: null,
   _list: null,
-  _selectedItem: null,
-  _ensureVisibleTimeout: null
+  _selectedItem: null
 };
 
 /**
  * A Breadcrumb constructor for the BreadcrumbsWidget.
  *
  * @param BreadcrumbsWidget aWidget
  *        The widget to contain this breadcrumb.
  * @param string | nsIDOMNode aContents