Changeset 240869 in webkit


Ignore:
Timestamp:
Feb 1, 2019 1:24:16 PM (5 years ago)
Author:
Joseph Pecoraro
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).

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r240867 r240869  
     12019-02-01  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Timeline Detail Views do not reset properly when new time range selection contains nothing
     4        https://bugs.webkit.org/show_bug.cgi?id=194115
     5        <rdar://problem/47716693>
     6
     7        Rubber-stamped by Devin Rousso.
     8
     9        * UserInterface/Views/CPUTimelineView.js:
     10        (WI.CPUTimelineView.prototype.reset):
     11        (WI.CPUTimelineView.prototype.clear):
     12        (WI.CPUTimelineView.prototype.layout):
     13        * UserInterface/Views/MemoryTimelineView.js:
     14        (WI.MemoryTimelineView.prototype.reset):
     15        (WI.MemoryTimelineView.prototype.clear):
     16        (WI.MemoryTimelineView.prototype.layout):
     17        When there are no visible records in the selected range clear our UI.
     18        Introduce a `clear` method that clears the UI but keeps
     19        non-range-specific values (e.g. maximums).
     20
    1212019-02-01  Joseph Pecoraro  <pecoraro@apple.com>
    222
  • trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js

    r240867 r240869  
    8181        this._maxUsage = -Infinity;
    8282
     83        this.clear();
     84    }
     85
     86    clear()
     87    {
    8388        this._cpuUsageView.clear();
    8489    }
     
    115120        let includeRecordBeforeStart = !discontinuities.length || discontinuities[0].startTime > graphStartTime;
    116121        let visibleRecords = this.representedObject.recordsInTimeRange(graphStartTime, visibleEndTime, includeRecordBeforeStart);
    117         if (!visibleRecords.length)
     122        if (!visibleRecords.length || (visibleRecords.length === 1 && visibleRecords[0].endTime < graphStartTime)) {
     123            this.clear();
    118124            return;
     125        }
    119126
    120127        // Update total usage chart with the last record's data.
  • trunk/Source/WebInspectorUI/UserInterface/Views/MemoryTimelineView.js

    r240867 r240869  
    132132        this._maxSize = 0;
    133133
     134        this.clear();
     135    }
     136
     137    clear()
     138    {
    134139        this._cachedLegendRecord = null;
    135140        this._cachedLegendMaxSize = undefined;
     
    184189        // FIXME: <https://webkit.org/b/153759> Web Inspector: Memory Timelines should better extend to future data
    185190        let visibleRecords = this.representedObject.recordsInTimeRange(graphStartTime, visibleEndTime, includeRecordBeforeStart);
    186         if (!visibleRecords.length)
     191        if (!visibleRecords.length || (visibleRecords.length === 1 && visibleRecords[0].endTime < graphStartTime)) {
     192            this.clear();
    187193            return;
     194        }
    188195
    189196        // Update total usage chart with the last record's data.
Note: See TracChangeset for help on using the changeset viewer.