<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[183134] trunk/Source/WebInspectorUI</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/183134">183134</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-22 14:12:40 -0700 (Wed, 22 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: clicking Timelines tree view nodes should not change the current content view
https://bugs.webkit.org/show_bug.cgi?id=132202

Patch by Matt Baker &lt;mattbaker@apple.com&gt; on 2015-04-22
Reviewed by Brian Burg.

TimelineSidebarPanel now prevents timeline views from switching to another content view while the content
browser is showing the TimelineRecordingContentView. Code responsible for creating and updating the tree
element close button, which was duplicated in multiple derived TimelineView classes, has been moved to the
TimelineView base class.

* UserInterface/Views/LayoutTimelineView.js:
Updated name of location column, which was broken in a recent patch.
(WebInspector.LayoutTimelineView.prototype.treeElementDeselected):
(WebInspector.LayoutTimelineView.prototype.treeElementSelected):
Added overrides of new base class methods to handle view-specific highlight logic.
(WebInspector.LayoutTimelineView.prototype._treeElementDeselected): Deleted.
(WebInspector.LayoutTimelineView.prototype._treeElementSelected): Deleted.
(WebInspector.LayoutTimelineView.prototype._updateTreeElementWithCloseButton): Deleted.
(WebInspector.LayoutTimelineView.prototype._closeStatusButtonClicked): Deleted.
Removed tree element close button logic.

* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype.showContentViewForTreeElement):
(WebInspector.NetworkTimelineView.prototype.treeElementSelected):
Added overrides of new base class methods.
(WebInspector.NetworkTimelineView.prototype._treeElementDeselected): Deleted.
(WebInspector.NetworkTimelineView.prototype._treeElementSelected): Deleted.
Removed tree element close button logic.

* UserInterface/Views/RenderingFrameTimelineView.js:
(WebInspector.RenderingFrameTimelineView.prototype.showContentViewForTreeElement):
(WebInspector.RenderingFrameTimelineView.prototype.treeElementSelected):
Added overrides of new base class methods.

* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype.get data):
(WebInspector.ResourceTimelineDataGridNode.prototype.createCellContent):
Removed unused Name column and added &quot;go to&quot; button to the Domain column to show the selected resource.

* UserInterface/Views/ScriptTimelineView.js:
(WebInspector.ScriptTimelineView):
(WebInspector.ScriptTimelineView.prototype.showContentViewForTreeElement):
(WebInspector.ScriptTimelineView.prototype.treeElementSelected):
Added overrides of new base class methods.
(WebInspector.ScriptTimelineView.prototype._dataGridNodeSelected):
(WebInspector.ScriptTimelineView.prototype._treeElementDeselected): Deleted.
(WebInspector.ScriptTimelineView.prototype._treeElementSelected): Deleted.
(WebInspector.ScriptTimelineView.prototype._updateTreeElementWithCloseButton): Deleted.
(WebInspector.ScriptTimelineView.prototype._closeStatusButtonClicked): Deleted.
Removed tree element close button logic.

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.showTimelineViewForTimeline.this._timelineTreeElementMap.get select):
Prevent navigating to a different content view when showing the TimelineRecordingContentView.

