Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (183763 => 183764)
--- trunk/Source/WebInspectorUI/ChangeLog 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/ChangeLog 2015-05-04 20:22:55 UTC (rev 183764)
@@ -1,5 +1,47 @@
2015-05-04 Timothy Hatcher <[email protected]>
+ Web Inspector: Allow closing and reopening the Timelines tab
+ https://bugs.webkit.org/show_bug.cgi?id=144520
+
+ Reviewed by Joseph Pecoraro.
+
+ * UserInterface/Base/Main.js:
+ (WebInspector._updateNewTabButtonState):
+ * UserInterface/Controllers/TimelineManager.js:
+ (WebInspector.TimelineManager): No need for a delay now. Call reset().
+ (WebInspector.TimelineManager.prototype.reset):
+ (WebInspector.TimelineManager.delayedWork): Deleted.
+ * UserInterface/Views/ContentBrowserTabContentView.js:
+ (WebInspector.ContentBrowserTabContentView):
+ (WebInspector.ContentBrowserTabContentView.prototype.closed):
+ * UserInterface/Views/LayoutTimelineView.js:
+ (WebInspector.LayoutTimelineView.prototype.closed): Added. Fixed leak.
+ * UserInterface/Views/NetworkTimelineView.js:
+ (WebInspector.NetworkTimelineView.prototype.closed): Added. Fixed leak.
+ * UserInterface/Views/NewTabContentView.js:
+ (WebInspector.NewTabContentView): Added Timelines.
+ * UserInterface/Views/OverviewTimelineView.js:
+ (WebInspector.OverviewTimelineView.prototype.closed): Added. Fixed leak.
+ * UserInterface/Views/RenderingFrameTimelineView.js:
+ (WebInspector.RenderingFrameTimelineView.prototype.closed): Added. Fixed leak.
+ * UserInterface/Views/ScriptTimelineView.js:
+ (WebInspector.ScriptTimelineView.prototype.closed):
+ * UserInterface/Views/SearchTabContentView.js:
+ (WebInspector.SearchTabContentView.prototype.closed): Deleted. Made generic
+ in ContentBrowserTabContentView.prototype.closed.
+ * UserInterface/Views/TabBrowser.js:
+ (WebInspector.TabBrowser.prototype._tabBarItemSelected): Fix a potential exception
+ when selectedTabBarItem is null.
+ * UserInterface/Views/TimelineSidebarPanel.js:
+ (WebInspector.TimelineSidebarPanel):
+ (WebInspector.TimelineSidebarPanel.prototype.closed):
+ (WebInspector.TimelineSidebarPanel._recordingCreated): Call _addRecording.
+ (WebInspector.TimelineSidebarPanel._addRecording): Added.
+ * UserInterface/Views/TimelineTabContentView.js:
+ (WebInspector.TimelineTabContentView):
+
+2015-05-04 Timothy Hatcher <[email protected]>
+
Web Inspector: Switching recordings in the Timeline navigation bar is broken
https://bugs.webkit.org/show_bug.cgi?id=144519
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -430,7 +430,8 @@
WebInspector._updateNewTabButtonState = function(event)
{
var newTabAllowed = this.isNewTabWithTypeAllowed(WebInspector.ConsoleTabContentView.Type) || this.isNewTabWithTypeAllowed(WebInspector.ElementsTabContentView.Type)
- || this.isNewTabWithTypeAllowed(WebInspector.ResourcesTabContentView.Type) || this.isNewTabWithTypeAllowed(WebInspector.StorageTabContentView.Type);
+ || this.isNewTabWithTypeAllowed(WebInspector.ResourcesTabContentView.Type) || this.isNewTabWithTypeAllowed(WebInspector.StorageTabContentView.Type)
+ || this.isNewTabWithTypeAllowed(WebInspector.TimelineTabContentView.Type);
this.tabBar.newTabItem.disabled = !newTabAllowed;
};
Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -33,25 +33,26 @@
WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this);
- this._recordings = [];
- this._activeRecording = null;
this._isCapturing = false;
+ this._boundStopCapturing = this.stopCapturing.bind(this);
- this._nextRecordingIdentifier = 1;
+ this.reset();
+ }
- this._boundStopCapturing = this.stopCapturing.bind(this);
+ // Public
- function delayedWork()
- {
- this._loadNewRecording();
- }
+ reset()
+ {
+ if (this._isCapturing)
+ this.stopCapturing();
- // Allow other code to set up listeners before firing the initial RecordingLoaded event.
- setTimeout(delayedWork.bind(this), 0);
+ this._recordings = [];
+ this._activeRecording = null;
+ this._nextRecordingIdentifier = 1;
+
+ this._loadNewRecording();
}
- // Public
-
// The current recording that new timeline records will be appended to, if any.
get activeRecording()
{
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -41,6 +41,10 @@
this._contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange, this.showDetailsSidebarPanels, this);
this._contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
+ // If any content views were shown during sidebar construction, contentBrowserTreeElementForRepresentedObject() would have returned null.
+ // Explicitly update the path for the navigation bar to prevent it from showing up as blank.
+ this._contentBrowser.updateHierarchicalPathForCurrentContentView();
+
if (navigationSidebarPanel) {
var showToolTip = WebInspector.UIString("Show the navigation sidebar (%s)").format(WebInspector.navigationSidebarKeyboardShortcut.displayName);
var hideToolTip = WebInspector.UIString("Hide the navigation sidebar (%s)").format(WebInspector.navigationSidebarKeyboardShortcut.displayName);
@@ -111,6 +115,9 @@
WebInspector.navigationSidebar.removeEventListener(null, null, this);
WebInspector.detailsSidebar.removeEventListener(null, null, this);
+ if (this.navigationSidebarPanel && typeof this.navigationSidebarPanel.closed === "function")
+ this.navigationSidebarPanel.closed();
+
this._contentBrowser.contentViewContainer.closeAllContentViews();
},
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -123,6 +123,12 @@
WebInspector.ContentView.prototype.hidden.call(this);
},
+ closed: function()
+ {
+ console.assert(this.representedObject instanceof WebInspector.Timeline);
+ this.representedObject.removeEventListener(null, null, this);
+ },
+
filterDidChange: function()
{
WebInspector.TimelineView.prototype.filterDidChange.call(this);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -125,6 +125,12 @@
WebInspector.ContentView.prototype.hidden.call(this);
},
+ closed: function()
+ {
+ console.assert(this.representedObject instanceof WebInspector.Timeline);
+ this.representedObject.removeEventListener(null, null, this);
+ },
+
updateLayout: function()
{
WebInspector.TimelineView.prototype.updateLayout.call(this);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -32,6 +32,7 @@
var allowedNewTabs = [
{image: "Images/Elements.svg", title: WebInspector.UIString("Elements"), type: WebInspector.ElementsTabContentView.Type},
{image: "Images/Resources.svg", title: WebInspector.UIString("Resources"), type: WebInspector.ResourcesTabContentView.Type},
+ {image: "Images/Timeline.svg", title: WebInspector.UIString("Timelines"), type: WebInspector.TimelineTabContentView.Type},
{image: "Images/Storage.svg", title: WebInspector.UIString("Storage"), type: WebInspector.StorageTabContentView.Type},
{image: "Images/Console.svg", title: WebInspector.UIString("Console"), type: WebInspector.ConsoleTabContentView.Type}
];
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -88,6 +88,12 @@
this._treeOutlineDataGridSynchronizer.synchronize();
},
+ closed: function()
+ {
+ this._networkTimeline.removeEventListener(null, null, this);
+ this._recording.removeEventListener(null, null, this);
+ },
+
updateLayout: function()
{
WebInspector.TimelineView.prototype.updateLayout.call(this);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -96,6 +96,12 @@
WebInspector.ContentView.prototype.hidden.call(this);
},
+ closed: function()
+ {
+ console.assert(this.representedObject instanceof WebInspector.Timeline);
+ this.representedObject.removeEventListener(null, null, this);
+ },
+
updateLayout: function()
{
WebInspector.TimelineView.prototype.updateLayout.call(this);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -101,6 +101,12 @@
WebInspector.ContentView.prototype.hidden.call(this);
},
+ closed: function()
+ {
+ console.assert(this.representedObject instanceof WebInspector.Timeline);
+ this.representedObject.removeEventListener(null, null, this);
+ },
+
updateLayout: function()
{
WebInspector.TimelineView.prototype.updateLayout.call(this);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -54,13 +54,6 @@
setTimeout(this.focusSearchField.bind(this));
},
- closed: function()
- {
- WebInspector.ContentBrowserTabContentView.prototype.closed.call(this);
-
- this.navigationSidebarPanel.closed();
- },
-
canShowRepresentedObject: function(representedObject)
{
return representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.DOMTree;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -188,7 +188,7 @@
_tabBarItemSelected(event)
{
- var tabContentView = this._tabBar.selectedTabBarItem.representedObject;
+ var tabContentView = this._tabBar.selectedTabBarItem ? this._tabBar.selectedTabBarItem.representedObject : null;
if (tabContentView) {
this._recentTabContentViews.remove(tabContentView);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -147,6 +147,14 @@
this.contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStarted, this._capturingStarted, this);
WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, this._capturingStopped, this);
+
+ for (var recording of WebInspector.timelineManager.recordings)
+ this._addRecording(recording);
+
+ this._recordingCountChanged();
+
+ if (WebInspector.timelineManager.activeRecording)
+ this._recordingLoaded();
}
// Public
@@ -162,6 +170,15 @@
this._refreshFrameSelectionChart();
}
+ closed()
+ {
+ WebInspector.showReplayInterfaceSetting.removeEventListener(null, null, this);
+ WebInspector.replayManager.removeEventListener(null, null, this);
+ WebInspector.timelineManager.removeEventListener(null, null, this);
+
+ WebInspector.timelineManager.reset();
+ }
+
get viewMode()
{
return this._viewMode;
@@ -446,14 +463,17 @@
_recordingCreated(event)
{
- var recording = event.data.recording;
+ this._addRecording(event.data.recording)
+ this._recordingCountChanged();
+ }
+
+ _addRecording(recording)
+ {
console.assert(recording instanceof WebInspector.TimelineRecording, recording);
var recordingTreeElement = new WebInspector.GeneralTreeElement(WebInspector.TimelineSidebarPanel.StopwatchIconStyleClass, recording.displayName, null, recording);
this._recordingTreeElementMap.set(recording, recordingTreeElement);
this._recordingsTreeOutline.appendChild(recordingTreeElement);
-
- this._recordingCountChanged();
}
_recordingCountChanged()
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js (183763 => 183764)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js 2015-05-04 20:11:58 UTC (rev 183763)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js 2015-05-04 20:22:55 UTC (rev 183764)
@@ -28,9 +28,6 @@
var tabBarItem = new WebInspector.TabBarItem("Images/Timeline.svg", WebInspector.UIString("Timelines"));
var detailsSidebarPanels = [WebInspector.resourceDetailsSidebarPanel, WebInspector.probeDetailsSidebarPanel];
- // FIME: Until TimelineSidebarPanel supports instantiating after inspector launch, disable closing.
- tabBarItem.hideCloseButton = true;
-
WebInspector.ContentBrowserTabContentView.call(this, identifier || "timeline", "timeline", tabBarItem, WebInspector.TimelineSidebarPanel, detailsSidebarPanels);
};