Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Unified Diff: third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js

Issue 2654913003: [Devtools] Fixed scrolling in network panel (Closed)
Patch Set: changes Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js
diff --git a/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js b/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js
index 200c37a2bf07434eacc3a478873adcd3bb768e23..36ca90c0215092eb68ae46891049c72f1a6b871e 100644
--- a/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js
+++ b/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js
@@ -23,7 +23,6 @@ DataGrid.ViewportDataGrid = class extends DataGrid.DataGrid {
this._scrollContainer.addEventListener('mousewheel', this._onWheel.bind(this), true);
/** @type {!Array.<!DataGrid.ViewportDataGridNode>} */
this._visibleNodes = [];
- /** @type {boolean} */
this._inline = false;
// Wheel target shouldn't be removed from DOM to preserve native kinetic scrolling.
@@ -34,11 +33,9 @@ DataGrid.ViewportDataGrid = class extends DataGrid.DataGrid {
/** @type {?Node} */
this._hiddenWheelTarget = null;
- /** @type {boolean} */
this._stickToBottom = false;
- /** @type {boolean} */
+ this._updateIsFromUser = false;
this._atBottom = true;
- /** @type {number} */
this._lastScrollTop = 0;
this._firstVisibleIsStriped = false;
@@ -84,7 +81,7 @@ DataGrid.ViewportDataGrid = class extends DataGrid.DataGrid {
_onScroll(event) {
this._atBottom = this._scrollContainer.isScrolledToBottom();
if (this._lastScrollTop !== this._scrollContainer.scrollTop)
- this.scheduleUpdate();
+ this.scheduleUpdate(true);
}
/**
@@ -94,7 +91,11 @@ DataGrid.ViewportDataGrid = class extends DataGrid.DataGrid {
this.scheduleUpdate();
}
- scheduleUpdate() {
+ /**
+ * @param {boolean=} isFromUser
+ */
+ scheduleUpdate(isFromUser) {
+ this._updateIsFromUser = this._updateIsFromUser || isFromUser;
if (this._updateAnimationFrameId)
return;
this._updateAnimationFrameId = this.element.window().requestAnimationFrame(this._update.bind(this));
@@ -173,8 +174,9 @@ DataGrid.ViewportDataGrid = class extends DataGrid.DataGrid {
var scrollTop = this._scrollContainer.scrollTop;
var currentScrollTop = scrollTop;
var maxScrollTop = Math.max(0, this._contentHeight() - clientHeight);
- if (this._stickToBottom && this._atBottom)
+ if (!this._updateIsFromUser && this._stickToBottom && this._atBottom)
scrollTop = maxScrollTop;
+ this._updateIsFromUser = false;
pfeldman 2017/01/27 20:21:47 It still has a race when previous _update is clear
allada 2017/01/27 21:33:30 Acknowledged.
scrollTop = Math.min(maxScrollTop, scrollTop);
this._atBottom = scrollTop === maxScrollTop;
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698