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

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

Issue 354013002: DevTools: [Console] fix search to reveal matched messages (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline one more test Created 6 years, 6 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 | « Source/devtools/front_end/console/ConsoleViewMessage.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/ViewportControl.js
diff --git a/Source/devtools/front_end/ui/ViewportControl.js b/Source/devtools/front_end/ui/ViewportControl.js
index 51f12f5ca016291ff239e7e30518b3cf7be45a0f..130cfbce5a423b476f73e8d2a52ec2ccc9a8a5d6 100644
--- a/Source/devtools/front_end/ui/ViewportControl.js
+++ b/Source/devtools/front_end/ui/ViewportControl.js
@@ -367,7 +367,7 @@ WebInspector.ViewportControl.prototype = {
this._firstVisibleIndex = Math.max(Array.prototype.lowerBound.call(this._cumulativeHeights, this._cumulativeHeights[this._cumulativeHeights.length - 1] - clientHeight), 0);
} else {
this._firstVisibleIndex = Math.max(Array.prototype.lowerBound.call(this._cumulativeHeights, visibleFrom), 0);
- this._lastVisibleIndex = Math.min(Array.prototype.upperBound.call(this._cumulativeHeights, visibleFrom + clientHeight), itemCount - 1);
+ this._lastVisibleIndex = Math.min(Array.prototype.upperBound.call(this._cumulativeHeights, visibleFrom + clientHeight - 1), itemCount - 1);
}
var topGapHeight = this._cumulativeHeights[this._firstVisibleIndex - 1] || 0;
var bottomGapHeight = this._cumulativeHeights[this._cumulativeHeights.length - 1] - this._cumulativeHeights[this._lastVisibleIndex];
@@ -498,8 +498,10 @@ WebInspector.ViewportControl.prototype = {
return;
if (makeLast)
this.forceScrollItemToBeLast(index);
- else
+ else if (index <= this._firstVisibleIndex)
this.forceScrollItemToBeFirst(index);
+ else if (index >= this._lastVisibleIndex)
+ this.forceScrollItemToBeLast(index);
},
/**
« no previous file with comments | « Source/devtools/front_end/console/ConsoleViewMessage.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698