Title: [240869] trunk/Source/WebInspectorUI
Revision
240869
Author
joep...@webkit.org
Date
2019-02-01 13:24:16 -0800 (Fri, 01 Feb 2019)

Log Message

Web Inspector: Timeline Detail Views do not reset properly when new time range selection contains nothing
https://bugs.webkit.org/show_bug.cgi?id=194115
<rdar://problem/47716693>

Rubber-stamped by Devin Rousso.

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.reset):
(WI.CPUTimelineView.prototype.clear):
(WI.CPUTimelineView.prototype.layout):
* UserInterface/Views/MemoryTimelineView.js:
(WI.MemoryTimelineView.prototype.reset):
(WI.MemoryTimelineView.prototype.clear):
(WI.MemoryTimelineView.prototype.layout):
When there are no visible records in the selected range clear our UI.
Introduce a `clear` method that clears the UI but keeps
non-range-specific values (e.g. maximums).

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (240868 => 240869)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-02-01 21:24:14 UTC (rev 240868)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-02-01 21:24:16 UTC (rev 240869)
@@ -1,5 +1,25 @@
 2019-02-01  Joseph Pecoraro  <pecor...@apple.com>
 
+        Web Inspector: Timeline Detail Views do not reset properly when new time range selection contains nothing
+        https://bugs.webkit.org/show_bug.cgi?id=194115
+        <rdar://problem/47716693>
+
+        Rubber-stamped by Devin Rousso.
+
+        * UserInterface/Views/CPUTimelineView.js:
+        (WI.CPUTimelineView.prototype.reset):
+        (WI.CPUTimelineView.prototype.clear):
+        (WI.CPUTimelineView.prototype.layout):
+        * UserInterface/Views/MemoryTimelineView.js:
+        (WI.MemoryTimelineView.prototype.reset):
+        (WI.MemoryTimelineView.prototype.clear):
+        (WI.MemoryTimelineView.prototype.layout):
+        When there are no visible records in the selected range clear our UI.
+        Introduce a `clear` method that clears the UI but keeps
+        non-range-specific values (e.g. maximums).
+
+2019-02-01  Joseph Pecoraro  <pecor...@apple.com>
+
         Web Inspector: Timeline graphs have drawing issues with multiple discontinuities
         https://bugs.webkit.org/show_bug.cgi?id=194110
         <rdar://problem/47714356>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js (240868 => 240869)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js	2019-02-01 21:24:14 UTC (rev 240868)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js	2019-02-01 21:24:16 UTC (rev 240869)
@@ -80,6 +80,11 @@
 
         this._maxUsage = -Infinity;
 
+        this.clear();
+    }
+
+    clear()
+    {
         this._cpuUsageView.clear();
     }
 
@@ -114,8 +119,10 @@
         // Don't include the record before the graph start if the graph start is within a gap.
         let includeRecordBeforeStart = !discontinuities.length || discontinuities[0].startTime > graphStartTime;
         let visibleRecords = this.representedObject.recordsInTimeRange(graphStartTime, visibleEndTime, includeRecordBeforeStart);
-        if (!visibleRecords.length)
+        if (!visibleRecords.length || (visibleRecords.length === 1 && visibleRecords[0].endTime < graphStartTime)) {
+            this.clear();
             return;
+        }
 
         // Update total usage chart with the last record's data.
         let lastRecord = visibleRecords.lastValue;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/MemoryTimelineView.js (240868 => 240869)


--- trunk/Source/WebInspectorUI/UserInterface/Views/MemoryTimelineView.js	2019-02-01 21:24:14 UTC (rev 240868)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/MemoryTimelineView.js	2019-02-01 21:24:16 UTC (rev 240869)
@@ -131,6 +131,11 @@
 
         this._maxSize = 0;
 
+        this.clear();
+    }
+
+    clear()
+    {
         this._cachedLegendRecord = null;
         this._cachedLegendMaxSize = undefined;
         this._cachedLegendCurrentSize = undefined;
@@ -183,8 +188,10 @@
 
         // FIXME: <https://webkit.org/b/153759> Web Inspector: Memory Timelines should better extend to future data
         let visibleRecords = this.representedObject.recordsInTimeRange(graphStartTime, visibleEndTime, includeRecordBeforeStart);
-        if (!visibleRecords.length)
+        if (!visibleRecords.length || (visibleRecords.length === 1 && visibleRecords[0].endTime < graphStartTime)) {
+            this.clear();
             return;
+        }
 
         // Update total usage chart with the last record's data.
         let lastRecord = visibleRecords.lastValue;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to