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

Unified Diff: Source/devtools/front_end/sources/FilteredItemSelectionDialog.js

Issue 305813005: DevTools: Fix regression that slows down "Goto Source" dialog (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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/ConsoleView.js ('k') | Source/devtools/front_end/ui/ViewportControl.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sources/FilteredItemSelectionDialog.js
diff --git a/Source/devtools/front_end/sources/FilteredItemSelectionDialog.js b/Source/devtools/front_end/sources/FilteredItemSelectionDialog.js
index 3d608aff3d0d443496799df284dc420f370c56aa..c769742f35d2e563dbe66b73acc3cd82929260eb 100644
--- a/Source/devtools/front_end/sources/FilteredItemSelectionDialog.js
+++ b/Source/devtools/front_end/sources/FilteredItemSelectionDialog.js
@@ -354,17 +354,29 @@ WebInspector.FilteredItemSelectionDialog.prototype = {
/**
* @param {number} index
+ * @return {number}
+ */
+ fastHeight: function(index)
+ {
+ if (!this._rowHeight) {
+ var delegateIndex = this._filteredItems[index];
+ var element = this._createItemElement(delegateIndex);
+ this._rowHeight = element.measurePreferredSize(this._viewportControl.contentElement()).height;
+ }
+ return this._rowHeight;
+ },
+
+ /**
+ * @param {number} index
* @return {!WebInspector.ViewportElement}
*/
itemElement: function(index)
{
var delegateIndex = this._filteredItems[index];
var element = this._createItemElement(delegateIndex);
- if (!this._rowHeight)
- this._rowHeight = element.measurePreferredSize(this._viewportControl.contentElement()).height;
if (index === this._selectedIndexInFiltered)
element.classList.add("selected");
- return new WebInspector.StaticViewportElement(element, this._rowHeight);
+ return new WebInspector.StaticViewportElement(element);
},
__proto__: WebInspector.DialogDelegate.prototype
« no previous file with comments | « Source/devtools/front_end/console/ConsoleView.js ('k') | Source/devtools/front_end/ui/ViewportControl.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698