Title: [184429] trunk/Source/WebInspectorUI
Revision
184429
Author
[email protected]
Date
2015-05-15 20:47:09 -0700 (Fri, 15 May 2015)

Log Message

Web Inspector: empty timeline should not use previous timeline's zoom interval
https://bugs.webkit.org/show_bug.cgi?id=132754

Reviewed by Joseph Pecoraro.

When a timeline recording is started in response to a provisional load, TimelineManager should check whether
the main resource url is changing before loading a new timeline recording. If the main resource is changing,
set the selection start, selection duration, and duration-per-pixel settings of the TimelineOverview to their
default values.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager):
(WebInspector.TimelineManager.prototype.isCapturingPageReload):
(WebInspector.TimelineManager.prototype.capturingStopped):
(WebInspector.TimelineManager.prototype.pageDidLoad):
(WebInspector.TimelineManager.prototype._startAutoCapturing):
Added a property for checking whether auto capture was triggered by a page reload.

* UserInterface/Views/LinearTimelineOverview.js:
(WebInspector.LinearTimelineOverview):
Increase default selection time to 15 seconds.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview):
Reset selection and zoom if TimelineManager isn't capturing in response to a page reload.

(WebInspector.TimelineOverview.prototype.reset):
Reset selection and zoom.

(WebInspector.TimelineOverview.prototype._timeRangeSelectionChanged):
(WebInspector.TimelineOverview.prototype._resetSelection):
Added a helper function for resetting selection and zoom to their default values.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (184428 => 184429)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-05-16 03:46:25 UTC (rev 184428)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-05-16 03:47:09 UTC (rev 184429)
@@ -1,5 +1,40 @@
 2015-05-15  Matt Baker  <[email protected]>
 
+        Web Inspector: empty timeline should not use previous timeline's zoom interval
+        https://bugs.webkit.org/show_bug.cgi?id=132754
+
+        Reviewed by Joseph Pecoraro.
+
+        When a timeline recording is started in response to a provisional load, TimelineManager should check whether
+        the main resource url is changing before loading a new timeline recording. If the main resource is changing,
+        set the selection start, selection duration, and duration-per-pixel settings of the TimelineOverview to their
+        default values.
+
+        * UserInterface/Controllers/TimelineManager.js:
+        (WebInspector.TimelineManager):
+        (WebInspector.TimelineManager.prototype.isCapturingPageReload):
+        (WebInspector.TimelineManager.prototype.capturingStopped):
+        (WebInspector.TimelineManager.prototype.pageDidLoad):
+        (WebInspector.TimelineManager.prototype._startAutoCapturing):
+        Added a property for checking whether auto capture was triggered by a page reload.
+
+        * UserInterface/Views/LinearTimelineOverview.js:
+        (WebInspector.LinearTimelineOverview):
+        Increase default selection time to 15 seconds.
+
+        * UserInterface/Views/TimelineOverview.js:
+        (WebInspector.TimelineOverview):
+        Reset selection and zoom if TimelineManager isn't capturing in response to a page reload.
+
+        (WebInspector.TimelineOverview.prototype.reset):
+        Reset selection and zoom.
+
+        (WebInspector.TimelineOverview.prototype._timeRangeSelectionChanged):
+        (WebInspector.TimelineOverview.prototype._resetSelection):
+        Added a helper function for resetting selection and zoom to their default values.
+
+2015-05-15  Matt Baker  <[email protected]>
+
         Web Inspector: Timeline data grid displays wrong records after switching between Timelines/Frames mode
         https://bugs.webkit.org/show_bug.cgi?id=145084
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (184428 => 184429)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2015-05-16 03:46:25 UTC (rev 184428)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2015-05-16 03:47:09 UTC (rev 184429)
@@ -34,6 +34,8 @@
         WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this);
 
         this._isCapturing = false;
+        this._isCapturingPageReload = false;
+        this._autoCapturingMainResource = null;
         this._boundStopCapturing = this.stopCapturing.bind(this);
 
         this.reset();
@@ -70,6 +72,11 @@
         return this._isCapturing;
     }
 
+    isCapturingPageReload()
+    {
+        return this._isCapturingPageReload;
+    }
+
     startCapturing(shouldCreateRecording)
     {
         console.assert(!this._isCapturing, "TimelineManager is already capturing.");
@@ -146,6 +153,7 @@
         }
 
         this._isCapturing = false;
