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

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

Issue 2445173002: DevTools: Fix highlight/selection of marker events (Closed)
Patch Set: Created 4 years, 2 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 | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChart.js ('k') | 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 9573e7275b2e7d5377a179c37493c47c022fb384..b5161f8a3cbfb98e0a98503b11ba97397e84753c 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
@@ -263,11 +263,6 @@ WebInspector.FlameChartDataProvider.prototype = {
textPadding: function() { },
/**
- * @return {?{startTime: number, endTime: number}}
- */
- highlightTimeRange: function(entryIndex) { },
-
- /**
* @return {number}
*/
paddingLeft: function() { },
@@ -1481,22 +1476,21 @@ WebInspector.FlameChart.prototype = {
*/
_updateElementPosition: function(element, entryIndex)
{
- /** @const */ var elementMinWidth = 2;
+ const elementMinWidthPx = 2;
if (element.parentElement)
element.remove();
if (entryIndex === -1)
return;
- var timeRange = this._dataProvider.highlightTimeRange(entryIndex);
- if (!timeRange)
- return;
var timelineData = this._timelineData();
- var barX = this._timeToPositionClipped(timeRange.startTime);
- var barRight = this._timeToPositionClipped(timeRange.endTime);
+ var startTime = timelineData.entryStartTimes[entryIndex];
+ var endTime = startTime + (timelineData.entryTotalTimes[entryIndex] || 0);
+ var barX = this._timeToPositionClipped(startTime);
+ var barRight = this._timeToPositionClipped(endTime);
if (barRight === 0 || barX === this._offsetWidth)
return;
var barWidth = barRight - barX;
var barCenter = barX + barWidth / 2;
- barWidth = Math.max(barWidth, elementMinWidth);
+ barWidth = Math.max(barWidth, elementMinWidthPx);
barX = barCenter - barWidth / 2;
var barY = this._levelToHeight(timelineData.entryLevels[entryIndex]) - this.scrollOffset();
var style = element.style;
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChart.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698