Title: [203986] trunk/Source/WebInspectorUI
Revision
203986
Author
[email protected]
Date
2016-08-01 14:03:44 -0700 (Mon, 01 Aug 2016)

Log Message

Web Inspector: Waterfall graph in Network tab shows too much whitespace/dead time
https://bugs.webkit.org/show_bug.cgi?id=160373

Reviewed by Timothy Hatcher.

Track the start and end time separate from the ruler to remove
leading/trailing whitespace in the graph. Also prevent network
record bars from being clipped.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
(WebInspector.NetworkGridContentView.prototype.get zeroTime):
Set equal to the ruler start time.
(WebInspector.NetworkGridContentView.prototype.reset):
Reset start and end time.
(WebInspector.NetworkGridContentView.prototype.layout):
Set the initial values for ruler start/zero time if needed.
(WebInspector.NetworkGridContentView.prototype._networkTimelineRecordAdded):
Set the start time if needed.
Reduce debounce from 250ms to 150ms. This prevents the current time from
exceeding the end time by as wide a margin, while keeping the current
time "timer" from being restarted too frequently.

(WebInspector.NetworkGridContentView.prototype._stopUpdatingCurrentTime):
Update the ruler end time and schedule a layout.
Add padding equal to the time needed to draw a network bar at minimum width
to prevent bars from being clipped.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (203985 => 203986)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-08-01 20:49:53 UTC (rev 203985)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-08-01 21:03:44 UTC (rev 203986)
@@ -1,3 +1,33 @@
+2016-08-01  Matt Baker  <[email protected]>
+
+        Web Inspector: Waterfall graph in Network tab shows too much whitespace/dead time
+        https://bugs.webkit.org/show_bug.cgi?id=160373
+
+        Reviewed by Timothy Hatcher.
+
+        Track the start and end time separate from the ruler to remove
+        leading/trailing whitespace in the graph. Also prevent network
+        record bars from being clipped.
+
+        * UserInterface/Views/NetworkGridContentView.js:
+        (WebInspector.NetworkGridContentView):
+        (WebInspector.NetworkGridContentView.prototype.get zeroTime):
+        Set equal to the ruler start time.
+        (WebInspector.NetworkGridContentView.prototype.reset):
+        Reset start and end time.
+        (WebInspector.NetworkGridContentView.prototype.layout):
+        Set the initial values for ruler start/zero time if needed.
+        (WebInspector.NetworkGridContentView.prototype._networkTimelineRecordAdded):
+        Set the start time if needed.
+        Reduce debounce from 250ms to 150ms. This prevents the current time from
+        exceeding the end time by as wide a margin, while keeping the current
+        time "timer" from being restarted too frequently.
+
+        (WebInspector.NetworkGridContentView.prototype._stopUpdatingCurrentTime):
+        Update the ruler end time and schedule a layout.
+        Add padding equal to the time needed to draw a network bar at minimum width
+        to prevent bars from being clipped.
+
 2016-07-29  Matt Baker  <[email protected]>
 
         Web Inspector: Inactive/active network bar segments overlap when latency is zero

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.js (203985 => 203986)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.js	2016-08-01 20:49:53 UTC (rev 203985)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.js	2016-08-01 21:03:44 UTC (rev 203986)
@@ -107,6 +107,8 @@
         this._pendingRecords = [];
         this._loadingResourceCount = 0;
         this._lastUpdateTimestamp = NaN;
+        this._startTime = NaN;
+        this._endTime = NaN;
         this._scheduledCurrentTimeUpdateIdentifier = undefined;
     }
 
@@ -116,6 +118,7 @@
     get startTime() { return this._timelineRuler.startTime; }
     get currentTime() { return this.endTime || this.startTime; }
     get endTime() { return this._timelineRuler.endTime; }
+    get zeroTime() { return this._timelineRuler.startTime; }
 
     get selectionPathComponents()
     {
@@ -127,11 +130,6 @@
         return [pathComponent];
     }
 
-    get zeroTime()
-    {
-        return WebInspector.timelineManager.persistentNetworkTimeline.startTime;
-    }
-
     get navigationItems()
     {
         return [this._clearNetworkItemsNavigationItem];
@@ -169,6 +167,8 @@
 
         this._loadingResourceCount = 0;
         this._lastUpdateTimestamp = NaN;
+        this._startTime = NaN;
+        this._endTime = NaN;
 
         this._timelineRuler.startTime = 0;
         this._timelineRuler.endTime = 0;
@@ -178,8 +178,10 @@
 
     layout()
     {
-        this._timelineRuler.zeroTime = this.zeroTime;
-        this._timelineRuler.startTime = this.zeroTime;
+        if (!isNaN(this._startTime)) {
+            this._timelineRuler.zeroTime = this._startTime;
+            this._timelineRuler.startTime = this._startTime;
+        }
 
         if (this.startTime >= this.endTime)
             return;
@@ -219,7 +221,7 @@
 
     _networkTimelineRecordAdded(event)
     {
-        var resourceTimelineRecord = event.data.record;
+        let resourceTimelineRecord = event.data.record;
         console.assert(resourceTimelineRecord instanceof WebInspector.ResourceTimelineRecord);
 
         let update = (event) => {
@@ -233,7 +235,8 @@
             if (this._loadingResourceCount)
                 return;
 
-            this.debounce(250)._stopUpdatingCurrentTime();
+            this._endTime = resourceTimelineRecord.endTime;
+            this.debounce(150)._stopUpdatingCurrentTime();
         };
 
         this._pendingRecords.push(resourceTimelineRecord);
@@ -249,8 +252,12 @@
         resource.addEventListener(WebInspector.Resource.Event.LoadingDidFail, update, this);
 
         this._loadingResourceCount++;
-        if (this._loadingResourceCount && !this._scheduledCurrentTimeUpdateIdentifier)
+        if (this._loadingResourceCount && !this._scheduledCurrentTimeUpdateIdentifier) {
+            if (isNaN(this._startTime))
+                this._startTime = resourceTimelineRecord.startTime;
+
             this._startUpdatingCurrentTime();
+        }
     }
 
     _treeElementPathComponentSelected(event)
@@ -325,6 +332,9 @@
 
         cancelAnimationFrame(this._scheduledCurrentTimeUpdateIdentifier);
         this._scheduledCurrentTimeUpdateIdentifier = undefined;
+
+        this._timelineRuler.endTime = this._endTime + WebInspector.TimelineRecordBar.MinimumWidthPixels * this.secondsPerPixel;
+        this.needsLayout();
     }
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to