+        this._isCapturingPageReload = false;
         this._autoCapturingMainResource = null;
 
         this.dispatchEventToListeners(WebInspector.TimelineManager.Event.CapturingStopped);
@@ -164,8 +172,12 @@
         }.bind(this));
     }
 
+    // Protected
+
     pageDidLoad(timestamp)
     {
+        // Called from WebInspector.PageObserver.
+
         if (isNaN(WebInspector.frameResourceManager.mainFrame.loadEventTimestamp))
             WebInspector.frameResourceManager.mainFrame.markLoadEvent(this.activeRecording.computeElapsedTime(timestamp));
     }
@@ -472,6 +484,9 @@
         if (mainResource === this._autoCapturingMainResource)
             return false;
 
+        var oldMainResource = event.target.mainResource || null;
+        this._isCapturingPageReload = oldMainResource !== null && oldMainResource.url ="" mainResource.url;
+
         if (this._isCapturing)
             this.stopCapturing();
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LinearTimelineOverview.js (184428 => 184429)


--- trunk/Source/WebInspectorUI/UserInterface/Views/LinearTimelineOverview.js	2015-05-16 03:46:25 UTC (rev 184428)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LinearTimelineOverview.js	2015-05-16 03:47:09 UTC (rev 184429)
@@ -30,7 +30,7 @@
     var defaultSettingsValues = {
         durationPerPixel: 0.01,
         selectionStartValue: 0,
-        selectionDuration: 5
+        selectionDuration: 15
     };
 
     WebInspector.TimelineOverview.call(this, "linear", timelineRecording, 0.0001, 60, defaultSettingsValues);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (184428 => 184429)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2015-05-16 03:46:25 UTC (rev 184428)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2015-05-16 03:47:09 UTC (rev 184429)
@@ -60,9 +60,10 @@
     this._scrollWidthSizer.className = WebInspector.TimelineOverview.ScrollWidthSizerStyleClassName;
     this._scrollContainerElement.appendChild(this._scrollWidthSizer);
 
-    this._durationPerPixelSetting = new WebInspector.Setting(identifier + "-timeline-overview-duration-per-pixel", defaultSettingsValues.durationPerPixel);
-    this._selectionStartValueSetting = new WebInspector.Setting(identifier + "-timeline-overview-selection-start-value", defaultSettingsValues.selectionStartValue);
-    this._selectionDurationSetting = new WebInspector.Setting(identifier + "-timeline-overview-selection-duration", defaultSettingsValues.selectionDuration);
+    this._defaultSettingsValues = defaultSettingsValues;
+    this._durationPerPixelSetting = new WebInspector.Setting(identifier + "-timeline-overview-duration-per-pixel", this._defaultSettingsValues.durationPerPixel);
+    this._selectionStartValueSetting = new WebInspector.Setting(identifier + "-timeline-overview-selection-start-value", this._defaultSettingsValues.selectionStartValue);
+    this._selectionDurationSetting = new WebInspector.Setting(identifier + "-timeline-overview-selection-duration", this._defaultSettingsValues.selectionDuration);
 
     this._startTime = 0;
     this._currentTime = 0;
@@ -79,6 +80,9 @@
 
     for (var timeline of this._recording.timelines.values())
         this._timelineAdded(timeline);
+
+    if (!WebInspector.timelineManager.isCapturingPageReload())
+        this._resetSelection();
 };
 
 WebInspector.TimelineOverview.StyleClassName = "timeline-overview";
@@ -245,6 +249,8 @@
     {
         for (var timelineOverviewGraph of this._timelineOverviewGraphsMap.values())
             timelineOverviewGraph.reset();
+
+        this._resetSelection();
     },
 
     addMarker: function(marker)
@@ -442,5 +448,12 @@
         this._selectionDurationSetting.value = this.selectionDuration;
 
         this.dispatchEventToListeners(WebInspector.TimelineOverview.Event.TimeRangeSelectionChanged);
-    }
+    },
+
+    _resetSelection: function()
+    {
+        this.secondsPerPixel = this._defaultSettingsValues.durationPerPixel;
+        this.selectionStartTime = this._defaultSettingsValues.selectionStartValue;
+        this.selectionDuration = this._defaultSettingsValues.selectionDuration;
+    },
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to