Title: [143209] trunk/Source/WebCore
Revision
143209
Author
[email protected]
Date
2013-02-18 06:10:27 -0800 (Mon, 18 Feb 2013)

Log Message

Web Inspector: [Resources] Only remember the tree element selection if explicitly made by user
https://bugs.webkit.org/show_bug.cgi?id=110105

Reviewed by Pavel Feldman.

This change instructs the Resources panel to remember the selected tree element only if it has been
selected by the user (not automatically, like selecting a parent when its child is removed).
All onselect() overrides pass the selectedByUser argument value
to BaseStorageTreeElement.prototype.onselect.
Drive-by: Use === comparisons everywhere.

* inspector/front-end/ResourcesPanel.js:
(WebInspector.ResourcesPanel.prototype._reset): Do not detach [immutable] category views.
(WebInspector.BaseStorageTreeElement.prototype.onselect): Remember itemURL on user gesture only.
(WebInspector.StorageCategoryTreeElement.prototype.onselect):
(WebInspector.FrameTreeElement.prototype.onselect):
(WebInspector.FrameResourceTreeElement.prototype.onselect):
(WebInspector.DatabaseTreeElement.prototype.onselect):
(WebInspector.DatabaseTableTreeElement.prototype.onselect):
(WebInspector.IDBDatabaseTreeElement.prototype.onselect):
(WebInspector.IDBObjectStoreTreeElement.prototype.onselect):
(WebInspector.IDBIndexTreeElement.prototype.onselect):
(WebInspector.DOMStorageTreeElement):
(WebInspector.DOMStorageTreeElement.prototype.onselect):
(WebInspector.CookieTreeElement.prototype.onselect):
(WebInspector.ApplicationCacheManifestTreeElement.prototype.onselect):
(WebInspector.ApplicationCacheFrameTreeElement.prototype.onselect):
(WebInspector.FileSystemTreeElement.prototype.onselect):
(WebInspector.FileSystemTreeElement.prototype.clear):
(WebInspector.ResourcesSearchController.prototype.nextSearchResult):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (143208 => 143209)


--- trunk/Source/WebCore/ChangeLog	2013-02-18 14:03:56 UTC (rev 143208)
+++ trunk/Source/WebCore/ChangeLog	2013-02-18 14:10:27 UTC (rev 143209)
@@ -1,3 +1,36 @@
+2013-02-18  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: [Resources] Only remember the tree element selection if explicitly made by user
+        https://bugs.webkit.org/show_bug.cgi?id=110105
+
+        Reviewed by Pavel Feldman.
+
+        This change instructs the Resources panel to remember the selected tree element only if it has been
+        selected by the user (not automatically, like selecting a parent when its child is removed).
+        All onselect() overrides pass the selectedByUser argument value
+        to BaseStorageTreeElement.prototype.onselect.
+        Drive-by: Use === comparisons everywhere.
+
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype._reset): Do not detach [immutable] category views.
+        (WebInspector.BaseStorageTreeElement.prototype.onselect): Remember itemURL on user gesture only.
+        (WebInspector.StorageCategoryTreeElement.prototype.onselect):
+        (WebInspector.FrameTreeElement.prototype.onselect):
+        (WebInspector.FrameResourceTreeElement.prototype.onselect):
+        (WebInspector.DatabaseTreeElement.prototype.onselect):
+        (WebInspector.DatabaseTableTreeElement.prototype.onselect):
+        (WebInspector.IDBDatabaseTreeElement.prototype.onselect):
+        (WebInspector.IDBObjectStoreTreeElement.prototype.onselect):
+        (WebInspector.IDBIndexTreeElement.prototype.onselect):
+        (WebInspector.DOMStorageTreeElement):
+        (WebInspector.DOMStorageTreeElement.prototype.onselect):
+        (WebInspector.CookieTreeElement.prototype.onselect):
+        (WebInspector.ApplicationCacheManifestTreeElement.prototype.onselect):
+        (WebInspector.ApplicationCacheFrameTreeElement.prototype.onselect):
+        (WebInspector.FileSystemTreeElement.prototype.onselect):
+        (WebInspector.FileSystemTreeElement.prototype.clear):
+        (WebInspector.ResourcesSearchController.prototype.nextSearchResult):
+
 2013-02-18  Vladislav Kaznacheev  <[email protected]>
 
         Web Inspector: Color picker should not be available in Computed Styles pane

