Title: [206195] trunk/Source/WebInspectorUI
Revision
206195
Author
commit-qu...@webkit.org
Date
2016-09-20 19:46:17 -0700 (Tue, 20 Sep 2016)

Log Message

Web Inspector: Reload unexpectedly switches to Storage Tab
https://bugs.webkit.org/show_bug.cgi?id=162323
<rdar://problem/28393954>

Patch by Joseph Pecoraro <pecor...@apple.com> on 2016-09-20
Reviewed by Matt Baker.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
We aren't stealing if the ContentView doesn't yet have a parent!
This fixes restoration when switching to the Storage tab at a
later time after a reload.

* UserInterface/Views/StorageSidebarPanel.js:
(WebInspector.StorageSidebarPanel._treeSelectionDidChange):
Don't showRepresentedObject if we aren't visible. That would force this
tab to the foreground and we don't want that. This only happens when
tree elements are removed (main frame navigation) and TreeOutline
selects the next available tree element.

(WebInspector.StorageSidebarPanel.prototype._storageCleared):
Simplify and close all content views. We were missing IndexedDB content views.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (206194 => 206195)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-09-21 02:34:14 UTC (rev 206194)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-09-21 02:46:17 UTC (rev 206195)
@@ -1,3 +1,27 @@
+2016-09-20  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Reload unexpectedly switches to Storage Tab
+        https://bugs.webkit.org/show_bug.cgi?id=162323
+        <rdar://problem/28393954>
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/NavigationSidebarPanel.js:
+        (WebInspector.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
+        We aren't stealing if the ContentView doesn't yet have a parent!
+        This fixes restoration when switching to the Storage tab at a
+        later time after a reload.
+
+        * UserInterface/Views/StorageSidebarPanel.js:
+        (WebInspector.StorageSidebarPanel._treeSelectionDidChange):
+        Don't showRepresentedObject if we aren't visible. That would force this
+        tab to the foreground and we don't want that. This only happens when
+        tree elements are removed (main frame navigation) and TreeOutline
+        selects the next available tree element.
+
+        (WebInspector.StorageSidebarPanel.prototype._storageCleared):
+        Simplify and close all content views. We were missing IndexedDB content views.
+
 2016-09-19  Matt Baker  <mattba...@apple.com>
 
         Unreviewed, reverting changeset https://trac.webkit.org/changeset/206101.

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (206194 => 206195)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2016-09-21 02:34:14 UTC (rev 206194)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2016-09-21 02:46:17 UTC (rev 206195)
@@ -211,7 +211,7 @@
         // Do not steal a content view if we are not the active tab/sidebar.
         if (!this.selected) {
             let contentView = this.contentBrowser.contentViewForRepresentedObject(treeElement.representedObject);
-            if (contentView && contentView.parentContainer !== this.contentBrowser.contentViewContainer)
+            if (contentView && contentView.parentContainer && contentView.parentContainer !== this.contentBrowser.contentViewContainer)
                 return false;
         }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js (206194 => 206195)


--- trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js	2016-09-21 02:34:14 UTC (rev 206194)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js	2016-09-21 02:46:17 UTC (rev 206195)
@@ -41,12 +41,14 @@
 
         scopeBarItems.push(new WebInspector.ScopeBarItem(scopeItemPrefix + "type-all", WebInspector.UIString("All Storage"), true));
 
-        var storageTypes = [{identifier: "application-cache", title: WebInspector.UIString("Application Cache"), classes: [WebInspector.ApplicationCacheFrameTreeElement, WebInspector.ApplicationCacheManifestTreeElement]},
+        var storageTypes = [
+            {identifier: "application-cache", title: WebInspector.UIString("Application Cache"), classes: [WebInspector.ApplicationCacheFrameTreeElement, WebInspector.ApplicationCacheManifestTreeElement]},
             {identifier: "cookies", title: WebInspector.UIString("Cookies"), classes: [WebInspector.CookieStorageTreeElement]},
             {identifier: "database", title: WebInspector.UIString("Databases"), classes: [WebInspector.DatabaseHostTreeElement, WebInspector.DatabaseTableTreeElement, WebInspector.DatabaseTreeElement]},
             {identifier: "indexed-database", title: WebInspector.UIString("Indexed Databases"), classes: [WebInspector.IndexedDatabaseHostTreeElement, WebInspector.IndexedDatabaseObjectStoreTreeElement, WebInspector.IndexedDatabaseTreeElement]},
             {identifier: "local-storage", title: WebInspector.UIString("Local Storage"), classes: [WebInspector.DOMStorageTreeElement], localStorage: true},
-            {identifier: "session-storage", title: WebInspector.UIString("Session Storage"), classes: [WebInspector.DOMStorageTreeElement], localStorage: false}];
+            {identifier: "session-storage", title: WebInspector.UIString("Session Storage"), classes: [WebInspector.DOMStorageTreeElement], localStorage: false}
+        ];
 
         storageTypes.sort(function(a, b) { return a.title.localeCompare(b.title); });
 
@@ -168,6 +170,9 @@
 
     _treeSelectionDidChange(event)
     {
+        if (!this.visible)
+            return;
+
         let treeElement = event.data.selectedElement;
         if (!treeElement)
             return;
@@ -338,12 +343,7 @@
 
     _storageCleared(event)
     {
-        // Close all DOM and cookie storage content views since the main frame has navigated and all storages are cleared.
-        this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CookieStorageContentView);
-        this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DOMStorageContentView);
-        this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseTableContentView);
-        this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseContentView);
-        this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ApplicationCacheFrameContentView);
+        this.contentBrowser.contentViewContainer.closeAllContentViews();
 
         if (this._localStorageRootTreeElement && this._localStorageRootTreeElement.parent)
             this._localStorageRootTreeElement.parent.removeChild(this._localStorageRootTreeElement);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to