<!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>[178155] 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/178155">178155</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-01-08 21:18:40 -0800 (Thu, 08 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: REGRESSION Showing debugger sidebar shouldn't change selected JS file
https://bugs.webkit.org/show_bug.cgi?id=139526

Patch by Nikita Vasilyev &lt;nvasilyev@apple.com&gt; on 2015-01-08
Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WebInspector._revealAndSelectRepresentedObjectInNavigationSidebar):
When switching to Debugger, show last selected JS or HTML resource.

(WebInspector.showSplitConsole):
(WebInspector.showFullHeightConsole):
(WebInspector.toggleConsoleView):
(WebInspector._sidebarCollapsedStateDidChange):
(WebInspector._updateContentViewForCurrentNavigationSidebar):
(WebInspector._navigationSidebarPanelSelected):
(WebInspector._contentBrowserCurrentContentViewDidChange):
(WebInspector._updateNavigationSidebarForCurrentContentView): Deleted.
* UserInterface/Views/ApplicationCacheFrameContentView.js:
(WebInspector.ApplicationCacheFrameContentView.prototype.get allowedNavigationSidebarPanels):
* UserInterface/Views/CookieStorageContentView.js:
(WebInspector.CookieStorageContentView.prototype.get allowedNavigationSidebarPanels):
* UserInterface/Views/DOMStorageContentView.js:
(WebInspector.DOMStorageContentView.prototype.get allowedNavigationSidebarPanels):
* UserInterface/Views/DOMTreeContentView.js:
(WebInspector.DOMTreeContentView.prototype.get allowedNavigationSidebarPanels):
* UserInterface/Views/DatabaseContentView.js:
(WebInspector.DatabaseContentView.prototype.get allowedNavigationSidebarPanels):
* UserInterface/Views/DatabaseTableContentView.js:
(WebInspector.DatabaseTableContentView.prototype.get allowedNavigationSidebarPanels):
* UserInterface/Views/FontResourceContentView.js:
(WebInspector.FontResourceContentView.prototype.get allowedNavigationSidebarPanels):
* UserInterface/Views/FrameDOMTreeContentView.js:
(WebInspector.FrameDOMTreeContentView.prototype.get allowedNavigationSidebarPanels):
* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype.get allowedNavigationSidebarPanels):
* UserInterface/Views/ResourceClusterContentView.js:
(WebInspector.ResourceClusterContentView.prototype.get allowedNavigationSidebarPanels):
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype.showDefaultContentView):
(WebInspector.ResourceSidebarPanel.prototype.showMainFrame):
* UserInterface/Views/Sidebar.js:
(WebInspector.Sidebar.prototype.removeSidebarPanel):
* UserInterface/Views/TimelineContentView.js:
(WebInspector.TimelineContentView.prototype.get allowedNavigationSidebarPanels):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseMainjs">trunk/Source/WebInspectorUI/UserInterface/Base/Main.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheFrameContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCookieStorageContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMStorageContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDatabaseContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTableContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFontResourceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFrameDOMTreeContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceClusterContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSidebarjs">trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2015-01-08  Nikita Vasilyev  &lt;nvasilyev@apple.com&gt;
+
+        Web Inspector: REGRESSION Showing debugger sidebar shouldn't change selected JS file
+        https://bugs.webkit.org/show_bug.cgi?id=139526
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector._revealAndSelectRepresentedObjectInNavigationSidebar):
+        When switching to Debugger, show last selected JS or HTML resource.
+
+        (WebInspector.showSplitConsole):
+        (WebInspector.showFullHeightConsole):
+        (WebInspector.toggleConsoleView):
+        (WebInspector._sidebarCollapsedStateDidChange):
+        (WebInspector._updateContentViewForCurrentNavigationSidebar):
+        (WebInspector._navigationSidebarPanelSelected):
+        (WebInspector._contentBrowserCurrentContentViewDidChange):
+        (WebInspector._updateNavigationSidebarForCurrentContentView): Deleted.
+        * UserInterface/Views/ApplicationCacheFrameContentView.js:
+        (WebInspector.ApplicationCacheFrameContentView.prototype.get allowedNavigationSidebarPanels):
+        * UserInterface/Views/CookieStorageContentView.js:
+        (WebInspector.CookieStorageContentView.prototype.get allowedNavigationSidebarPanels):
+        * UserInterface/Views/DOMStorageContentView.js:
+        (WebInspector.DOMStorageContentView.prototype.get allowedNavigationSidebarPanels):
+        * UserInterface/Views/DOMTreeContentView.js:
+        (WebInspector.DOMTreeContentView.prototype.get allowedNavigationSidebarPanels):
+        * UserInterface/Views/DatabaseContentView.js:
+        (WebInspector.DatabaseContentView.prototype.get allowedNavigationSidebarPanels):
+        * UserInterface/Views/DatabaseTableContentView.js:
+        (WebInspector.DatabaseTableContentView.prototype.get allowedNavigationSidebarPanels):
+        * UserInterface/Views/FontResourceContentView.js:
+        (WebInspector.FontResourceContentView.prototype.get allowedNavigationSidebarPanels):
+        * UserInterface/Views/FrameDOMTreeContentView.js:
+        (WebInspector.FrameDOMTreeContentView.prototype.get allowedNavigationSidebarPanels):
+        * UserInterface/Views/LogContentView.js:
+        (WebInspector.LogContentView.prototype.get allowedNavigationSidebarPanels):
+        * UserInterface/Views/ResourceClusterContentView.js:
+        (WebInspector.ResourceClusterContentView.prototype.get allowedNavigationSidebarPanels):
+        * UserInterface/Views/ResourceSidebarPanel.js:
+        (WebInspector.ResourceSidebarPanel.prototype.showDefaultContentView):
+        (WebInspector.ResourceSidebarPanel.prototype.showMainFrame):
+        * UserInterface/Views/Sidebar.js:
+        (WebInspector.Sidebar.prototype.removeSidebarPanel):
+        * UserInterface/Views/TimelineContentView.js:
+        (WebInspector.TimelineContentView.prototype.get allowedNavigationSidebarPanels):
+
</ins><span class="cx"> 2015-01-08  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Phantom breakpoint appears on empty line after reload of minified file with a breakpoint
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseMainjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -591,18 +591,20 @@
</span><span class="cx">     this._showingSplitConsoleSetting.value = true;
</span><span class="cx"> 
</span><span class="cx">     if (this.splitContentBrowser.currentContentView !== this.consoleContentView) {
</span><ins>+        var wasShowingFullConsole = this.isShowingConsoleView();
+
</ins><span class="cx">         // Be sure to close any existing log view in the main content browser before showing it in the
</span><span class="cx">         // split content browser. We can only show a content view in one browser at a time.
</span><span class="cx">         this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.LogContentView);
</span><span class="cx">         this.splitContentBrowser.showContentView(this.consoleContentView);
</span><ins>+
+        if (wasShowingFullConsole &amp;&amp; !this.contentBrowser.currentContentView)
+            this.resourceSidebarPanel.showDefaultContentView();
</ins><span class="cx">     } else {
</span><span class="cx">         // This causes the view to know it was shown and focus the prompt.
</span><span class="cx">         this.splitContentBrowser.contentViewContainer.shown();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (this._wasShowingNavigationSidebarBeforeFullHeightConsole)
-        this.navigationSidebar.collapsed = false;
-
</del><span class="cx">     this.quickConsole.consoleLogVisibilityChanged(true);
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -633,18 +635,6 @@
</span><span class="cx">     this.consoleContentView.scopeBar.item(scope).selected = true;
</span><span class="cx"> 
</span><span class="cx">     if (!this.contentBrowser.currentContentView || this.contentBrowser.currentContentView !== this.consoleContentView) {
</span><del>-        this._wasShowingNavigationSidebarBeforeFullHeightConsole = !this.navigationSidebar.collapsed;
-
-        // Collapse the sidebar before showing the console view, so the check for the collapsed state in
-        // _revealAndSelectRepresentedObjectInNavigationSidebar returns early and does not deselect any
-        // tree elements in the current sidebar.
-        this.navigationSidebar.collapsed = true;
-
-        // If this is before the content has finished loading update the collapsed value setting
-        // ourselves so that we don't uncollapse the navigation sidebar when it is loaded.
-        if (!this._contentLoaded)
-            this._navigationSidebarCollapsedSetting.value = true;
-
</del><span class="cx">         // Be sure to close any existing log view in the split content browser before showing it in the
</span><span class="cx">         // main content browser. We can only show a content view in one browser at a time.
</span><span class="cx">         this.splitContentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.LogContentView);
</span><span class="lines">@@ -672,14 +662,8 @@
</span><span class="cx">     if (this.isShowingConsoleView()) {
</span><span class="cx">         if (this.contentBrowser.canGoBack())
</span><span class="cx">             this.contentBrowser.goBack();
</span><del>-        else {
-            if (!this.navigationSidebar.selectedSidebarPanel)
-                this.navigationSidebar.selectedSidebarPanel = this.resourceSidebarPanel;
</del><ins>+        else
</ins><span class="cx">             this.resourceSidebarPanel.showDefaultContentView();
</span><del>-        }
-
-        if (this._wasShowingNavigationSidebarBeforeFullHeightConsole)
-            this.navigationSidebar.collapsed = false;
</del><span class="cx">     } else
</span><span class="cx">         this.showFullHeightConsole();
</span><span class="cx"> };
</span><span class="lines">@@ -903,7 +887,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (event.target === this.navigationSidebar) {
</span><span class="cx">         this._navigationSidebarCollapsedSetting.value = this.navigationSidebar.collapsed;
</span><del>-        this._updateNavigationSidebarForCurrentContentView();
</del><ins>+        this._updateContentViewForCurrentNavigationSidebar();
</ins><span class="cx">     } else if (event.target === this.detailsSidebar) {
</span><span class="cx">         if (!this._ignoreDetailsSidebarPanelCollapsedEvent)
</span><span class="cx">             this._detailsSidebarCollapsedSetting.value = this.detailsSidebar.collapsed;
</span><span class="lines">@@ -941,12 +925,9 @@
</span><span class="cx">         treeElement.revealAndSelect(true, false, false, true);
</span><span class="cx">     else if (selectedSidebarPanel.contentTreeOutline.selectedTreeElement)
</span><span class="cx">         selectedSidebarPanel.contentTreeOutline.selectedTreeElement.deselect(true);
</span><del>-
-    if (!selectedSidebarPanel.hasSelectedElement)
-        selectedSidebarPanel.showDefaultContentView();
</del><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector._updateNavigationSidebarForCurrentContentView = function()
</del><ins>+WebInspector._updateContentViewForCurrentNavigationSidebar = function()
</ins><span class="cx"> {
</span><span class="cx">     if (this.navigationSidebar.collapsed)
</span><span class="cx">         return;
</span><span class="lines">@@ -962,26 +943,31 @@
</span><span class="cx">     // Ensure the navigation sidebar panel is allowed by the current content view, if not ask the sidebar panel
</span><span class="cx">     // to show the content view for the current selection.
</span><span class="cx">     var allowedNavigationSidebarPanels = currentContentView.allowedNavigationSidebarPanels;
</span><del>-    if (allowedNavigationSidebarPanels.length &amp;&amp; !allowedNavigationSidebarPanels.contains(selectedSidebarPanel.identifier)) {
-        selectedSidebarPanel.showContentViewForCurrentSelection();
</del><ins>+    if (allowedNavigationSidebarPanels &amp;&amp; (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.contains(selectedSidebarPanel.identifier))) {
+        this._revealAndSelectRepresentedObjectInNavigationSidebar(currentContentView.representedObject);
+        return;
+    }
</ins><span class="cx"> 
</span><del>-        // Fetch the current content view again, since it likely changed.
-        currentContentView = this.contentBrowser.currentContentView;
</del><ins>+    var backForwardList = WebInspector.contentBrowser.contentViewContainer.backForwardList;
+    var index = backForwardList.length;
+    while (index--) {
+        var contentView = backForwardList[index].contentView;
+        var allowedNavigationSidebarPanels = contentView.allowedNavigationSidebarPanels;
+        if (allowedNavigationSidebarPanels &amp;&amp; (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.contains(selectedSidebarPanel.identifier))) {
+            WebInspector.contentBrowser.showContentView(contentView);
+            return;
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.contains(selectedSidebarPanel.identifier))
-        currentContentView.__lastNavigationSidebarPanelIdentifier = selectedSidebarPanel.identifier;
-
-    this._revealAndSelectRepresentedObjectInNavigationSidebar(currentContentView.representedObject);
</del><ins>+    selectedSidebarPanel.showDefaultContentView();
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector._navigationSidebarPanelSelected = function(event)
</span><span class="cx"> {
</span><del>-    var selectedSidebarPanel = this.navigationSidebar.selectedSidebarPanel;
-    if (!selectedSidebarPanel)
</del><ins>+    if (!this.navigationSidebar.selectedSidebarPanel || this._ignoreNavigationSidebarPanelSelectedEvent)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    this._updateNavigationSidebarForCurrentContentView();
</del><ins>+    this._updateContentViewForCurrentNavigationSidebar();
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector._domNodeWasInspected = function(event)
</span><span class="lines">@@ -1104,20 +1090,34 @@
</span><span class="cx">     if (!selectedSidebarPanel)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    this._ignoreNavigationSidebarPanelSelectedEvent = true;
+
</ins><span class="cx">     // Ensure the navigation sidebar panel is allowed by the current content view, if not change the navigation sidebar panel
</span><span class="cx">     // to the last navigation sidebar panel used with the content view or the first one allowed.
</span><span class="cx">     var selectedSidebarPanelIdentifier = selectedSidebarPanel.identifier;
</span><ins>+    var allowedNavigationSidebarPanels = currentContentView.allowedNavigationSidebarPanels;
</ins><span class="cx"> 
</span><del>-    var allowedNavigationSidebarPanels = currentContentView.allowedNavigationSidebarPanels;
-    if (allowedNavigationSidebarPanels.length &amp;&amp; !allowedNavigationSidebarPanels.contains(selectedSidebarPanelIdentifier)) {
-        console.assert(!currentContentView.__lastNavigationSidebarPanelIdentifier || allowedNavigationSidebarPanels.contains(currentContentView.__lastNavigationSidebarPanelIdentifier));
-        this.navigationSidebar.selectedSidebarPanel = currentContentView.__lastNavigationSidebarPanelIdentifier || allowedNavigationSidebarPanels[0];
</del><ins>+    if (allowedNavigationSidebarPanels) {
+        if (allowedNavigationSidebarPanels.length &amp;&amp; !allowedNavigationSidebarPanels.contains(selectedSidebarPanelIdentifier)) {
+            console.assert(!currentContentView.__lastNavigationSidebarPanelIdentifier || allowedNavigationSidebarPanels.contains(currentContentView.__lastNavigationSidebarPanelIdentifier));
+            this.navigationSidebar.selectedSidebarPanel = currentContentView.__lastNavigationSidebarPanelIdentifier || allowedNavigationSidebarPanels[0];
+        }
+
+        if (this._wasShowingNavigationSidebarBeforeForcedCollapsed) {
+            this.navigationSidebar.collapsed = false;
+            delete this._wasShowingNavigationSidebarBeforeForcedCollapsed;
+        }
+    } else if (!allowedNavigationSidebarPanels &amp;&amp; !this.navigationSidebar.collapsed) {
+        this._wasShowingNavigationSidebarBeforeForcedCollapsed = true;
+        this.navigationSidebar.collapsed = true;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.contains(selectedSidebarPanelIdentifier))
-        currentContentView.__lastNavigationSidebarPanelIdentifier = selectedSidebarPanelIdentifier;
</del><ins>+    if (allowedNavigationSidebarPanels &amp;&amp; !this.navigationSidebar.collapsed)
+        currentContentView.__lastNavigationSidebarPanelIdentifier = this.navigationSidebar.selectedSidebarPanel.identifier;
</ins><span class="cx"> 
</span><span class="cx">     this._revealAndSelectRepresentedObjectInNavigationSidebar(currentContentView.representedObject);
</span><ins>+
+    delete this._ignoreNavigationSidebarPanelSelectedEvent;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector._contentBrowserRepresentedObjectsDidChange = function(event)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheFrameContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -53,6 +53,11 @@
</span><span class="cx"> WebInspector.ApplicationCacheFrameContentView.prototype = {
</span><span class="cx">     constructor: WebInspector.ApplicationCacheFrameContentView,
</span><span class="cx"> 
</span><ins>+    get allowedNavigationSidebarPanels()
+    {
+        return [WebInspector.resourceSidebarPanel.identifier];
+    },
+
</ins><span class="cx">     shown: function()
</span><span class="cx">     {
</span><span class="cx">         this._maybeUpdate();
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCookieStorageContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -39,6 +39,11 @@
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><ins>+    get allowedNavigationSidebarPanels()
+    {
+        return [WebInspector.resourceSidebarPanel.identifier];
+    },
+
</ins><span class="cx">     update: function()
</span><span class="cx">     {
</span><span class="cx">         function callback(error, cookies)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMStorageContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -50,6 +50,11 @@
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><ins>+    get allowedNavigationSidebarPanels()
+    {
+        return [WebInspector.resourceSidebarPanel.identifier];
+    },
+
</ins><span class="cx">     reset: function()
</span><span class="cx">     {
</span><span class="cx">         this.representedObject.getEntries(function(error, entries) {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -78,6 +78,11 @@
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><ins>+    get allowedNavigationSidebarPanels()
+    {
+        return [WebInspector.resourceSidebarPanel.identifier];
+    },
+
</ins><span class="cx">     get navigationItems()
</span><span class="cx">     {
</span><span class="cx">         return [this._showsShadowDOMButtonNavigationItem, this._compositingBordersButtonNavigationItem, this._paintFlashingButtonNavigationItem];
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDatabaseContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -52,6 +52,11 @@
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><ins>+    get allowedNavigationSidebarPanels()
+    {
+        return [WebInspector.resourceSidebarPanel.identifier];
+    },
+
</ins><span class="cx">     shown: function()
</span><span class="cx">     {
</span><span class="cx">         this.prompt.shown();
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTableContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -39,6 +39,11 @@
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><ins>+    get allowedNavigationSidebarPanels()
+    {
+        return [WebInspector.resourceSidebarPanel.identifier];
+    },
+
</ins><span class="cx">     update: function()
</span><span class="cx">     {
</span><span class="cx">         this.representedObject.database.executeSQL(&quot;SELECT * FROM \&quot;&quot; + this._escapeTableName(this.representedObject.name) + &quot;\&quot;&quot;, this._queryFinished.bind(this), this._queryError.bind(this));
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFontResourceContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -53,6 +53,14 @@
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><ins>+    get allowedNavigationSidebarPanels()
+    {
+        return [
+            WebInspector.resourceSidebarPanel.identifier,
+            WebInspector.timelineSidebarPanel.identifier
+        ];
+    },
+
</ins><span class="cx">     get previewElement()
</span><span class="cx">     {
</span><span class="cx">         return this._previewElement;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFrameDOMTreeContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -42,6 +42,11 @@
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><ins>+    get allowedNavigationSidebarPanels()
+    {
+        return [WebInspector.resourceSidebarPanel.identifier];
+    },
+
</ins><span class="cx">     get domTree()
</span><span class="cx">     {
</span><span class="cx">         return this._domTree;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -107,6 +107,11 @@
</span><span class="cx">     constructor: WebInspector.LogContentView,
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><ins>+    get allowedNavigationSidebarPanels()
+    {
+        // Don't show any sidebars when the Console is opened.
+        return null;
+    },
</ins><span class="cx"> 
</span><span class="cx">     get navigationItems()
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceClusterContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -59,6 +59,22 @@
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><ins>+    get allowedNavigationSidebarPanels()
+    {
+        console.assert(this._resource);
+
+        switch (this._resource.type) {
+        case WebInspector.Resource.Type.Document: // HTML documents may have inline scripts.
+        case WebInspector.Resource.Type.Script:
+            return [];
+        default:
+            return [
+                WebInspector.resourceSidebarPanel.identifier,
+                WebInspector.timelineSidebarPanel.identifier
+            ];
+        }
+    },
+
</ins><span class="cx">     get resource()
</span><span class="cx">     {
</span><span class="cx">         return this._resource;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx">     showDefaultContentView: function()
</span><span class="cx">     {
</span><span class="cx">         if (WebInspector.frameResourceManager.mainFrame) {
</span><del>-            this.showMainFrameSourceCode();
</del><ins>+            this.showMainFrame();
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -119,6 +119,11 @@
</span><span class="cx">         return this._searchContentTreeOutline;
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    showMainFrame: function(nodeToSelect, preventFocusChange)
+    {
+        WebInspector.contentBrowser.showContentViewForRepresentedObject(WebInspector.frameResourceManager.mainFrame);
+    },
+
</ins><span class="cx">     showMainFrameDOMTree: function(nodeToSelect, preventFocusChange)
</span><span class="cx">     {
</span><span class="cx">         var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(WebInspector.frameResourceManager.mainFrame);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSidebarjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (this._selectedSidebarPanel === sidebarPanel) {
</span><span class="cx">             var index = this._sidebarPanels.indexOf(sidebarPanel);
</span><del>-            this.selectedSidebarPanel = this._sidebarPanels[index - 1] || this._sidebarPanels[index + 1];
</del><ins>+            this.selectedSidebarPanel = this._sidebarPanels[index - 1] || this._sidebarPanels[index + 1] || null;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         this._sidebarPanels.remove(sidebarPanel);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js (178154 => 178155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js        2015-01-09 05:07:21 UTC (rev 178154)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js        2015-01-09 05:18:40 UTC (rev 178155)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> 
</span><span class="cx">     get allowedNavigationSidebarPanels()
</span><span class="cx">     {
</span><del>-        return [&quot;timeline&quot;];
</del><ins>+        return [WebInspector.timelineSidebarPanel.identifier];
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     get supportsSplitContentBrowser()
</span></span></pre>
</div>
</div>

</body>
</html>