Bug 1504709 - Freeze the sort order of about:performance for 5s on click events, r=felipe a=jcristau
authorFlorian Quèze <florian@queze.net>
Mon, 05 Nov 2018 18:12:41 +0100
changeset 501072 7d121c076bc72759290367bc86a18e995c8716a4
parent 501071 0c7a40a87b9a29236ac5fc30bad547177591cbb8
child 501073 4bf79d20c6444193ca12af354163c448d81a1f44
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe, jcristau
bugs1504709
milestone64.0
Bug 1504709 - Freeze the sort order of about:performance for 5s on click events, r=felipe a=jcristau
toolkit/components/aboutperformance/content/aboutPerformance.js
--- a/toolkit/components/aboutperformance/content/aboutPerformance.js
+++ b/toolkit/components/aboutperformance/content/aboutPerformance.js
@@ -1077,16 +1077,18 @@ var View = {
 
 var Control = {
   _openItems: new Set(),
   init() {
     this._initAutorefresh();
     this._initDisplayMode();
     let tbody = document.getElementById("dispatch-tbody");
     tbody.addEventListener("click", () => {
+      this._updateLastMouseEvent();
+
       // Handle showing or hiding subitems of a row.
       let target = event.target;
       if (target.classList.contains("twisty")) {
         let row = target.parentNode.parentNode;
         let id = row.windowId;
         if (target.classList.toggle("open")) {
           this._openItems.add(id);
           this._showChildren(row);
@@ -1144,20 +1146,23 @@ var Control = {
       if (!found || !found.tabbrowser)
         return;
       let {tabbrowser, tab} = found;
       tabbrowser.selectedTab = tab;
       tabbrowser.ownerGlobal.focus();
     });
 
     tbody.addEventListener("mousemove", () => {
-      this._lastMouseEvent = Date.now();
+      this._updateLastMouseEvent();
     });
   },
   _lastMouseEvent: 0,
+  _updateLastMouseEvent() {
+    this._lastMouseEvent = Date.now();
+  },
   async update() {
     let mode = this._displayMode;
     if (this._autoRefreshInterval || !State._buffer[0]) {
       // Update the state only if we are not on pause.
       await State.update();
       if (document.hidden)
         return;
     }