Changeset 206195 in webkit


Ignore:
Timestamp:
Sep 20, 2016 7:46:17 PM (8 years ago)
Author:
commit-queue@webkit.org
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 <Joseph Pecoraro> 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.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r206106 r206195  
     12016-09-20  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Reload unexpectedly switches to Storage Tab
     4        https://bugs.webkit.org/show_bug.cgi?id=162323
     5        <rdar://problem/28393954>
     6
     7        Reviewed by Matt Baker.
     8
     9        * UserInterface/Views/NavigationSidebarPanel.js:
     10        (WebInspector.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
     11        We aren't stealing if the ContentView doesn't yet have a parent!
     12        This fixes restoration when switching to the Storage tab at a
     13        later time after a reload.
     14
     15        * UserInterface/Views/StorageSidebarPanel.js:
     16        (WebInspector.StorageSidebarPanel._treeSelectionDidChange):
     17        Don't showRepresentedObject if we aren't visible. That would force this
     18        tab to the foreground and we don't want that. This only happens when
     19        tree elements are removed (main frame navigation) and TreeOutline
     20        selects the next available tree element.
     21
     22        (WebInspector.StorageSidebarPanel.prototype._storageCleared):
     23        Simplify and close all content views. We were missing IndexedDB content views.
     24
    1252016-09-19  Matt Baker  <mattbaker@apple.com>
    226
  • trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js

    r205946 r206195  
    212212        if (!this.selected) {
    213213            let contentView = this.contentBrowser.contentViewForRepresentedObject(treeElement.representedObject);
    214             if (contentView && contentView.parentContainer !== this.contentBrowser.contentViewContainer)
     214            if (contentView && contentView.parentContainer && contentView.parentContainer !== this.contentBrowser.contentViewContainer)
    215215                return false;
    216216        }
  • trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js

    r205425 r206195  
    4242        scopeBarItems.push(new WebInspector.ScopeBarItem(scopeItemPrefix + "type-all", WebInspector.UIString("All Storage"), true));
    4343
    44         var storageTypes = [{identifier: "application-cache", title: WebInspector.UIString("Application Cache"), classes: [WebInspector.ApplicationCacheFrameTreeElement, WebInspector.ApplicationCacheManifestTreeElement]},
     44        var storageTypes = [
     45            {identifier: "application-cache", title: WebInspector.UIString("Application Cache"), classes: [WebInspector.ApplicationCacheFrameTreeElement, WebInspector.ApplicationCacheManifestTreeElement]},
    4546            {identifier: "cookies", title: WebInspector.UIString("Cookies"), classes: [WebInspector.CookieStorageTreeElement]},
    4647            {identifier: "database", title: WebInspector.UIString("Databases"), classes: [WebInspector.DatabaseHostTreeElement, WebInspector.DatabaseTableTreeElement, WebInspector.DatabaseTreeElement]},
    4748            {identifier: "indexed-database", title: WebInspector.UIString("Indexed Databases"), classes: [WebInspector.IndexedDatabaseHostTreeElement, WebInspector.IndexedDatabaseObjectStoreTreeElement, WebInspector.IndexedDatabaseTreeElement]},
    4849            {identifier: "local-storage", title: WebInspector.UIString("Local Storage"), classes: [WebInspector.DOMStorageTreeElement], localStorage: true},
    49             {identifier: "session-storage", title: WebInspector.UIString("Session Storage"), classes: [WebInspector.DOMStorageTreeElement], localStorage: false}];
     50            {identifier: "session-storage", title: WebInspector.UIString("Session Storage"), classes: [WebInspector.DOMStorageTreeElement], localStorage: false}
     51        ];
    5052
    5153        storageTypes.sort(function(a, b) { return a.title.localeCompare(b.title); });
     
    169171    _treeSelectionDidChange(event)
    170172    {
     173        if (!this.visible)
     174            return;
     175
    171176        let treeElement = event.data.selectedElement;
    172177        if (!treeElement)
     
    339344    _storageCleared(event)
    340345    {
    341         // Close all DOM and cookie storage content views since the main frame has navigated and all storages are cleared.
    342         this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CookieStorageContentView);
    343         this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DOMStorageContentView);
    344         this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseTableContentView);
    345         this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseContentView);
    346         this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ApplicationCacheFrameContentView);
     346        this.contentBrowser.contentViewContainer.closeAllContentViews();
    347347
    348348        if (this._localStorageRootTreeElement && this._localStorageRootTreeElement.parent)
Note: See TracChangeset for help on using the changeset viewer.