<!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>[217750] 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/217750">217750</a></dd>
<dt>Author</dt> <dd>drousso@apple.com</dd>
<dt>Date</dt> <dd>2017-06-02 20:44:51 -0700 (Fri, 02 Jun 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Don't create NavigationSidebarPanel classes until they are needed by a Tab
https://bugs.webkit.org/show_bug.cgi?id=172621

Reviewed by Timothy Hatcher.

* UserInterface/Views/ContentBrowserTabContentView.js:
(WebInspector.ContentBrowserTabContentView):
(WebInspector.ContentBrowserTabContentView.prototype.shown):
* UserInterface/Views/TabContentView.js:
(WebInspector.TabContentView):
(WebInspector.TabContentView.prototype.get navigationSidebarPanel):

* UserInterface/Views/NetworkTabContentView.js:
(WebInspector.NetworkTabContentView.prototype.canShowRepresentedObject):
* UserInterface/Views/SearchTabContentView.js:
(WebInspector.SearchTabContentView.prototype.canShowRepresentedObject):
Use public getter for navigationSidebarPanel.

* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):
(WebInspector.ResourceSidebarPanel.prototype.initialLayout): Added.
Load information about the current frame once the sidebar panel is displayed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentBrowserTabContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNetworkTabContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSearchTabContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTabContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TabContentView.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (217749 => 217750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog    2017-06-03 03:37:53 UTC (rev 217749)
+++ trunk/Source/WebInspectorUI/ChangeLog       2017-06-03 03:44:51 UTC (rev 217750)
</span><span class="lines">@@ -1,5 +1,30 @@
</span><span class="cx"> 2017-06-02  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><ins>+        Web Inspector: Don't create NavigationSidebarPanel classes until they are needed by a Tab
+        https://bugs.webkit.org/show_bug.cgi?id=172621
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/ContentBrowserTabContentView.js:
+        (WebInspector.ContentBrowserTabContentView):
+        (WebInspector.ContentBrowserTabContentView.prototype.shown):
+        * UserInterface/Views/TabContentView.js:
+        (WebInspector.TabContentView):
+        (WebInspector.TabContentView.prototype.get navigationSidebarPanel):
+
+        * UserInterface/Views/NetworkTabContentView.js:
+        (WebInspector.NetworkTabContentView.prototype.canShowRepresentedObject):
+        * UserInterface/Views/SearchTabContentView.js:
+        (WebInspector.SearchTabContentView.prototype.canShowRepresentedObject):
+        Use public getter for navigationSidebarPanel.
+
+        * UserInterface/Views/ResourceSidebarPanel.js:
+        (WebInspector.ResourceSidebarPanel):
+        (WebInspector.ResourceSidebarPanel.prototype.initialLayout): Added.
+        Load information about the current frame once the sidebar panel is displayed.
+
+2017-06-02  Devin Rousso  <drousso@apple.com>
+
</ins><span class="cx">         Web Inspector: Use initialLayout for DetailsSidebarPanel classes
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=172381
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentBrowserTabContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js (217749 => 217750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js  2017-06-03 03:37:53 UTC (rev 217749)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js     2017-06-03 03:44:51 UTC (rev 217750)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> WebInspector.ContentBrowserTabContentView = class ContentBrowserTabContentView extends WebInspector.TabContentView
</span><span class="cx"> {
</span><del>-    constructor(identifier, styleClassNames, tabBarItem, navigationSidebarPanelClass, detailsSidebarPanelConstructors, disableBackForward)
</del><ins>+    constructor(identifier, styleClassNames, tabBarItem, navigationSidebarPanelConstructor, detailsSidebarPanelConstructors, disableBackForward)
</ins><span class="cx">     {
</span><span class="cx">         if (typeof styleClassNames === "string")
</span><span class="cx">             styleClassNames = [styleClassNames];
</span><span class="lines">@@ -33,9 +33,8 @@
</span><span class="cx">         styleClassNames.push("content-browser");
</span><span class="cx"> 
</span><span class="cx">         var contentBrowser = new WebInspector.ContentBrowser(null, null, disableBackForward);
</span><del>-        var navigationSidebarPanel = navigationSidebarPanelClass ? new navigationSidebarPanelClass(contentBrowser) : null;
</del><span class="cx"> 
</span><del>-        super(identifier, styleClassNames, tabBarItem, navigationSidebarPanel, detailsSidebarPanelConstructors);
</del><ins>+        super(identifier, styleClassNames, tabBarItem, navigationSidebarPanelConstructor, detailsSidebarPanelConstructors);
</ins><span class="cx"> 
</span><span class="cx">         this._contentBrowser = contentBrowser;
</span><span class="cx">         this._contentBrowser.delegate = this;
</span><span class="lines">@@ -49,7 +48,7 @@
</span><span class="cx">         // Explicitly update the path for the navigation bar to prevent it from showing up as blank.
</span><span class="cx">         this._contentBrowser.updateHierarchicalPathForCurrentContentView();
</span><span class="cx"> 
</span><del>-        if (navigationSidebarPanel) {
</del><ins>+        if (navigationSidebarPanelConstructor) {
</ins><span class="cx">             let showToolTip = WebInspector.UIString("Show the navigation sidebar (%s)").format(WebInspector.navigationSidebarKeyboardShortcut.displayName);
</span><span class="cx">             let hideToolTip = WebInspector.UIString("Hide the navigation sidebar (%s)").format(WebInspector.navigationSidebarKeyboardShortcut.displayName);
</span><span class="cx">             let image = WebInspector.resolvedLayoutDirection() == WebInspector.LayoutDirection.RTL ? "Images/ToggleRightSidebar.svg" : "Images/ToggleLeftSidebar.svg";
</span><span class="lines">@@ -61,8 +60,6 @@
</span><span class="cx">             this._contentBrowser.navigationBar.insertNavigationItem(this._showNavigationSidebarItem, 0);
</span><span class="cx">             this._contentBrowser.navigationBar.insertNavigationItem(new WebInspector.DividerNavigationItem, 1);
</span><span class="cx"> 
</span><del>-            navigationSidebarPanel.contentBrowser = this._contentBrowser;
-
</del><span class="cx">             WebInspector.navigationSidebar.addEventListener(WebInspector.Sidebar.Event.CollapsedStateDidChange, this._navigationSidebarCollapsedStateDidChange, this);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -99,8 +96,13 @@
</span><span class="cx"> 
</span><span class="cx">         this._contentBrowser.shown();
</span><span class="cx"> 
</span><del>-        if (this.navigationSidebarPanel && !this._contentBrowser.currentContentView)
-            this.navigationSidebarPanel.showDefaultContentView();
</del><ins>+        if (this.navigationSidebarPanel) {
+            if (!this.navigationSidebarPanel.contentBrowser)
+                this.navigationSidebarPanel.contentBrowser = this._contentBrowser;
+
+            if (!this._contentBrowser.currentContentView)
+                this.navigationSidebarPanel.showDefaultContentView();
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     hidden()
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNetworkTabContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js (217749 => 217750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js 2017-06-03 03:37:53 UTC (rev 217749)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js    2017-06-03 03:44:51 UTC (rev 217750)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">         if (!(representedObject instanceof WebInspector.Resource))
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        return !!this._navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(representedObject);
</del><ins>+        return !!this.navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(representedObject);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     get supportsSplitContentBrowser()
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js (217749 => 217750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js  2017-06-03 03:37:53 UTC (rev 217749)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js     2017-06-03 03:44:51 UTC (rev 217750)
</span><span class="lines">@@ -76,9 +76,6 @@
</span><span class="cx">             this.contentTreeOutline.disclosureButtons = false;
</span><span class="cx">             WebInspector.SourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, () => { this.contentTreeOutline.disclosureButtons = true; }, this);
</span><span class="cx">         }
</span><del>-
-        if (WebInspector.frameResourceManager.mainFrame)
-            this._mainFrameMainResourceDidChange(WebInspector.frameResourceManager.mainFrame);
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="lines">@@ -192,6 +189,14 @@
</span><span class="cx"> 
</span><span class="cx">     // Protected
</span><span class="cx"> 
</span><ins>+    initialLayout()
+    {
+        super.initialLayout();
+
+        if (WebInspector.frameResourceManager.mainFrame)
+            this._mainFrameMainResourceDidChange(WebInspector.frameResourceManager.mainFrame);
+    }
+
</ins><span class="cx">     hasCustomFilters()
</span><span class="cx">     {
</span><span class="cx">         console.assert(this._scopeBar.selectedItems.length === 1);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSearchTabContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js (217749 => 217750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js  2017-06-03 03:37:53 UTC (rev 217749)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js     2017-06-03 03:44:51 UTC (rev 217750)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">         if (!(representedObject instanceof WebInspector.Resource) && !(representedObject instanceof WebInspector.Script) && !(representedObject instanceof WebInspector.DOMTree))
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        return !!this._navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(representedObject);
</del><ins>+        return !!this.navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(representedObject);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     focusSearchField()
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTabContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TabContentView.js (217749 => 217750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TabContentView.js        2017-06-03 03:37:53 UTC (rev 217749)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TabContentView.js   2017-06-03 03:44:51 UTC (rev 217750)
</span><span class="lines">@@ -25,12 +25,12 @@
</span><span class="cx"> 
</span><span class="cx"> WebInspector.TabContentView = class TabContentView extends WebInspector.ContentView
</span><span class="cx"> {
</span><del>-    constructor(identifier, styleClassNames, tabBarItem, navigationSidebarPanel, detailsSidebarPanelConstructors)
</del><ins>+    constructor(identifier, styleClassNames, tabBarItem, navigationSidebarPanelConstructor, detailsSidebarPanelConstructors)
</ins><span class="cx">     {
</span><span class="cx">         console.assert(typeof identifier === "string");
</span><span class="cx">         console.assert(typeof styleClassNames === "string" || styleClassNames.every((className) => typeof className === "string"));
</span><span class="cx">         console.assert(tabBarItem instanceof WebInspector.TabBarItem);
</span><del>-        console.assert(!navigationSidebarPanel || navigationSidebarPanel instanceof WebInspector.NavigationSidebarPanel);
</del><ins>+        console.assert(!navigationSidebarPanelConstructor || typeof navigationSidebarPanelConstructor === "function");
</ins><span class="cx">         console.assert(!detailsSidebarPanelConstructors || detailsSidebarPanelConstructors.every((detailsSidebarPanelConstructor) => typeof detailsSidebarPanelConstructor === "function"));
</span><span class="cx"> 
</span><span class="cx">         super(null);
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> 
</span><span class="cx">         this._identifier = identifier;
</span><span class="cx">         this._tabBarItem = tabBarItem;
</span><del>-        this._navigationSidebarPanel = navigationSidebarPanel || null;
</del><ins>+        this._navigationSidebarPanelConstructor = navigationSidebarPanelConstructor || null;
</ins><span class="cx">         this._detailsSidebarPanelConstructors = detailsSidebarPanelConstructors || [];
</span><span class="cx"> 
</span><span class="cx">         const defaultSidebarWidth = 300;
</span><span class="lines">@@ -173,7 +173,13 @@
</span><span class="cx">         this._cookieSetting.value = cookie;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    get navigationSidebarPanel() { return this._navigationSidebarPanel; }
</del><ins>+    get navigationSidebarPanel()
+    {
+        if (!this._navigationSidebarPanelConstructor)
+            return null;
+        return WebInspector.instanceForClass(this._navigationSidebarPanelConstructor);
+    }
+
</ins><span class="cx">     get navigationSidebarCollapsedSetting() { return this._navigationSidebarCollapsedSetting; }
</span><span class="cx">     get navigationSidebarWidthSetting() { return this._navigationSidebarWidthSetting; }
</span><span class="cx"> 
</span><span class="lines">@@ -184,6 +190,7 @@
</span><span class="cx"> 
</span><span class="cx">         return this._detailsSidebarPanels;
</span><span class="cx">     }
</span><ins>+
</ins><span class="cx">     get detailsSidebarCollapsedSetting() { return this._detailsSidebarCollapsedSetting; }
</span><span class="cx">     get detailsSidebarSelectedPanelSetting() { return this._detailsSidebarSelectedPanelSetting; }
</span><span class="cx">     get detailsSidebarWidthSetting() { return this._detailsSidebarWidthSetting; }
</span></span></pre>
</div>
</div>

</body>
</html>