Web Inspector: Scrolling in Timelines causes flashing of the DataGrid
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Apr 2016 00:10:16 +0000 (00:10 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Apr 2016 00:10:16 +0000 (00:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157212
rdar://problem/25994717

Listen for mousewheel events too so we can update the visible rows sooner.

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid): Call _updateScrollListeners.
(WebInspector.DataGrid.prototype.set inline): Use _updateScrollListeners.
(WebInspector.DataGrid.prototype.set variableHeightRows): Use _updateScrollListeners.
(WebInspector.DataGrid.prototype._updateScrollListeners): Added. Listen for mousewheel too.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200270 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/DataGrid.js

index ee2b362..b24f203 100644 (file)
@@ -1,3 +1,19 @@
+2016-04-29  Timothy Hatcher  <timothy@apple.com>
+
+        Web Inspector: Scrolling in Timelines causes flashing of the DataGrid
+        https://bugs.webkit.org/show_bug.cgi?id=157212
+        rdar://problem/25994717
+
+        Listen for mousewheel events too so we can update the visible rows sooner.
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/DataGrid.js:
+        (WebInspector.DataGrid): Call _updateScrollListeners.
+        (WebInspector.DataGrid.prototype.set inline): Use _updateScrollListeners.
+        (WebInspector.DataGrid.prototype.set variableHeightRows): Use _updateScrollListeners.
+        (WebInspector.DataGrid.prototype._updateScrollListeners): Added. Listen for mousewheel too.
+
 2016-04-29  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Jump to Line in auto formatted JavaScript does not work the first time
index 9283932..39d4456 100644 (file)
@@ -73,7 +73,7 @@ WebInspector.DataGrid = class DataGrid extends WebInspector.View
         this._scrollContainerElement.className = "data-container";
 
         this._scrollListener = () => this.needsLayout();
-        this._scrollContainerElement.addEventListener("scroll", this._scrollListener);
+        this._updateScrollListeners();
 
         this._topDataTableMarginElement = this._scrollContainerElement.createChild("div");
 
@@ -261,10 +261,7 @@ WebInspector.DataGrid = class DataGrid extends WebInspector.View
 
         this._element.classList.toggle("inline", this._inline);
 
-        if (this._inline || this._variableHeightRows)
-            this._scrollContainerElement.removeEventListener("scroll", this._scrollListener);
-        else
-            this._scrollContainerElement.addEventListener("scroll", this._scrollListener);
+        this._updateScrollListeners();
     }
 
     get variableHeightRows() { return this._variableHeightRows; }
@@ -278,10 +275,7 @@ WebInspector.DataGrid = class DataGrid extends WebInspector.View
 
         this._element.classList.toggle("variable-height-rows", this._variableHeightRows);
 
-        if (this._inline || this._variableHeightRows)
-            this._scrollContainerElement.removeEventListener("scroll", this._scrollListener);
-        else
-            this._scrollContainerElement.addEventListener("scroll", this._scrollListener);
+        this._updateScrollListeners();
     }
 
     set filterText(x)
@@ -321,6 +315,17 @@ WebInspector.DataGrid = class DataGrid extends WebInspector.View
         return this._filterDelegate.dataGridMatchNodeAgainstCustomFilters(node);
     }
 
+    _updateScrollListeners()
+    {
+        if (this._inline || this._variableHeightRows) {
+            this._scrollContainerElement.removeEventListener("scroll", this._scrollListener);
+            this._scrollContainerElement.removeEventListener("mousewheel", this._scrollListener);
+        } else {
+            this._scrollContainerElement.addEventListener("scroll", this._scrollListener);
+            this._scrollContainerElement.addEventListener("mousewheel", this._scrollListener);
+        }
+    }
+
     _applyFiltersToNode(node)
     {
         if (!this._textFilterRegex && !this.hasCustomFilters()) {