Modified: trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js (143208 => 143209)


--- trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js	2013-02-18 14:03:56 UTC (rev 143208)
+++ trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js	2013-02-18 14:10:27 UTC (rev 143209)
@@ -193,7 +193,7 @@
         this.sessionStorageListTreeElement.removeChildren();
         this.cookieListTreeElement.removeChildren();
 
-        if (this.visibleView)
+        if (this.visibleView && !(this.visibleView instanceof WebInspector.StorageCategoryView))
             this.visibleView.detach();
 
         this.storageViewStatusBarItemsContainer.removeChildren();
@@ -933,8 +933,10 @@
         }
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
+        if (!selectedByUser)
+            return;
         var itemURL = this.itemURL;
         if (itemURL)
             WebInspector.settings.resourcesLastSelectedItem.set(itemURL);
@@ -995,9 +997,9 @@
         return "category://" + this._categoryName;
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel.showCategoryView(this._categoryName);
     },
 
@@ -1052,9 +1054,9 @@
         return "frame://" + encodeURI(this.displayName);
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel.showCategoryView(this.displayName);
 
         this.listItemElement.removeStyleClass("hovered");
@@ -1160,9 +1162,9 @@
         return this._resource.url;
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel._showResourceView(this._resource);
     },
 
@@ -1327,9 +1329,9 @@
         return "database://" + encodeURI(this._database.name);
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel._showDatabase(this._database);
     },
 
@@ -1371,9 +1373,9 @@
         return "database://" + encodeURI(this._database.name) + "/" + encodeURI(this._tableName);
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel._showDatabase(this._database, this._tableName);
     },
 
@@ -1643,9 +1645,9 @@
         this.tooltip = WebInspector.UIString("Version") + ": " + this._database.version;
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         if (!this._view)
             this._view = new WebInspector.IDBDatabaseView(this._database);
 
@@ -1744,9 +1746,9 @@
         this.tooltip = tooltipString
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         if (!this._view)
             this._view = new WebInspector.IDBDataView(this._model, this._databaseId, this._objectStore, null);
 
@@ -1824,9 +1826,9 @@
         this.tooltip = tooltipLines.join("\n");
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         if (!this._view)
             this._view = new WebInspector.IDBDataView(this._model, this._databaseId, this._objectStore, this._index);
 
@@ -1858,9 +1860,9 @@
         return "storage://" + this._domStorage.domain + "/" + (this._domStorage.isLocalStorage ? "local" : "session");
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel._showDOMStorage(this._domStorage);
     },
 
@@ -1883,9 +1885,9 @@
         return "cookies://" + this._cookieDomain;
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel.showCookies(this, this._cookieDomain);
     },
 
@@ -1915,9 +1917,9 @@
         return this._manifestURL;
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel.showCategoryView(this._manifestURL);
     },
 
@@ -1968,9 +1970,9 @@
         this._refreshTitles();
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel.showApplicationCache(this._frameId);
     },
 
@@ -2001,16 +2003,16 @@
         return "filesystem://" + this._fileSystem.name;
     },
 
-    onselect: function()
+    onselect: function(selectedByUser)
     {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
+        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._fileSystemView = new WebInspector.FileSystemView(this._fileSystem);
         this._storagePanel.showFileSystem(this._fileSystemView);
     },
 
     clear: function()
     {
-        if (this.fileSystemView && this._storagePanel.visibleView == this.fileSystemView)
+        if (this.fileSystemView && this._storagePanel.visibleView === this.fileSystemView)
             this._storagePanel.closeVisibleView();
     },
 
@@ -2068,7 +2070,7 @@
         if (this._lastTreeElement !== currentTreeElement || this._lastIndex === -1)
             return this._searchResult(currentTreeElement, 0);
 
-        if (this._lastIndex == currentTreeElement.searchMatchesCount - 1)
+        if (this._lastIndex === currentTreeElement.searchMatchesCount - 1)
             return this._searchResult(this._traverser.next(currentTreeElement), 0, this._currentMatchIndex % this._matchesCount + 1);
 
         return this._searchResult(currentTreeElement, this._lastIndex + 1, this._currentMatchIndex + 1);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to