Commit 347c3a95 authored by Alexei Filippov's avatar Alexei Filippov Committed by Commit Bot

DevTools: Add details text for page performance metrics.

Drive-by: Fix an exception when a selected node is panned offscreen.

BUG=901165

Change-Id: I26ae15f3506f89a93e3f91f5aa6715c3f0033b1a
Reviewed-on: https://chromium-review.googlesource.com/c/1352627
Commit-Queue: Paul Irish <paulirish@chromium.org>
Reviewed-by: default avatarPaul Irish <paulirish@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612048}
parent 7eeb966b
...@@ -1610,11 +1610,17 @@ PerfUI.FlameChart = class extends UI.VBox { ...@@ -1610,11 +1610,17 @@ PerfUI.FlameChart = class extends UI.VBox {
const timelineData = this._timelineData(); const timelineData = this._timelineData();
const startTime = timelineData.entryStartTimes[entryIndex]; const startTime = timelineData.entryStartTimes[entryIndex];
const duration = timelineData.entryTotalTimes[entryIndex]; const duration = timelineData.entryTotalTimes[entryIndex];
let barX, barWidth; let barX = 0;
let barWidth = 0;
let visible = true;
if (Number.isNaN(duration)) { if (Number.isNaN(duration)) {
const position = this._markerPositions.get(entryIndex); const position = this._markerPositions.get(entryIndex);
barX = position.x; if (position) {
barWidth = position.width; barX = position.x;
barWidth = position.width;
} else {
visible = false;
}
} else { } else {
barX = this._chartViewport.timeToPosition(startTime); barX = this._chartViewport.timeToPosition(startTime);
barWidth = duration * this._chartViewport.timeToPixel(); barWidth = duration * this._chartViewport.timeToPixel();
...@@ -1632,7 +1638,7 @@ PerfUI.FlameChart = class extends UI.VBox { ...@@ -1632,7 +1638,7 @@ PerfUI.FlameChart = class extends UI.VBox {
style.top = barY + 'px'; style.top = barY + 'px';
style.width = barWidth + 'px'; style.width = barWidth + 'px';
style.height = barHeight - 1 + 'px'; style.height = barHeight - 1 + 'px';
element.classList.remove('hidden'); element.classList.toggle('hidden', !visible);
this._viewportElement.appendChild(element); this._viewportElement.appendChild(element);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment