Web Inspector: Value checks of secondsPerPixel cause errors
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Sep 2016 22:05:00 +0000 (22:05 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Sep 2016 22:05:00 +0000 (22:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=161304
<rdar://problem/28050070>

Reviewed by Brian Burg.

* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype.reset):
Clear resource node map, which is used to determine which nodes
to refresh during layout.

(WebInspector.NetworkTimelineView.prototype.layout):
Like OverviewTimelineView, only refresh node graphs when times change.
This prevents refreshing nodes when (endTime - startTime) === 0.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._recordingReset):
TimelineViews must be cleared before calling _updateTimes to avoid
doing layouts in timeline views containing stale data.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205320 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js
Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js

index ee4e431..1e86b48 100644 (file)
@@ -1,3 +1,25 @@
+2016-09-01  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: Value checks of secondsPerPixel cause errors
+        https://bugs.webkit.org/show_bug.cgi?id=161304
+        <rdar://problem/28050070>
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Views/NetworkTimelineView.js:
+        (WebInspector.NetworkTimelineView.prototype.reset):
+        Clear resource node map, which is used to determine which nodes
+        to refresh during layout.
+
+        (WebInspector.NetworkTimelineView.prototype.layout):
+        Like OverviewTimelineView, only refresh node graphs when times change.
+        This prevents refreshing nodes when (endTime - startTime) === 0.
+
+        * UserInterface/Views/TimelineRecordingContentView.js:
+        (WebInspector.TimelineRecordingContentView.prototype._recordingReset):
+        TimelineViews must be cleared before calling _updateTimes to avoid
+        doing layouts in timeline views containing stale data.
+
 2016-09-01  Devin Rousso  <dcrousso+webkit@gmail.com>
 
         Web Inspector: add Object.awaitEvent which is like singleFireEventListener but returns a promise
index cf9692b..121270d 100644 (file)
@@ -158,6 +158,7 @@ WebInspector.NetworkTimelineView = class NetworkTimelineView extends WebInspecto
         this._dataGrid.reset();
 
         this._pendingRecords = [];
+        this._resourceDataGridNodeMap.clear();
     }
 
     // TimelineDataGrid sort delegate
@@ -209,12 +210,19 @@ WebInspector.NetworkTimelineView = class NetworkTimelineView extends WebInspecto
     {
         this.endTime = Math.min(this.endTime, this.currentTime);
 
+        let oldZeroTime = this._timelineRuler.zeroTime;
+        let oldStartTime = this._timelineRuler.startTime;
+        let oldEndTime = this._timelineRuler.endTime;
+
         this._timelineRuler.zeroTime = this.zeroTime;
         this._timelineRuler.startTime = this.startTime;
         this._timelineRuler.endTime = this.endTime;
 
-        for (let dataGridNode of this._resourceDataGridNodeMap.values())
-            dataGridNode.refreshGraph();
+        // We only need to refresh the graphs when the any of the times change.
+        if (this.zeroTime !== oldZeroTime || this.startTime !== oldStartTime || this.endTime !== oldEndTime) {
+            for (let dataGridNode of this._resourceDataGridNodeMap.values())
+                dataGridNode.refreshGraph();
+        }
 
         this._processPendingRecords();
     }
index fd5c4b2..5049912 100644 (file)
@@ -618,6 +618,9 @@ WebInspector.TimelineRecordingContentView = class TimelineRecordingContentView e
 
     _recordingReset(event)
     {
+        for (let timelineView of this._timelineViewMap.values())
+            timelineView.reset();
+
         this._currentTime = NaN;
         this._discontinuityStartTime = NaN;
 
@@ -635,8 +638,6 @@ WebInspector.TimelineRecordingContentView = class TimelineRecordingContentView e
 
         this._timelineOverview.reset();
         this._overviewTimelineView.reset();
-        for (var timelineView of this._timelineViewMap.values())
-            timelineView.reset();
         this._clearTimelineNavigationItem.enabled = false;
     }