* UserInterface/Views/TimelineView.js:
(WebInspector.TimelineView):
(WebInspector.TimelineView.prototype.showContentViewForTreeElement):
(WebInspector.TimelineView.prototype.treeElementDeselected):
(WebInspector.TimelineView.prototype.treeElementSelected):
Tree element selection handlers are now protected methods, which derived classes may override as needed.
(WebInspector.TimelineView.prototype.needsLayout):
(WebInspector.TimelineView.prototype._closeStatusButtonClicked):
(WebInspector.TimelineView.prototype._updateTreeElementWithCloseButton):
Encapsulated logic related to close button creation and behavior.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsRenderingFrameTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (183133 => 183134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-04-22 21:01:18 UTC (rev 183133)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-04-22 21:12:40 UTC (rev 183134)
</span><span class="lines">@@ -1,3 +1,71 @@
</span><ins>+2015-04-22  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+        Web Inspector: clicking Timelines tree view nodes should not change the current content view
+        https://bugs.webkit.org/show_bug.cgi?id=132202
+
+        Reviewed by Brian Burg.
+
+        TimelineSidebarPanel now prevents timeline views from switching to another content view while the content
+        browser is showing the TimelineRecordingContentView. Code responsible for creating and updating the tree
+        element close button, which was duplicated in multiple derived TimelineView classes, has been moved to the
+        TimelineView base class.
+
+        * UserInterface/Views/LayoutTimelineView.js:
+        Updated name of location column, which was broken in a recent patch.
+        (WebInspector.LayoutTimelineView.prototype.treeElementDeselected):
+        (WebInspector.LayoutTimelineView.prototype.treeElementSelected):
+        Added overrides of new base class methods to handle view-specific highlight logic.
+        (WebInspector.LayoutTimelineView.prototype._treeElementDeselected): Deleted.
+        (WebInspector.LayoutTimelineView.prototype._treeElementSelected): Deleted.
+        (WebInspector.LayoutTimelineView.prototype._updateTreeElementWithCloseButton): Deleted.
+        (WebInspector.LayoutTimelineView.prototype._closeStatusButtonClicked): Deleted.
+        Removed tree element close button logic.
+
+        * UserInterface/Views/NetworkTimelineView.js:
+        (WebInspector.NetworkTimelineView.prototype.showContentViewForTreeElement):
+        (WebInspector.NetworkTimelineView.prototype.treeElementSelected):
+        Added overrides of new base class methods.
+        (WebInspector.NetworkTimelineView.prototype._treeElementDeselected): Deleted.
+        (WebInspector.NetworkTimelineView.prototype._treeElementSelected): Deleted.
+        Removed tree element close button logic.
+
+        * UserInterface/Views/RenderingFrameTimelineView.js:
+        (WebInspector.RenderingFrameTimelineView.prototype.showContentViewForTreeElement):
+        (WebInspector.RenderingFrameTimelineView.prototype.treeElementSelected):
+        Added overrides of new base class methods.
+
+        * UserInterface/Views/ResourceTimelineDataGridNode.js:
+        (WebInspector.ResourceTimelineDataGridNode.prototype.get data):
+        (WebInspector.ResourceTimelineDataGridNode.prototype.createCellContent):
+        Removed unused Name column and added &quot;go to&quot; button to the Domain column to show the selected resource.
+
+        * UserInterface/Views/ScriptTimelineView.js:
+        (WebInspector.ScriptTimelineView):
+        (WebInspector.ScriptTimelineView.prototype.showContentViewForTreeElement):
+        (WebInspector.ScriptTimelineView.prototype.treeElementSelected):
+        Added overrides of new base class methods.
+        (WebInspector.ScriptTimelineView.prototype._dataGridNodeSelected):
+        (WebInspector.ScriptTimelineView.prototype._treeElementDeselected): Deleted.
+        (WebInspector.ScriptTimelineView.prototype._treeElementSelected): Deleted.
+        (WebInspector.ScriptTimelineView.prototype._updateTreeElementWithCloseButton): Deleted.
+        (WebInspector.ScriptTimelineView.prototype._closeStatusButtonClicked): Deleted.
+        Removed tree element close button logic.
+
+        * UserInterface/Views/TimelineSidebarPanel.js:
+        (WebInspector.TimelineSidebarPanel.showTimelineViewForTimeline.this._timelineTreeElementMap.get select):
+        Prevent navigating to a different content view when showing the TimelineRecordingContentView.
+
+        * UserInterface/Views/TimelineView.js:
+        (WebInspector.TimelineView):
+        (WebInspector.TimelineView.prototype.showContentViewForTreeElement):
+        (WebInspector.TimelineView.prototype.treeElementDeselected):
+        (WebInspector.TimelineView.prototype.treeElementSelected):
+        Tree element selection handlers are now protected methods, which derived classes may override as needed.
+        (WebInspector.TimelineView.prototype.needsLayout):
+        (WebInspector.TimelineView.prototype._closeStatusButtonClicked):
+        (WebInspector.TimelineView.prototype._updateTreeElementWithCloseButton):
+        Encapsulated logic related to close button creation and behavior.
+
</ins><span class="cx"> 2015-04-22  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Remove an unused index argument from Sidebar.removeSidebarPanel
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js (183133 => 183134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js        2015-04-22 21:01:18 UTC (rev 183133)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js        2015-04-22 21:12:40 UTC (rev 183134)
</span><span class="lines">@@ -29,12 +29,10 @@
</span><span class="cx"> 
</span><span class="cx">     console.assert(timeline.type === WebInspector.TimelineRecord.Type.Layout);
</span><span class="cx"> 
</span><del>-    this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
-    this.navigationSidebarTreeOutline.ondeselect = this._treeElementDeselected.bind(this);
</del><span class="cx">     this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
</span><span class="cx">     this.navigationSidebarTreeOutline.element.classList.add(WebInspector.LayoutTimelineView.TreeOutlineStyleClassName);
</span><span class="cx"> 
</span><del>-    var columns = {eventType: {}, initiatorCallFrame: {}, width: {}, height: {}, startTime: {}, totalTime: {}};
</del><ins>+    var columns = {eventType: {}, location: {}, width: {}, height: {}, startTime: {}, totalTime: {}};
</ins><span class="cx"> 
</span><span class="cx">     columns.eventType.title = WebInspector.UIString(&quot;Type&quot;);
</span><span class="cx">     columns.eventType.width = &quot;15%&quot;;
</span><span class="lines">@@ -48,8 +46,8 @@
</span><span class="cx">     columns.eventType.scopeBar = WebInspector.TimelineDataGrid.createColumnScopeBar(&quot;layout&quot;, typeToLabelMap);
</span><span class="cx">     columns.eventType.hidden = true;
</span><span class="cx"> 
</span><del>-    columns.initiatorCallFrame.title = WebInspector.UIString(&quot;Initiator&quot;);
-    columns.initiatorCallFrame.width = &quot;25%&quot;;
</del><ins>+    columns.location.title = WebInspector.UIString(&quot;Initiator&quot;);
+    columns.location.width = &quot;25%&quot;;
</ins><span class="cx"> 
</span><span class="cx">     columns.width.title = WebInspector.UIString(&quot;Width&quot;);
</span><span class="cx">     columns.width.width = &quot;8%&quot;;
</span><span class="lines">@@ -165,6 +163,23 @@
</span><span class="cx">         dataGridNode.revealAndSelect();
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    treeElementDeselected: function(treeElement)
+    {
+        WebInspector.TimelineView.prototype.treeElementDeselected.call(this, treeElement);
+
+        this._updateHighlight();
+    },
+
+    treeElementSelected: function(treeElement, selectedByUser)
+    {
+        if (this._dataGrid.shouldIgnoreSelectionEvent())
+            return;
+
+        WebInspector.TimelineView.prototype.treeElementSelected.call(this, treeElement, selectedByUser);
+
+        this._updateHighlight();
+    },
+
</ins><span class="cx">     // Private
</span><span class="cx"> 
</span><span class="cx">     _processPendingRecords: function()
</span><span class="lines">@@ -202,62 +217,6 @@
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _treeElementDeselected: function(treeElement)
-    {
-        if (treeElement.status)
-            treeElement.status = &quot;&quot;;
-
-        this._updateHighlight();
-    },
-
-    _treeElementSelected: function(treeElement, selectedByUser)
-    {
-        if (this._dataGrid.shouldIgnoreSelectionEvent())
-            return;
-
-        if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
-            return;
-
-        if (treeElement instanceof WebInspector.FolderTreeElement)
-            return;
-
-        if (!(treeElement instanceof WebInspector.TimelineRecordTreeElement)) {
-            console.error(&quot;Unknown tree element selected.&quot;);
-            return;
-        }
-
-        this._updateHighlight();
-
-        if (!treeElement.record.sourceCodeLocation) {
-            WebInspector.timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
-            return;
-        }
-
-        WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.record.sourceCodeLocation);
-        this._updateTreeElementWithCloseButton(treeElement);
-    },
-
-    _updateTreeElementWithCloseButton: function(treeElement)
-    {
-        if (this._closeStatusButton) {
-            treeElement.status = this._closeStatusButton.element;
-            return;
-        }
-
-        wrappedSVGDocument(platformImagePath(&quot;Close.svg&quot;), null, WebInspector.UIString(&quot;Close resource view&quot;), function(element) {
-            this._closeStatusButton = new WebInspector.TreeElementStatusButton(element);
-            this._closeStatusButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._closeStatusButtonClicked, this);
-            if (treeElement === this.navigationSidebarTreeOutline.selectedTreeElement)
-                this._updateTreeElementWithCloseButton(treeElement);
-        }.bind(this));
-    },
-
-    _closeStatusButtonClicked: function(event)
-    {
-        this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
-        WebInspector.timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
-    },
-
</del><span class="cx">     _updateHighlight: function()
</span><span class="cx">     {
</span><span class="cx">         var record = this._hoveredOrSelectedRecord();
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js (183133 => 183134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js        2015-04-22 21:01:18 UTC (rev 183133)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js        2015-04-22 21:12:40 UTC (rev 183134)
</span><span class="lines">@@ -29,8 +29,6 @@
</span><span class="cx"> 
</span><span class="cx">     console.assert(timeline.type === WebInspector.TimelineRecord.Type.Network);
</span><span class="cx"> 
</span><del>-    this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
-    this.navigationSidebarTreeOutline.ondeselect = this._treeElementDeselected.bind(this);    
</del><span class="cx">     this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
</span><span class="cx">     this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NetworkTimelineView.TreeOutlineStyleClassName);
</span><span class="cx"> 
</span><span class="lines">@@ -150,6 +148,17 @@
</span><span class="cx"> 
</span><span class="cx">     // Protected
</span><span class="cx"> 
</span><ins>+    showContentViewForTreeElement: function(treeElement)
+    {
+        if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
+            WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
+            return true;
+        }
+
+        console.error(&quot;Unknown tree element selected.&quot;, treeElement);
+        return false;
+    },
+
</ins><span class="cx">     treeElementPathComponentSelected: function(event)
</span><span class="cx">     {
</span><span class="cx">         var dataGridNode = this._dataGrid.dataGridNodeForTreeElement(event.data.pathComponent.generalTreeElement);
</span><span class="lines">@@ -158,6 +167,14 @@
</span><span class="cx">         dataGridNode.revealAndSelect();
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    treeElementSelected: function(treeElement, selectedByUser)
+    {
+        if (this._dataGrid.shouldIgnoreSelectionEvent())
+            return false;
+
+        WebInspector.TimelineView.prototype.treeElementSelected.call(this, treeElement, selectedByUser);
+    },
+
</ins><span class="cx">     // Private
</span><span class="cx"> 
</span><span class="cx">     _processPendingRecords: function()
</span><span class="lines">@@ -200,32 +217,6 @@
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _treeElementDeselected: function(treeElement)
-    {
-        if (treeElement.status)
-            treeElement.status = &quot;&quot;;
-    },
-
-    _treeElementSelected: function(treeElement, selectedByUser)
-    {
-        if (this._dataGrid.shouldIgnoreSelectionEvent())
-            return;
-
-        if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
-            return;
-
-        if (treeElement instanceof WebInspector.FolderTreeElement)
-            return;
-
-        if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
-            WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
-            this._updateTreeElementWithCloseButton(treeElement);
-            return;
-        }
-
-        console.error(&quot;Unknown tree element selected.&quot;);
-    },
-
</del><span class="cx">     _updateTreeElementWithCloseButton: function(treeElement)
</span><span class="cx">     {
</span><span class="cx">         if (this._closeStatusButton) {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsRenderingFrameTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js (183133 => 183134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js        2015-04-22 21:01:18 UTC (rev 183133)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js        2015-04-22 21:12:40 UTC (rev 183134)
</span><span class="lines">@@ -154,6 +154,24 @@
</span><span class="cx"> 
</span><span class="cx">     // Protected
</span><span class="cx"> 
</span><ins>+    showContentViewForTreeElement: function(treeElement)
+    {
+        if (treeElement instanceof WebInspector.ProfileNodeTreeElement &amp;&amp; treeElement.profileNode.sourceCodeLocation) {
+            WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.profileNode.sourceCodeLocation);
+            return true;
+        }
+
+        return WebInspector.TimelineView.prototype.showContentViewForTreeElement.call(this, treeElement);
+    },
+
+    treeElementSelected: function(treeElement, selectedByUser)
+    {
+        if (this._dataGrid.shouldIgnoreSelectionEvent())
+            return;
+
+        WebInspector.TimelineView.prototype.treeElementSelected.call(this, treeElement, selectedByUser);
+    },
+
</ins><span class="cx">     treeElementPathComponentSelected: function(event)
</span><span class="cx">     {
</span><span class="cx">         var dataGridNode = this._dataGrid.dataGridNodeForTreeElement(event.data.pathComponent.generalTreeElement);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceTimelineDataGridNodejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js (183133 => 183134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js        2015-04-22 21:01:18 UTC (rev 183133)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js        2015-04-22 21:12:40 UTC (rev 183134)
</span><span class="lines">@@ -75,7 +75,6 @@
</span><span class="cx">         if (!this._graphOnly) {
</span><span class="cx">             var zeroTime = this.graphDataSource ? this.graphDataSource.zeroTime : 0;
</span><span class="cx"> 
</span><del>-            data.name = WebInspector.displayNameForURL(resource.url, resource.urlComponents);
</del><span class="cx">             data.domain = WebInspector.displayNameForHost(resource.urlComponents.host);
</span><span class="cx">             data.scheme = resource.urlComponents.scheme ? resource.urlComponents.scheme.toUpperCase() : &quot;&quot;;
</span><span class="cx">             data.method = resource.requestMethod;
</span><span class="lines">@@ -106,26 +105,6 @@
</span><span class="cx">         var value = this.data[columnIdentifier];
</span><span class="cx"> 
</span><span class="cx">         switch (columnIdentifier) {
</span><del>-        case &quot;name&quot;:
-            cell.classList.add(resource.type, WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
-
-            var fragment = document.createDocumentFragment();
-
-            var goToButton = WebInspector.createGoToArrowButton();
-            goToButton.addEventListener(&quot;click&quot;, this._goToResource.bind(this));
-            fragment.appendChild(goToButton);
-
-            var icon = document.createElement(&quot;div&quot;);
-            icon.className = WebInspector.ResourceTimelineDataGridNode.IconStyleClassName;
-            fragment.appendChild(icon);
-
-            var text = document.createTextNode(value);
-            fragment.appendChild(text);
-
-            cell.title = resource.url;
-
-            return fragment;
-
</del><span class="cx">         case &quot;type&quot;:
</span><span class="cx">             return WebInspector.Resource.displayNameForType(value);
</span><span class="cx"> 
</span><span class="lines">@@ -137,8 +116,17 @@
</span><span class="cx">             return value ? WebInspector.UIString(&quot;Yes&quot;) : WebInspector.UIString(&quot;No&quot;);
</span><span class="cx"> 
</span><span class="cx">         case &quot;domain&quot;:
</span><del>-            return value || emptyValuePlaceholderString;
</del><ins>+            var fragment = document.createDocumentFragment();
</ins><span class="cx"> 
</span><ins>+            var goToButton = WebInspector.createGoToArrowButton();
+            goToButton.addEventListener(&quot;click&quot;, this._goToResource.bind(this));
+            fragment.appendChild(goToButton);
+
+            var text = document.createTextNode(value || emptyValuePlaceholderString);
+            fragment.appendChild(text);
+
+            return fragment;
+
</ins><span class="cx">         case &quot;size&quot;:
</span><span class="cx">         case &quot;transferSize&quot;:
</span><span class="cx">             return isNaN(value) ? emptyValuePlaceholderString : Number.bytesToString(value, true);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js (183133 => 183134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js        2015-04-22 21:01:18 UTC (rev 183133)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js        2015-04-22 21:12:40 UTC (rev 183134)
</span><span class="lines">@@ -29,8 +29,6 @@
</span><span class="cx"> 
</span><span class="cx">     console.assert(timeline.type === WebInspector.TimelineRecord.Type.Script);
</span><span class="cx"> 
</span><del>-    this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
-    this.navigationSidebarTreeOutline.ondeselect = this._treeElementDeselected.bind(this);
</del><span class="cx">     this.navigationSidebarTreeOutline.element.classList.add(WebInspector.ScriptTimelineView.TreeOutlineStyleClassName);
</span><span class="cx"> 
</span><span class="cx">     var columns = {location: {}, callCount: {}, startTime: {}, totalTime: {}, selfTime: {}, averageTime: {}};
</span><span class="lines">@@ -165,6 +163,16 @@
</span><span class="cx"> 
</span><span class="cx">     // Protected
</span><span class="cx"> 
</span><ins>+    showContentViewForTreeElement: function(treeElement)
+    {
+        if (treeElement instanceof WebInspector.ProfileNodeTreeElement &amp;&amp; treeElement.profileNode.sourceCodeLocation) {
+            WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.profileNode.sourceCodeLocation);
+            return true;
+        }
+
+        return WebInspector.TimelineView.prototype.showContentViewForTreeElement.call(this, treeElement);
+    },
+
</ins><span class="cx">     treeElementPathComponentSelected: function(event)
</span><span class="cx">     {
</span><span class="cx">         var dataGridNode = this._dataGrid.dataGridNodeForTreeElement(event.data.pathComponent.generalTreeElement);
</span><span class="lines">@@ -173,6 +181,14 @@
</span><span class="cx">         dataGridNode.revealAndSelect();
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    treeElementSelected: function(treeElement, selectedByUser)
+    {
+        if (this._dataGrid.shouldIgnoreSelectionEvent())
+            return false;
+
+        WebInspector.TimelineView.prototype.treeElementSelected.call(this, treeElement, selectedByUser);
+    },
+
</ins><span class="cx">     dataGridNodeForTreeElement: function(treeElement)
</span><span class="cx">     {
</span><span class="cx">         if (treeElement instanceof WebInspector.ProfileNodeTreeElement)
</span><span class="lines">@@ -244,60 +260,5 @@
</span><span class="cx">     _dataGridNodeSelected: function(event)
</span><span class="cx">     {
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
</span><del>-    },
-
-    _treeElementDeselected: function(treeElement)
-    {
-        if (treeElement.status)
-            treeElement.status = &quot;&quot;;
-    },
-
-    _treeElementSelected: function(treeElement, selectedByUser)
-    {
-        if (this._dataGrid.shouldIgnoreSelectionEvent())
-            return;
-
-        if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
-            return;
-
-        if (treeElement instanceof WebInspector.FolderTreeElement)
-            return;
-
-        var sourceCodeLocation = null;
-        if (treeElement instanceof WebInspector.TimelineRecordTreeElement)
-            sourceCodeLocation = treeElement.record.sourceCodeLocation;
-        else if (treeElement instanceof WebInspector.ProfileNodeTreeElement)
-            sourceCodeLocation = treeElement.profileNode.sourceCodeLocation;
-        else
-            console.error(&quot;Unknown tree element selected.&quot;);
-
-        if (!sourceCodeLocation) {
-            WebInspector.timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
-            return;
-        }
-
-        WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
-        this._updateTreeElementWithCloseButton(treeElement);
-    },
-
-    _updateTreeElementWithCloseButton: function(treeElement)
-    {
-        if (this._closeStatusButton) {
-            treeElement.status = this._closeStatusButton.element;
-            return;
-        }
-
-        wrappedSVGDocument(platformImagePath(&quot;Close.svg&quot;), null, WebInspector.UIString(&quot;Close resource view&quot;), function(element) {
-            this._closeStatusButton = new WebInspector.TreeElementStatusButton(element);
-            this._closeStatusButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._closeStatusButtonClicked, this);
-            if (treeElement === this.navigationSidebarTreeOutline.selectedTreeElement)
-                this._updateTreeElementWithCloseButton(treeElement);
-        }.bind(this));
-    },
-
-    _closeStatusButtonClicked: function(event)
-    {
-        this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
-        WebInspector.timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
</del><span class="cx">     }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js (183133 => 183134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js        2015-04-22 21:01:18 UTC (rev 183133)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js        2015-04-22 21:12:40 UTC (rev 183134)
</span><span class="lines">@@ -274,6 +274,9 @@
</span><span class="cx"> 
</span><span class="cx">     canShowDifferentContentView()
</span><span class="cx">     {
</span><ins>+        if (WebInspector.contentBrowser.currentContentView instanceof WebInspector.TimelineRecordingContentView)
+            return false;
+
</ins><span class="cx">         return !this.restoringState || !this._restoredShowingTimelineRecordingContentView;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js (183133 => 183134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js        2015-04-22 21:01:18 UTC (rev 183133)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js        2015-04-22 21:12:40 UTC (rev 183134)
</span><span class="lines">@@ -32,6 +32,9 @@
</span><span class="cx">     WebInspector.ContentView.call(this, representedObject);
</span><span class="cx"> 
</span><span class="cx">     this._contentTreeOutline = WebInspector.timelineSidebarPanel.createContentTreeOutline();
</span><ins>+    this._contentTreeOutline.onselect = this.treeElementSelected.bind(this);
+    this._contentTreeOutline.ondeselect = this.treeElementDeselected.bind(this);
+
</ins><span class="cx">     this.element.classList.add(WebInspector.TimelineView.StyleClassName);
</span><span class="cx"> 
</span><span class="cx">     this._zeroTime = 0;
</span><span class="lines">@@ -180,11 +183,54 @@
</span><span class="cx"> 
</span><span class="cx">     // Protected
</span><span class="cx"> 
</span><ins>+    showContentViewForTreeElement: function(treeElement)
+    {
+        // Implemented by sub-classes if needed.
+
+        if (!(treeElement instanceof WebInspector.TimelineRecordTreeElement)) {
+            console.error(&quot;Unknown tree element selected.&quot;, treeElement);
+            return false;
+        }
+
+        var sourceCodeLocation = treeElement.record.sourceCodeLocation;
+        if (!sourceCodeLocation) {
+            WebInspector.timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
+            return true;
+        }
+
+        WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
+        return true;
+    },
+
</ins><span class="cx">     treeElementPathComponentSelected: function(event)
</span><span class="cx">     {
</span><span class="cx">         // Implemented by sub-classes if needed.
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    treeElementDeselected: function(treeElement)
+    {
+        // Implemented by sub-classes if needed.
+
+        if (this._closeStatusButton &amp;&amp; treeElement.status === this._closeStatusButton.element)
+            treeElement.status = &quot;&quot;;
+    },
+
+    treeElementSelected: function(treeElement, selectedByUser)
+    {
+        // Implemented by sub-classes if needed.
+
+        if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
+            return;
+
+        if (treeElement instanceof WebInspector.FolderTreeElement)
+            return;
+
+        if (!this.showContentViewForTreeElement(treeElement))
+            return;
+
+        this._updateTreeElementWithCloseButton(treeElement);
+    },
+
</ins><span class="cx">     needsLayout: function()
</span><span class="cx">     {
</span><span class="cx">         if (!this.visible)
</span><span class="lines">@@ -194,5 +240,30 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         this._scheduledLayoutUpdateIdentifier = requestAnimationFrame(this.updateLayout.bind(this));
</span><ins>+    },
+
+    // Private
+
+    _closeStatusButtonClicked: function(event)
+    {
+        if (this.navigationSidebarTreeOutline.selectedTreeElement)
+            this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
+
+        WebInspector.timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
+    },
+
+    _updateTreeElementWithCloseButton: function(treeElement)
+    {
+        if (this._closeStatusButton) {
+            treeElement.status = this._closeStatusButton.element;
+            return;
+        }
+
+        wrappedSVGDocument(platformImagePath(&quot;Close.svg&quot;), null, WebInspector.UIString(&quot;Close resource view&quot;), function(element) {
+            this._closeStatusButton = new WebInspector.TreeElementStatusButton(element);
+            this._closeStatusButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._closeStatusButtonClicked, this);
+            if (treeElement === this.navigationSidebarTreeOutline.selectedTreeElement)
+                this._updateTreeElementWithCloseButton(treeElement);
+        }.bind(this));
</ins><span class="cx">     }
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>