[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

pfeldman at chromium.org pfeldman at chromium.org
Wed Dec 22 15:19:07 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 48ad88d99cb9e25855dc971a14d56b9ed0f5eb44
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Oct 31 06:43:11 2010 +0000

    2010-10-30  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: new resources and network panel usability improvements.
            https://bugs.webkit.org/show_bug.cgi?id=48680
    
            By default, navigation clears network log, added 'preserve log' button,
            that prevents log from being cleared.
    
            Storing expanded state of all group items, restoring last selected item,
            fall back to main frame's main resource by default.
            Do not list XHRs and redirects in resources.
    
            * English.lproj/localizedStrings.js:
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::didLoadResourceFromMemoryCache):
            (WebCore::InspectorController::identifierForInitialRequest):
            * inspector/front-end/NetworkPanel.js:
            (WebInspector.NetworkPanel.prototype.get statusBarItems):
            (WebInspector.NetworkPanel.prototype._positionSummaryBar):
            (WebInspector.NetworkPanel.prototype._updateFilter):
            (WebInspector.NetworkPanel.prototype._createStatusbarButtons):
            (WebInspector.NetworkPanel.prototype._onPreserveLogClicked):
            (WebInspector.NetworkPanel.prototype.reset):
            (WebInspector.NetworkPanel.prototype.refreshResource):
            * inspector/front-end/ResourceManager.js:
            (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
            (WebInspector.ResourceManager.prototype.willSendRequest):
            (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
            (WebInspector.ResourceManager.prototype.setOverrideContent):
            (WebInspector.ResourceManager.prototype.didCreateWebSocket):
            * inspector/front-end/StoragePanel.js:
            (WebInspector.StoragePanel):
            (WebInspector.StoragePanel.prototype.show):
            (WebInspector.StoragePanel.prototype._initDefaultSelection):
            (WebInspector.StoragePanel.prototype.reset):
            (WebInspector.StoragePanel.prototype.addResourceToFrame):
            (WebInspector.StoragePanel.prototype.refreshResource):
            (WebInspector.StoragePanel.prototype.showDatabase):
            (WebInspector.BaseStorageTreeElement.prototype.onselect):
            (WebInspector.StorageCategoryTreeElement):
            (WebInspector.StorageCategoryTreeElement.prototype.get itemURL):
            (WebInspector.StorageCategoryTreeElement.prototype.onselect):
            (WebInspector.StorageCategoryTreeElement.prototype.onattach):
            (WebInspector.StorageCategoryTreeElement.prototype.onexpand):
            (WebInspector.StorageCategoryTreeElement.prototype.oncollapse):
            (WebInspector.FrameTreeElement.prototype.get itemURL):
            (WebInspector.FrameTreeElement.prototype.onselect):
            (WebInspector.FrameResourceTreeElement.prototype.get itemURL):
            (WebInspector.FrameResourceTreeElement.prototype.onselect):
            (WebInspector.DatabaseTreeElement.prototype.get itemURL):
            (WebInspector.DatabaseTreeElement.prototype.onselect):
            (WebInspector.DatabaseTableTreeElement.prototype.get itemURL):
            (WebInspector.DatabaseTableTreeElement.prototype.onselect):
            (WebInspector.DOMStorageTreeElement.prototype.get itemURL):
            (WebInspector.DOMStorageTreeElement.prototype.onselect):
            (WebInspector.CookieTreeElement.prototype.get itemURL):
            (WebInspector.CookieTreeElement.prototype.onselect):
            (WebInspector.ApplicationCacheTreeElement.prototype.get itemURL):
            (WebInspector.ApplicationCacheTreeElement.prototype.onselect):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70989 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 074bf24..27e04fb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,65 @@
+2010-10-30  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: new resources and network panel usability improvements.
+        https://bugs.webkit.org/show_bug.cgi?id=48680
+
+        By default, navigation clears network log, added 'preserve log' button,
+        that prevents log from being cleared.
+
+        Storing expanded state of all group items, restoring last selected item,
+        fall back to main frame's main resource by default.
+        Do not list XHRs and redirects in resources.
+
+        * English.lproj/localizedStrings.js:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::didLoadResourceFromMemoryCache):
+        (WebCore::InspectorController::identifierForInitialRequest):
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkPanel.prototype.get statusBarItems):
+        (WebInspector.NetworkPanel.prototype._positionSummaryBar):
+        (WebInspector.NetworkPanel.prototype._updateFilter):
+        (WebInspector.NetworkPanel.prototype._createStatusbarButtons):
+        (WebInspector.NetworkPanel.prototype._onPreserveLogClicked):
+        (WebInspector.NetworkPanel.prototype.reset):
+        (WebInspector.NetworkPanel.prototype.refreshResource):
+        * inspector/front-end/ResourceManager.js:
+        (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+        (WebInspector.ResourceManager.prototype.willSendRequest):
+        (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+        (WebInspector.ResourceManager.prototype.setOverrideContent):
+        (WebInspector.ResourceManager.prototype.didCreateWebSocket):
+        * inspector/front-end/StoragePanel.js:
+        (WebInspector.StoragePanel):
+        (WebInspector.StoragePanel.prototype.show):
+        (WebInspector.StoragePanel.prototype._initDefaultSelection):
+        (WebInspector.StoragePanel.prototype.reset):
+        (WebInspector.StoragePanel.prototype.addResourceToFrame):
+        (WebInspector.StoragePanel.prototype.refreshResource):
+        (WebInspector.StoragePanel.prototype.showDatabase):
+        (WebInspector.BaseStorageTreeElement.prototype.onselect):
+        (WebInspector.StorageCategoryTreeElement):
+        (WebInspector.StorageCategoryTreeElement.prototype.get itemURL):
+        (WebInspector.StorageCategoryTreeElement.prototype.onselect):
+        (WebInspector.StorageCategoryTreeElement.prototype.onattach):
+        (WebInspector.StorageCategoryTreeElement.prototype.onexpand):
+        (WebInspector.StorageCategoryTreeElement.prototype.oncollapse):
+        (WebInspector.FrameTreeElement.prototype.get itemURL):
+        (WebInspector.FrameTreeElement.prototype.onselect):
+        (WebInspector.FrameResourceTreeElement.prototype.get itemURL):
+        (WebInspector.FrameResourceTreeElement.prototype.onselect):
+        (WebInspector.DatabaseTreeElement.prototype.get itemURL):
+        (WebInspector.DatabaseTreeElement.prototype.onselect):
+        (WebInspector.DatabaseTableTreeElement.prototype.get itemURL):
+        (WebInspector.DatabaseTableTreeElement.prototype.onselect):
+        (WebInspector.DOMStorageTreeElement.prototype.get itemURL):
+        (WebInspector.DOMStorageTreeElement.prototype.onselect):
+        (WebInspector.CookieTreeElement.prototype.get itemURL):
+        (WebInspector.CookieTreeElement.prototype.onselect):
+        (WebInspector.ApplicationCacheTreeElement.prototype.get itemURL):
+        (WebInspector.ApplicationCacheTreeElement.prototype.onselect):
+
 2010-10-30  Patrick Gansterer  <paroga at webkit.org>
 
         Unreviewed, build fix after r70846.
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index ec16201..1bb3919 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -908,6 +908,8 @@ void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader,
     if (!enabled())
         return;
 
+    ensureSettingsLoaded();
+
 #if LEGACY_RESOURCE_TRACKING_ENABLED
     // If the resource URL is already known, we don't need to add it again since this is just a cached load.
     if (m_knownResources.contains(cachedResource->url()))
@@ -915,7 +917,6 @@ void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader,
 
     ASSERT(m_inspectedPage);
     bool isMainResource = isMainResourceLoader(loader, KURL(ParsedURLString, cachedResource->url()));
-    ensureSettingsLoaded();
     if (!isMainResource && !resourceTrackingEnabled())
         return;
 
@@ -946,9 +947,9 @@ void InspectorController::identifierForInitialRequest(unsigned long identifier,
     if (isMainResource)
         m_mainResourceIdentifier = identifier;
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-
     ensureSettingsLoaded();
+
+#if LEGACY_RESOURCE_TRACKING_ENABLED
     if (!isMainResource && !resourceTrackingEnabled())
         return;
 
diff --git a/WebCore/inspector/front-end/NetworkPanel.js b/WebCore/inspector/front-end/NetworkPanel.js
index c666e54..8c3af6a 100644
--- a/WebCore/inspector/front-end/NetworkPanel.js
+++ b/WebCore/inspector/front-end/NetworkPanel.js
@@ -83,7 +83,7 @@ WebInspector.NetworkPanel.prototype = {
 
     get statusBarItems()
     {
-        return [this._largerResourcesButton.element, this._clearButton.element, this._filterBarElement];
+        return [this._largerResourcesButton.element, this._preserveLogToggle.element, this._clearButton.element, this._filterBarElement];
     },
 
     isCategoryVisible: function(categoryName)
@@ -126,13 +126,9 @@ WebInspector.NetworkPanel.prototype = {
     _positionSummaryBar: function()
     {
         // Position the total bar.
-        const rowHeight = 22;
-        const summaryBarHeight = 22;
-        var offsetHeight = this.element.offsetHeight;
 
-        var parentElement = this._summaryBarElement.parentElement;
-
-        if (this._summaryBarElement.parentElement !== this.element && offsetHeight > (this._dataGrid.children.length - 1) * rowHeight + summaryBarHeight) {
+        var fillerRow = this._dataGrid.dataTableBody.lastChild;
+        if (this._summaryBarElement.parentElement !== this.element && fillerRow.offsetHeight > 0) {
             // Glue status to bottom.
             if (this._summaryBarRowNode) {
                 this._dataGrid.removeChild(this._summaryBarRowNode);
@@ -144,7 +140,7 @@ WebInspector.NetworkPanel.prototype = {
             return;
         }
 
-        if (!this._summaryBarRowNode && offsetHeight - summaryBarHeight < this._dataGrid.children.length * rowHeight) {
+        if (!this._summaryBarRowNode && !fillerRow.offsetHeight) {
             // Glue status to table.
             this._summaryBarRowNode = new WebInspector.NetworkTotalGridNode(this._summaryBarElement);
             this._summaryBarElement.removeStyleClass("network-summary-bar-bottom");
@@ -427,9 +423,7 @@ WebInspector.NetworkPanel.prototype = {
             selectMultiple = true;
 
         this._filter(e.target, selectMultiple);
-
-        var searchField = document.getElementById("search");
-        WebInspector.doPerformSearch(searchField.value, WebInspector.shortSearchWasForcedByKeyEvent, false, true);
+        this._positionSummaryBar();
     },
 
     _filter: function(target, selectMultiple)
@@ -611,6 +605,9 @@ WebInspector.NetworkPanel.prototype = {
 
     _createStatusbarButtons: function()
     {
+        this._preserveLogToggle = new WebInspector.StatusBarButton(WebInspector.UIString("Preserve Log upon Navigation"), "record-profile-status-bar-item");
+        this._preserveLogToggle.addEventListener("click", this._onPreserveLogClicked.bind(this), false);
+
         this._clearButton = new WebInspector.StatusBarButton(WebInspector.UIString("Clear"), "clear-status-bar-item");
         this._clearButton.addEventListener("click", this._reset.bind(this), false);
 
@@ -747,6 +744,17 @@ WebInspector.NetworkPanel.prototype = {
         this._dataGrid.updateWidths();
     },
 
+    _onPreserveLogClicked: function(e)
+    {
+        this._preserveLogToggle.toggled = !this._preserveLogToggle.toggled;
+    },
+
+    reset: function()
+    {
+        if (!this._preserveLogToggle.toggled)
+            this._reset();
+    },
+
     _reset: function()
     {
         this._popoverHelper.hidePopup();
@@ -780,17 +788,22 @@ WebInspector.NetworkPanel.prototype = {
         return this._resourcesById;
     },
 
-    addResource: function(resource)
+    refreshResource: function(resource)
     {
-        this._resources.push(resource);
         if (!resource.identifier)
             resource.identifier = "network:" + this._lastIdentifier++;
-        this._resourcesById[resource.identifier] = resource;
-        this.refreshResource(resource);
-    },
 
-    refreshResource: function(resource)
-    {
+        if (!this._resourcesById[resource.identifier]) {
+            this._resources.push(resource);
+            this._resourcesById[resource.identifier] = resource;
+
+            // Pull all the redirects of the main resource upon commit load.
+            if (resource.redirects) {
+                for (var i = 0; i < resource.redirects.length; ++i)
+                    this.refreshResource(resource.redirects[i]);
+            }
+        }
+
         this._staleResources.push(resource);
         this._scheduleRefresh();
 
diff --git a/WebCore/inspector/front-end/ResourceManager.js b/WebCore/inspector/front-end/ResourceManager.js
index 62273ee..85ae21c 100644
--- a/WebCore/inspector/front-end/ResourceManager.js
+++ b/WebCore/inspector/front-end/ResourceManager.js
@@ -71,7 +71,7 @@ WebInspector.ResourceManager.prototype = {
         // It is important to bind resource url early (before scripts compile).
         this._bindResourceURL(resource);
 
-        WebInspector.panels.network.addResource(resource);
+        WebInspector.panels.network.refreshResource(resource);
         WebInspector.panels.audits.resourceStarted(resource);
     },
 
@@ -104,7 +104,7 @@ WebInspector.ResourceManager.prototype = {
         resource.startTime = time;
 
         if (isRedirect) {
-            WebInspector.panels.network.addResource(resource);
+            WebInspector.panels.network.refreshResource(resource);
             WebInspector.panels.audits.resourceStarted(resource);
         } else 
             WebInspector.panels.network.refreshResource(resource);
@@ -230,7 +230,7 @@ WebInspector.ResourceManager.prototype = {
         resource.cached = true;
         resource.startTime = resource.responseReceivedTime = resource.endTime = time;
 
-        WebInspector.panels.network.addResource(resource);
+        WebInspector.panels.network.refreshResource(resource);
         WebInspector.panels.audits.resourceStarted(resource);
         WebInspector.panels.audits.resourceFinished(resource);
         this._resourceTreeModel.addResourceToFrame(resource.loader.frameId, resource);
@@ -251,6 +251,7 @@ WebInspector.ResourceManager.prototype = {
 
         resource.type = WebInspector.Resource.Type[type];
         resource.content = sourceString;
+        WebInspector.panels.storage.refreshResource(resource);
         WebInspector.panels.network.refreshResource(resource);
     },
 
@@ -270,7 +271,7 @@ WebInspector.ResourceManager.prototype = {
         var resource = this._resourcesById[identifier];
         resource.type = WebInspector.Resource.Type.WebSocket;
 
-        WebInspector.panels.network.addResource(resource);
+        WebInspector.panels.network.refreshResource(resource);
     },
 
     willSendWebSocketHandshakeRequest: function(identifier, time, request)
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index 7d14100..124f736 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -70,6 +70,9 @@ WebInspector.Settings = function()
 WebInspector.Settings.prototype = {
     installApplicationSetting: function(key, defaultValue)
     {
+        if (key in this)
+            return;
+
         this.__defineGetter__(key, this._get.bind(this, key, defaultValue));
         this.__defineSetter__(key, this._set.bind(this, key));
     },
diff --git a/WebCore/inspector/front-end/StoragePanel.js b/WebCore/inspector/front-end/StoragePanel.js
index d19e4e6..243eb83 100644
--- a/WebCore/inspector/front-end/StoragePanel.js
+++ b/WebCore/inspector/front-end/StoragePanel.js
@@ -31,36 +31,32 @@ WebInspector.StoragePanel = function(database)
 {
     WebInspector.Panel.call(this, "storage");
 
+    WebInspector.applicationSettings.installApplicationSetting("resourcesLastSelectedItem", {});
+
     this.createSidebar();
     this.sidebarElement.addStyleClass("outline-disclosure filter-all children small");
     this.sidebarTreeElement.removeStyleClass("sidebar-tree");
 
     if (Preferences.networkPanelEnabled) {
-        this.resourcesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Frames"), "frame-storage-tree-item");
+        this.resourcesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Frames"), "Frames", "frame-storage-tree-item");
         this.sidebarTree.appendChild(this.resourcesListTreeElement);
-        this.resourcesListTreeElement.expand();
         this._treeElementForFrameId = {};
     }
 
-    this.databasesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Databases"), "database-storage-tree-item");
+    this.databasesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Databases"), "Databases", "database-storage-tree-item");
     this.sidebarTree.appendChild(this.databasesListTreeElement);
-    this.databasesListTreeElement.expand();
 
-    this.localStorageListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Local Storage"), "domstorage-storage-tree-item local-storage");
+    this.localStorageListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Local Storage"), "LocalStorage", "domstorage-storage-tree-item local-storage");
     this.sidebarTree.appendChild(this.localStorageListTreeElement);
-    this.localStorageListTreeElement.expand();
 
-    this.sessionStorageListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Session Storage"), "domstorage-storage-tree-item session-storage");
+    this.sessionStorageListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Session Storage"), "SessionStorage", "domstorage-storage-tree-item session-storage");
     this.sidebarTree.appendChild(this.sessionStorageListTreeElement);
-    this.sessionStorageListTreeElement.expand();
 
-    this.cookieListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Cookies"), "cookie-storage-tree-item");
+    this.cookieListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Cookies"), "Cookies", "cookie-storage-tree-item");
     this.sidebarTree.appendChild(this.cookieListTreeElement);
-    this.cookieListTreeElement.expand();
-    
-    this.applicationCacheListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Application Cache"), "application-cache-storage-tree-item");
+
+    this.applicationCacheListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Application Cache"), "ApplicationCache", "application-cache-storage-tree-item");
     this.sidebarTree.appendChild(this.applicationCacheListTreeElement);
-    this.applicationCacheListTreeElement.expand();
 
     if (Preferences.fileSystemEnabled) {
         this.fileSystemListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("File System"), "file-system-storage-tree-item");
@@ -78,6 +74,7 @@ WebInspector.StoragePanel = function(database)
     this._databases = [];
     this._domStorage = [];
     this._cookieViews = {};
+    this._domains = {};
 }
 
 WebInspector.StoragePanel.prototype = {
@@ -91,8 +88,35 @@ WebInspector.StoragePanel.prototype = {
         return [this.storageViewStatusBarItemsContainer];
     },
 
+    show: function()
+    {
+        WebInspector.Panel.prototype.show.call(this);
+        if (this._initializedDefaultSelection)
+            return;
+
+        this._initializedDefaultSelection = true;
+        var itemURL = WebInspector.applicationSettings.resourcesLastSelectedItem;
+        if (itemURL) {
+            for (var treeElement = this.sidebarTree.children[0]; treeElement; treeElement = treeElement.traverseNextTreeElement(false, this.sidebarTree, true)) {
+                if (treeElement.itemURL === itemURL) {
+                    treeElement.select();
+                    treeElement.reveal();
+                    return;
+                }
+            }
+        }
+        this._initDefaultSelection();
+    },
+
+    _initDefaultSelection: function()
+    {
+        if (WebInspector.mainResource && this.resourcesListTreeElement && this.resourcesListTreeElement.expanded)
+            this.showResource(WebInspector.mainResource);
+    },
+
     reset: function()
     {
+        this._domains = {};
         for (var i = 0; i < this._databases.length; ++i) {
             var database = this._databases[i];
             delete database._tableViews;
@@ -174,6 +198,15 @@ WebInspector.StoragePanel.prototype = {
 
     addResourceToFrame: function(frameId, resource)
     {
+        if (!this._domains[resource.domain]) {
+            this._domains[resource.domain] = true;
+            this.addCookieDomain(resource.domain);
+            this.addApplicationCache(resource.domain);
+        }
+
+        if (resource.statusCode >= 301 && resource.statusCode <= 303)
+            return;
+
         var frameTreeElement = this._treeElementForFrameId[frameId];
         if (!frameTreeElement) {
             // This is a frame's main resource, it will be retained
@@ -206,6 +239,15 @@ WebInspector.StoragePanel.prototype = {
             frameTreeElement.removeChildren();
     },
 
+    refreshResource: function(resource)
+    {
+        // FIXME: do not add XHR in the first place based on the native instrumentation.
+        if (resource.type === WebInspector.Resource.Type.XHR) {
+            var resourceTreeElement = this._findTreeElementForResource(resource);
+            resourceTreeElement.parent.removeChild(resourceTreeElement);
+        }
+    },
+
     addDatabase: function(database)
     {
         this._databases.push(database);
@@ -306,7 +348,7 @@ WebInspector.StoragePanel.prototype = {
     {
         if (!database)
             return;
-
+            
         var view;
         if (tableName) {
             if (!("_tableViews" in database))
@@ -683,6 +725,13 @@ WebInspector.BaseStorageTreeElement.prototype = {
         this.listItemElement.appendChild(this.titleElement);
     },
 
+    onselect: function()
+    {
+        var itemURL = this.itemURL;
+        if (itemURL)
+            WebInspector.applicationSettings.resourcesLastSelectedItem = itemURL;
+    },
+
     onreveal: function()
     {
         if (this.listItemElement)
@@ -708,16 +757,41 @@ WebInspector.BaseStorageTreeElement.prototype = {
 
 WebInspector.BaseStorageTreeElement.prototype.__proto__ = TreeElement.prototype;
 
-WebInspector.StorageCategoryTreeElement = function(storagePanel, categoryName, iconClass)
+WebInspector.StorageCategoryTreeElement = function(storagePanel, categoryName, settingsKey, iconClass)
 {
     WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, categoryName, iconClass, true);
+    this._expandedSettingKey = "resources" + settingsKey + "Expanded";
+    WebInspector.applicationSettings.installApplicationSetting(this._expandedSettingKey, settingsKey === "Frames");
     this._categoryName = categoryName;
 }
 
 WebInspector.StorageCategoryTreeElement.prototype = {
+    get itemURL()
+    {
+        return "category://" + this._categoryName;
+    },
+
     onselect: function()
     {
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
         this._storagePanel.showCategoryView(this._categoryName);
+    },
+
+    onattach: function()
+    {
+        WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);
+        if (WebInspector.applicationSettings[this._expandedSettingKey])
+            this.expand();
+    },
+
+    onexpand: function()
+    {
+        WebInspector.applicationSettings[this._expandedSettingKey] = true;
+    },
+
+    oncollapse: function()
+    {
+        WebInspector.applicationSettings[this._expandedSettingKey] = false;
     }
 }
 WebInspector.StorageCategoryTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
@@ -730,8 +804,14 @@ WebInspector.FrameTreeElement = function(storagePanel, frameId, displayName)
 }
 
 WebInspector.FrameTreeElement.prototype = {
+    get itemURL()
+    {
+        return "frame://" + encodeURI(this._displayName);
+    },
+
     onselect: function()
     {
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
         this._storagePanel.showCategoryView(this._displayName);
     },
 
@@ -757,8 +837,14 @@ WebInspector.FrameResourceTreeElement = function(storagePanel, resource)
 }
 
 WebInspector.FrameResourceTreeElement.prototype = {
+    get itemURL()
+    {
+        return this._resource.url;
+    },
+
     onselect: function()
     {
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
         this._storagePanel._showResourceView(this._resource);
     },
 
@@ -869,8 +955,14 @@ WebInspector.DatabaseTreeElement = function(storagePanel, database)
 }
 
 WebInspector.DatabaseTreeElement.prototype = {
+    get itemURL()
+    {
+        return "database://" + encodeURI(this._database.name);
+    },
+
     onselect: function()
     {
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
         this._storagePanel.showDatabase(this._database);
     },
 
@@ -905,8 +997,14 @@ WebInspector.DatabaseTableTreeElement = function(storagePanel, database, tableNa
 }
 
 WebInspector.DatabaseTableTreeElement.prototype = {
+    get itemURL()
+    {
+        return "database://" + encodeURI(this._database.name) + "/" + encodeURI(this._tableName);
+    },
+
     onselect: function()
     {
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
         this._storagePanel.showDatabase(this._database, this._tableName);
     }
 }
@@ -919,8 +1017,14 @@ WebInspector.DOMStorageTreeElement = function(storagePanel, domStorage, classNam
 }
 
 WebInspector.DOMStorageTreeElement.prototype = {
+    get itemURL()
+    {
+        return "storage://" + this._domStorage.domain + "/" + (this._domStorage.isLocalStorage ? "local" : "session");
+    },
+
     onselect: function()
     {
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
         this._storagePanel.showDOMStorage(this._domStorage);
     }
 }
@@ -933,8 +1037,14 @@ WebInspector.CookieTreeElement = function(storagePanel, cookieDomain)
 }
 
 WebInspector.CookieTreeElement.prototype = {
+    get itemURL()
+    {
+        return "cookies://" + this._cookieDomain;
+    },
+
     onselect: function()
     {
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
         this._storagePanel.showCookies(this, this._cookieDomain);
     }
 }
@@ -947,8 +1057,14 @@ WebInspector.ApplicationCacheTreeElement = function(storagePanel, appcacheDomain
 }
 
 WebInspector.ApplicationCacheTreeElement.prototype = {
+    get itemURL()
+    {
+        return "appcache://" + this._appcacheDomain;
+    },
+
     onselect: function()
     {
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
         this._storagePanel.showApplicationCache(this, this._appcacheDomain);
     }
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list