Uncaught Exception: TypeError: null is not an object (evaluating 'this.contentBrowser...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Jun 2017 21:26:33 +0000 (21:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Jun 2017 21:26:33 +0000 (21:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173425
<rdar://problem/32744172>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-06-15
Reviewed by Devin Rousso.

* UserInterface/Views/ContentBrowserTabContentView.js:
(WebInspector.ContentBrowserTabContentView.prototype.shown):
Reorder slightly so the NavigationSidebar has its ContentBrowser set
before anyone tries to restore views in the sidebar.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype.showDefaultContentView):
Try to select a script/resource content view instead of nothing.

(WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
When a resource is selected, save it using the normal path.

* UserInterface/Views/NetworkSidebarPanel.js:
(WebInspector.NetworkSidebarPanel.prototype.canShowDifferentContentView):
Remove a reference to an unused / stale member variable.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218356 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js
Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/NetworkSidebarPanel.js

index 60feb32..1cee235 100644 (file)
@@ -1,3 +1,27 @@
+2017-06-15  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Uncaught Exception: TypeError: null is not an object (evaluating 'this.contentBrowser.contentViewForRepresentedObject')
+        https://bugs.webkit.org/show_bug.cgi?id=173425
+        <rdar://problem/32744172>
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Views/ContentBrowserTabContentView.js:
+        (WebInspector.ContentBrowserTabContentView.prototype.shown):
+        Reorder slightly so the NavigationSidebar has its ContentBrowser set
+        before anyone tries to restore views in the sidebar.
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel.prototype.showDefaultContentView):
+        Try to select a script/resource content view instead of nothing.
+
+        (WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
+        When a resource is selected, save it using the normal path.
+
+        * UserInterface/Views/NetworkSidebarPanel.js:
+        (WebInspector.NetworkSidebarPanel.prototype.canShowDifferentContentView):
+        Remove a reference to an unused / stale member variable.
+
 2017-06-14  Nikita Vasilyev  <nvasilyev@apple.com>
 
         Web Inspector: Pretty print / type info / code coverage buttons disappear after switching tabs
index ec8cd77..8040d3d 100644 (file)
@@ -92,14 +92,16 @@ WebInspector.ContentBrowserTabContentView = class ContentBrowserTabContentView e
 
     shown()
     {
+        if (this.navigationSidebarPanel) {
+            if (!this.navigationSidebarPanel.contentBrowser)
+                this.navigationSidebarPanel.contentBrowser = this._contentBrowser;
+        }
+
         super.shown();
 
         this._contentBrowser.shown();
 
         if (this.navigationSidebarPanel) {
-            if (!this.navigationSidebarPanel.contentBrowser)
-                this.navigationSidebarPanel.contentBrowser = this._contentBrowser;
-
             if (!this._contentBrowser.currentContentView)
                 this.navigationSidebarPanel.showDefaultContentView();
         }
index f112649..049472f 100644 (file)
@@ -280,7 +280,13 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
 
     showDefaultContentView()
     {
-        var currentTreeElement = this._contentTreeOutline.children[0];
+        if (WebInspector.frameResourceManager.mainFrame) {
+            let mainTreeElement = this._scriptsContentTreeOutline.findTreeElement(WebInspector.frameResourceManager.mainFrame.mainResource);
+            if (mainTreeElement && this.showDefaultContentViewForTreeElement(mainTreeElement))
+                return;
+        }
+
+        let currentTreeElement = this._scriptsContentTreeOutline.children[0];
         while (currentTreeElement && !currentTreeElement.root) {
             if (currentTreeElement instanceof WebInspector.ResourceTreeElement || currentTreeElement instanceof WebInspector.ScriptTreeElement) {
                 if (this.showDefaultContentViewForTreeElement(currentTreeElement))
@@ -330,8 +336,10 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
         console.assert(cookie);
 
         var selectedTreeElement = this._breakpointsContentTreeOutline.selectedTreeElement;
-        if (!selectedTreeElement)
+        if (!selectedTreeElement) {
+            super.saveStateToCookie(cookie);
             return;
+        }
 
         var representedObject = selectedTreeElement.representedObject;
 
index a51455a..6611035 100644 (file)
@@ -62,7 +62,7 @@ WebInspector.NetworkSidebarPanel = class NetworkSidebarPanel extends WebInspecto
         if (this.contentBrowser.currentContentView instanceof WebInspector.NetworkGridContentView)
             return false;
 
-        return !this.restoringState || !this._restoredShowingNetworkGridContentView;
+        return !this.restoringState;
     }
 
     // Protected