Bug 928278 - BreadcrumbsWidget should use setNamedTimeout, r=past
authorVictor Porof <vporof@mozilla.com>
Fri, 18 Oct 2013 11:13:36 +0300
changeset 165095 8904c520ed403ffecca9f40fe3a1ab9fac699e37
parent 165094 7ad9821dd3c3ebfcf9a8bda7d249c5c85cabc367
child 165096 5952f0bdecd268cc0858b324bfd5756097aed39c
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs928278
milestone27.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 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