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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js

Issue 1782713002: Timeline: fix exception when clicking on drawer padding with collapsible groups enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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_lazy/FlameChart.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
index c1208bc4de30a899136e7ebf8b649b747067d34f..2dc72e631d8838edbc8baf5638310dda824ba6dc 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
@@ -1114,7 +1114,7 @@ WebInspector.FlameChart.prototype = {
var groups = this._rawTimelineData.groups || [];
var group = this._groupOffsets.upperBound(y) - 1;
- if (group >= 0 && y - this._groupOffsets[group] < groups[group].style.height)
+ if (group >= 0 && group < groups.length && y - this._groupOffsets[group] < groups[group].style.height)
return group;
return -1;
},
@@ -1333,9 +1333,11 @@ WebInspector.FlameChart.prototype = {
var barHeight = this._barHeight;
var textBaseHeight = barHeight - this._dataProvider.textBaseline();
var groups = this._rawTimelineData.groups || [];
+ if (!groups.length)
+ return;
+
var groupOffsets = this._groupOffsets;
var lastGroupOffset = Array.prototype.peekLast.call(groupOffsets);
-
var firstVisibleGroup = Math.max(groupOffsets.upperBound(top) - 1, 0);
context.save();
« 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