Title: [185454] trunk/Source/WebInspectorUI
Revision
185454
Author
[email protected]
Date
2015-06-11 08:24:55 -0700 (Thu, 11 Jun 2015)

Log Message

Web Inspector: Wrong overview graph shown after switching from Frames to Timelines
https://bugs.webkit.org/show_bug.cgi?id=145778

Reviewed by Timothy Hatcher.

TimelineSidebarPanel stores a reference to the selected timeline before switching to the Rendering Frames view,
which is used to restore the tree selection, overview graph, and content views when switching back to the
standard Timelines view. However if another recording is created before switching, the previously selected
timeline tracked by the sidebar cannot be restored, since it doesn't belong to the active recording.

This is addressed by storing the previously selected timeline type, rather than the timeline object itself.
The type is also updated whenever the selected timeline in the tree outline changes, ensuring that the correct
timeline will always be restored.

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype.treeElementForRepresentedObject.get if.get if):
(WebInspector.TimelineSidebarPanel.get else): Deleted.
(WebInspector.TimelineSidebarPanel.prototype.treeElementForRepresentedObject.get if): Deleted.
(WebInspector.TimelineSidebarPanel.prototype.treeElementForRepresentedObject): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (185453 => 185454)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-06-11 15:21:07 UTC (rev 185453)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-06-11 15:24:55 UTC (rev 185454)
@@ -1,3 +1,25 @@
+2015-06-11  Matt Baker  <[email protected]>
+
+        Web Inspector: Wrong overview graph shown after switching from Frames to Timelines
+        https://bugs.webkit.org/show_bug.cgi?id=145778
+
+        Reviewed by Timothy Hatcher.
+
+        TimelineSidebarPanel stores a reference to the selected timeline before switching to the Rendering Frames view,
+        which is used to restore the tree selection, overview graph, and content views when switching back to the
+        standard Timelines view. However if another recording is created before switching, the previously selected
+        timeline tracked by the sidebar cannot be restored, since it doesn't belong to the active recording.
+
+        This is addressed by storing the previously selected timeline type, rather than the timeline object itself.
+        The type is also updated whenever the selected timeline in the tree outline changes, ensuring that the correct
+        timeline will always be restored.
+
+        * UserInterface/Views/TimelineSidebarPanel.js:
+        (WebInspector.TimelineSidebarPanel.prototype.treeElementForRepresentedObject.get if.get if):
+        (WebInspector.TimelineSidebarPanel.get else): Deleted.
+        (WebInspector.TimelineSidebarPanel.prototype.treeElementForRepresentedObject.get if): Deleted.
+        (WebInspector.TimelineSidebarPanel.prototype.treeElementForRepresentedObject): Deleted.
+
 2015-06-08  Matt Baker  <[email protected]>
 
         Web Inspector: Clearing active Timeline recording should stop capturing

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js (185453 => 185454)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js	2015-06-11 15:21:07 UTC (rev 185453)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js	2015-06-11 15:24:55 UTC (rev 185454)
@@ -490,6 +490,8 @@
         console.assert(timeline instanceof WebInspector.Timeline, timeline);
         console.assert(this._displayedRecording.timelines.get(timeline.type) === timeline, timeline);
 
+        this._previousSelectedTimelineType = timeline.type;
+
         this._displayedContentView.showTimelineViewForTimeline(timeline);
         this.contentBrowser.showContentView(this._displayedContentView);
     }
@@ -741,15 +743,16 @@
         }
 
         if (selectedByUser) {
+            var timelineType = this._previousSelectedTimelineType;
             if (this._viewMode === WebInspector.TimelineSidebarPanel.ViewMode.RenderingFrames) {
                 if (this._timelinesTreeOutline.selectedTreeElement)
-                    this._previousTimelineSelection = this._timelinesTreeOutline.selectedTreeElement.representedObject;
+                    this._previousSelectedTimelineType = this._timelinesTreeOutline.selectedTreeElement.representedObject.type;
+                timelineType = WebInspector.TimelineRecord.Type.RenderingFrame;
+            }
 
-                console.assert(this._displayedRecording);
-                this.showTimelineViewForTimeline(this._displayedRecording.timelines.get(WebInspector.TimelineRecord.Type.RenderingFrame));
-            } else if (this._previousTimelineSelection) {
-                this.showTimelineViewForTimeline(this._previousTimelineSelection);
-                this._previousTimelineSelection = null;
+            if (timelineType) {
+                console.assert(this._displayedRecording.timelines.has(timelineType), timelineType);
+                this.showTimelineViewForTimeline(this._displayedRecording.timelines.get(timelineType));
             } else
                 this.showTimelineOverview();
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to