Changeset 217750 in webkit
- Timestamp:
- Jun 2, 2017 8:44:51 PM (7 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r217749 r217750 1 2017-06-02 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Don't create NavigationSidebarPanel classes until they are needed by a Tab 4 https://bugs.webkit.org/show_bug.cgi?id=172621 5 6 Reviewed by Timothy Hatcher. 7 8 * UserInterface/Views/ContentBrowserTabContentView.js: 9 (WebInspector.ContentBrowserTabContentView): 10 (WebInspector.ContentBrowserTabContentView.prototype.shown): 11 * UserInterface/Views/TabContentView.js: 12 (WebInspector.TabContentView): 13 (WebInspector.TabContentView.prototype.get navigationSidebarPanel): 14 15 * UserInterface/Views/NetworkTabContentView.js: 16 (WebInspector.NetworkTabContentView.prototype.canShowRepresentedObject): 17 * UserInterface/Views/SearchTabContentView.js: 18 (WebInspector.SearchTabContentView.prototype.canShowRepresentedObject): 19 Use public getter for navigationSidebarPanel. 20 21 * UserInterface/Views/ResourceSidebarPanel.js: 22 (WebInspector.ResourceSidebarPanel): 23 (WebInspector.ResourceSidebarPanel.prototype.initialLayout): Added. 24 Load information about the current frame once the sidebar panel is displayed. 25 1 26 2017-06-02 Devin Rousso <drousso@apple.com> 2 27 -
trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js
r217460 r217750 26 26 WebInspector.ContentBrowserTabContentView = class ContentBrowserTabContentView extends WebInspector.TabContentView 27 27 { 28 constructor(identifier, styleClassNames, tabBarItem, navigationSidebarPanelC lass, detailsSidebarPanelConstructors, disableBackForward)28 constructor(identifier, styleClassNames, tabBarItem, navigationSidebarPanelConstructor, detailsSidebarPanelConstructors, disableBackForward) 29 29 { 30 30 if (typeof styleClassNames === "string") … … 34 34 35 35 var contentBrowser = new WebInspector.ContentBrowser(null, null, disableBackForward); 36 var navigationSidebarPanel = navigationSidebarPanelClass ? new navigationSidebarPanelClass(contentBrowser) : null; 37 38 super(identifier, styleClassNames, tabBarItem, navigationSidebarPanel, detailsSidebarPanelConstructors); 36 37 super(identifier, styleClassNames, tabBarItem, navigationSidebarPanelConstructor, detailsSidebarPanelConstructors); 39 38 40 39 this._contentBrowser = contentBrowser; … … 50 49 this._contentBrowser.updateHierarchicalPathForCurrentContentView(); 51 50 52 if (navigationSidebarPanel ) {51 if (navigationSidebarPanelConstructor) { 53 52 let showToolTip = WebInspector.UIString("Show the navigation sidebar (%s)").format(WebInspector.navigationSidebarKeyboardShortcut.displayName); 54 53 let hideToolTip = WebInspector.UIString("Hide the navigation sidebar (%s)").format(WebInspector.navigationSidebarKeyboardShortcut.displayName); … … 61 60 this._contentBrowser.navigationBar.insertNavigationItem(this._showNavigationSidebarItem, 0); 62 61 this._contentBrowser.navigationBar.insertNavigationItem(new WebInspector.DividerNavigationItem, 1); 63 64 navigationSidebarPanel.contentBrowser = this._contentBrowser;65 62 66 63 WebInspector.navigationSidebar.addEventListener(WebInspector.Sidebar.Event.CollapsedStateDidChange, this._navigationSidebarCollapsedStateDidChange, this); … … 100 97 this._contentBrowser.shown(); 101 98 102 if (this.navigationSidebarPanel && !this._contentBrowser.currentContentView) 103 this.navigationSidebarPanel.showDefaultContentView(); 99 if (this.navigationSidebarPanel) { 100 if (!this.navigationSidebarPanel.contentBrowser) 101 this.navigationSidebarPanel.contentBrowser = this._contentBrowser; 102 103 if (!this._contentBrowser.currentContentView) 104 this.navigationSidebarPanel.showDefaultContentView(); 105 } 104 106 } 105 107 -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js
r217460 r217750 60 60 return false; 61 61 62 return !!this. _navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(representedObject);62 return !!this.navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(representedObject); 63 63 } 64 64 -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js
r217505 r217750 77 77 WebInspector.SourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, () => { this.contentTreeOutline.disclosureButtons = true; }, this); 78 78 } 79 80 if (WebInspector.frameResourceManager.mainFrame)81 this._mainFrameMainResourceDidChange(WebInspector.frameResourceManager.mainFrame);82 79 } 83 80 … … 192 189 193 190 // Protected 191 192 initialLayout() 193 { 194 super.initialLayout(); 195 196 if (WebInspector.frameResourceManager.mainFrame) 197 this._mainFrameMainResourceDidChange(WebInspector.frameResourceManager.mainFrame); 198 } 194 199 195 200 hasCustomFilters() -
trunk/Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js
r217460 r217750 74 74 return false; 75 75 76 return !!this. _navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(representedObject);76 return !!this.navigationSidebarPanel.contentTreeOutline.getCachedTreeElement(representedObject); 77 77 } 78 78 -
trunk/Source/WebInspectorUI/UserInterface/Views/TabContentView.js
r217460 r217750 26 26 WebInspector.TabContentView = class TabContentView extends WebInspector.ContentView 27 27 { 28 constructor(identifier, styleClassNames, tabBarItem, navigationSidebarPanel , detailsSidebarPanelConstructors)28 constructor(identifier, styleClassNames, tabBarItem, navigationSidebarPanelConstructor, detailsSidebarPanelConstructors) 29 29 { 30 30 console.assert(typeof identifier === "string"); 31 31 console.assert(typeof styleClassNames === "string" || styleClassNames.every((className) => typeof className === "string")); 32 32 console.assert(tabBarItem instanceof WebInspector.TabBarItem); 33 console.assert(!navigationSidebarPanel || navigationSidebarPanel instanceof WebInspector.NavigationSidebarPanel);33 console.assert(!navigationSidebarPanelConstructor || typeof navigationSidebarPanelConstructor === "function"); 34 34 console.assert(!detailsSidebarPanelConstructors || detailsSidebarPanelConstructors.every((detailsSidebarPanelConstructor) => typeof detailsSidebarPanelConstructor === "function")); 35 35 … … 45 45 this._identifier = identifier; 46 46 this._tabBarItem = tabBarItem; 47 this._navigationSidebarPanel = navigationSidebarPanel|| null;47 this._navigationSidebarPanelConstructor = navigationSidebarPanelConstructor || null; 48 48 this._detailsSidebarPanelConstructors = detailsSidebarPanelConstructors || []; 49 49 … … 174 174 } 175 175 176 get navigationSidebarPanel() { return this._navigationSidebarPanel; } 176 get navigationSidebarPanel() 177 { 178 if (!this._navigationSidebarPanelConstructor) 179 return null; 180 return WebInspector.instanceForClass(this._navigationSidebarPanelConstructor); 181 } 182 177 183 get navigationSidebarCollapsedSetting() { return this._navigationSidebarCollapsedSetting; } 178 184 get navigationSidebarWidthSetting() { return this._navigationSidebarWidthSetting; } … … 185 191 return this._detailsSidebarPanels; 186 192 } 193 187 194 get detailsSidebarCollapsedSetting() { return this._detailsSidebarCollapsedSetting; } 188 195 get detailsSidebarSelectedPanelSetting() { return this._detailsSidebarSelectedPanelSetting; }
Note: See TracChangeset
for help on using the changeset viewer.