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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js

Issue 2154893002: DevTools: remove isTrusted check and isUserGesture from ViewportControl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DevTools: replace isUserGesture with isScroll Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js b/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js
index 7db48ee418bcb46a860b58299d228ad44c51ddc6..6de10a89226490cd01b0aa9f422d57a5ef20646e 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js
@@ -380,9 +380,9 @@ WebInspector.ViewportControl.prototype = {
},
/**
- * @param {boolean} isUserGesture
+ * @param {boolean} isScroll
*/
- _innerRefresh: function(isUserGesture)
+ _innerRefresh: function(isScroll)
lushnikov 2016/07/19 00:19:49 let's just remove this argument altogether
{
if (!this._visibleHeight())
return; // Do nothing for invisible controls.
@@ -416,11 +416,14 @@ WebInspector.ViewportControl.prototype = {
var oldFirstVisibleIndex = this._firstVisibleIndex;
var oldLastVisibleIndex = this._lastVisibleIndex;
- var shouldStickToBottom = !isUserGesture && this._stickToBottom && this._scrolledToBottom;
+ var shouldStickToBottom = this._stickToBottom && this._scrolledToBottom;
if (shouldStickToBottom) {
this._lastVisibleIndex = this._itemCount - 1;
this._firstVisibleIndex = Math.max(this._itemCount - Math.ceil(visibleHeight / this._provider.minimumRowHeight()), 0);
+
+ if (isScroll)
+ this._firstVisibleIndex = Math.max(Array.prototype.lowerBound.call(this._cumulativeHeights, visibleFrom + 1), 0);
lushnikov 2016/07/19 00:19:49 let's kill this - viewport control should work fin
} else {
this._firstVisibleIndex = Math.max(Array.prototype.lowerBound.call(this._cumulativeHeights, visibleFrom + 1), 0);
// Proactively render more rows in case some of them will be collapsed without triggering refresh. @see crbug.com/390169
@@ -568,7 +571,7 @@ WebInspector.ViewportControl.prototype = {
*/
_onScroll: function(event)
{
- this._innerRefresh(event.isTrusted);
+ this._innerRefresh(true);
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698