Web Inspector: event dividers do not update timeline boundaries.
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Sep 2011 15:22:32 +0000 (15:22 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Sep 2011 15:22:32 +0000 (15:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=67932

* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkLogView.prototype._onLoadEventFired):
(WebInspector.NetworkLogView.prototype._domContentLoadedEventFired):
(WebInspector.NetworkLogView.prototype.refresh):
(WebInspector.NetworkTimeCalculator.prototype.updateBoundariesForEventTime):

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/NetworkPanel.js

index 19090ed..371efa6 100644 (file)
@@ -1,3 +1,14 @@
+2011-09-12  Pavel Feldman  <pfeldman@google.com>
+
+        Web Inspector: event dividers do not update timeline boundaries.
+        https://bugs.webkit.org/show_bug.cgi?id=67932
+
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkLogView.prototype._onLoadEventFired):
+        (WebInspector.NetworkLogView.prototype._domContentLoadedEventFired):
+        (WebInspector.NetworkLogView.prototype.refresh):
+        (WebInspector.NetworkTimeCalculator.prototype.updateBoundariesForEventTime):
+
 2011-09-12  Kentaro Hara  <haraken@google.com>
 
         Implement a WebKitAnimationEvent constructor for V8
index 31cd48f..5463d0b 100644 (file)
@@ -627,14 +627,15 @@ WebInspector.NetworkLogView.prototype = {
     _onLoadEventFired: function(event)
     {
         this._mainResourceLoadTime = event.data || -1;
-        // Update the dividers to draw the new line
-        this._updateDividersIfNeeded(true);
+        // Schedule refresh to update boundaries and draw the new line.
+        this._scheduleRefresh(true);
     },
 
     _domContentLoadedEventFired: function(event)
     {
         this._mainResourceDOMContentTime = event.data || -1;
-        this._updateDividersIfNeeded(true);
+        // Schedule refresh to update boundaries and draw the new line.
+        this._scheduleRefresh(true);
     },
 
     wasShown: function()
@@ -661,6 +662,10 @@ WebInspector.NetworkLogView.prototype = {
         var wasScrolledToLastRow = this._dataGrid.isScrolledToLastRow();
         var staleItemsLength = this._staleResources.length;
         var boundariesChanged = false;
+        if (this.calculator.updateBoundariesForEventTime) {
+            boundariesChanged = this.calculator.updateBoundariesForEventTime(this._mainResourceLoadTime) || boundariesChanged;
+            boundariesChanged = this.calculator.updateBoundariesForEventTime(this._mainResourceDOMContentTime) || boundariesChanged;
+        }
 
         for (var i = 0; i < staleItemsLength; ++i) {
             var resource = this._staleResources[i];
@@ -1670,6 +1675,18 @@ WebInspector.NetworkTimeCalculator.prototype = {
         return 0;
     },
 
+    updateBoundariesForEventTime: function(eventTime)
+    {
+        if (eventTime === -1 || this.startAtZero)
+            return false;
+
+        if (typeof this.maximumBoundary === "undefined" || eventTime > this.maximumBoundary) {
+            this.maximumBoundary = eventTime;
+            return true;
+        }
+        return false;
+    },
+
     computeBarGraphLabels: function(resource)
     {
         var rightLabel = "";