Changeset 143209 in webkit


Ignore:
Timestamp:
Feb 18, 2013 6:10:27 AM (11 years ago)
Author:
apavlov@chromium.org
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r143207 r143209  
     12013-02-18  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [Resources] Only remember the tree element selection if explicitly made by user
     4        https://bugs.webkit.org/show_bug.cgi?id=110105
     5
     6        Reviewed by Pavel Feldman.
     7
     8        This change instructs the Resources panel to remember the selected tree element only if it has been
     9        selected by the user (not automatically, like selecting a parent when its child is removed).
     10        All onselect() overrides pass the selectedByUser argument value
     11        to BaseStorageTreeElement.prototype.onselect.
     12        Drive-by: Use === comparisons everywhere.
     13
     14        * inspector/front-end/ResourcesPanel.js:
     15        (WebInspector.ResourcesPanel.prototype._reset): Do not detach [immutable] category views.
     16        (WebInspector.BaseStorageTreeElement.prototype.onselect): Remember itemURL on user gesture only.
     17        (WebInspector.StorageCategoryTreeElement.prototype.onselect):
     18        (WebInspector.FrameTreeElement.prototype.onselect):
     19        (WebInspector.FrameResourceTreeElement.prototype.onselect):
     20        (WebInspector.DatabaseTreeElement.prototype.onselect):
     21        (WebInspector.DatabaseTableTreeElement.prototype.onselect):
     22        (WebInspector.IDBDatabaseTreeElement.prototype.onselect):
     23        (WebInspector.IDBObjectStoreTreeElement.prototype.onselect):
     24        (WebInspector.IDBIndexTreeElement.prototype.onselect):
     25        (WebInspector.DOMStorageTreeElement):
     26        (WebInspector.DOMStorageTreeElement.prototype.onselect):
     27        (WebInspector.CookieTreeElement.prototype.onselect):
     28        (WebInspector.ApplicationCacheManifestTreeElement.prototype.onselect):
     29        (WebInspector.ApplicationCacheFrameTreeElement.prototype.onselect):
     30        (WebInspector.FileSystemTreeElement.prototype.onselect):
     31        (WebInspector.FileSystemTreeElement.prototype.clear):
     32        (WebInspector.ResourcesSearchController.prototype.nextSearchResult):
     33
    1342013-02-18  Vladislav Kaznacheev  <kaznacheev@chromium.org>
    235
  • trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js

    r142161 r143209  
    194194        this.cookieListTreeElement.removeChildren();
    195195
    196         if (this.visibleView)
     196        if (this.visibleView && !(this.visibleView instanceof WebInspector.StorageCategoryView))
    197197            this.visibleView.detach();
    198198
     
    934934    },
    935935
    936     onselect: function()
    937     {
     936    onselect: function(selectedByUser)
     937    {
     938        if (!selectedByUser)
     939            return;
    938940        var itemURL = this.itemURL;
    939941        if (itemURL)
     
    996998    },
    997999
    998     onselect: function()
    999     {
    1000         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1000    onselect: function(selectedByUser)
     1001    {
     1002        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    10011003        this._storagePanel.showCategoryView(this._categoryName);
    10021004    },
     
    10531055    },
    10541056
    1055     onselect: function()
    1056     {
    1057         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1057    onselect: function(selectedByUser)
     1058    {
     1059        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    10581060        this._storagePanel.showCategoryView(this.displayName);
    10591061
     
    11611163    },
    11621164
    1163     onselect: function()
    1164     {
    1165         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1165    onselect: function(selectedByUser)
     1166    {
     1167        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    11661168        this._storagePanel._showResourceView(this._resource);
    11671169    },
     
    13281330    },
    13291331
    1330     onselect: function()
    1331     {
    1332         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1332    onselect: function(selectedByUser)
     1333    {
     1334        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    13331335        this._storagePanel._showDatabase(this._database);
    13341336    },
     
    13721374    },
    13731375
    1374     onselect: function()
    1375     {
    1376         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1376    onselect: function(selectedByUser)
     1377    {
     1378        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    13771379        this._storagePanel._showDatabase(this._database, this._tableName);
    13781380    },
     
    16441646    },
    16451647
    1646     onselect: function()
    1647     {
    1648         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1648    onselect: function(selectedByUser)
     1649    {
     1650        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    16491651        if (!this._view)
    16501652            this._view = new WebInspector.IDBDatabaseView(this._database);
     
    17451747    },
    17461748
    1747     onselect: function()
    1748     {
    1749         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1749    onselect: function(selectedByUser)
     1750    {
     1751        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    17501752        if (!this._view)
    17511753            this._view = new WebInspector.IDBDataView(this._model, this._databaseId, this._objectStore, null);
     
    18251827    },
    18261828
    1827     onselect: function()
    1828     {
    1829         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1829    onselect: function(selectedByUser)
     1830    {
     1831        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    18301832        if (!this._view)
    18311833            this._view = new WebInspector.IDBDataView(this._model, this._databaseId, this._objectStore, this._index);
     
    18591861    },
    18601862
    1861     onselect: function()
    1862     {
    1863         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1863    onselect: function(selectedByUser)
     1864    {
     1865        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    18641866        this._storagePanel._showDOMStorage(this._domStorage);
    18651867    },
     
    18841886    },
    18851887
    1886     onselect: function()
    1887     {
    1888         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1888    onselect: function(selectedByUser)
     1889    {
     1890        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    18891891        this._storagePanel.showCookies(this, this._cookieDomain);
    18901892    },
     
    19161918    },
    19171919
    1918     onselect: function()
    1919     {
    1920         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1920    onselect: function(selectedByUser)
     1921    {
     1922        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    19211923        this._storagePanel.showCategoryView(this._manifestURL);
    19221924    },
     
    19691971    },
    19701972
    1971     onselect: function()
    1972     {
    1973         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     1973    onselect: function(selectedByUser)
     1974    {
     1975        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    19741976        this._storagePanel.showApplicationCache(this._frameId);
    19751977    },
     
    20022004    },
    20032005
    2004     onselect: function()
    2005     {
    2006         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
     2006    onselect: function(selectedByUser)
     2007    {
     2008        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
    20072009        this._fileSystemView = new WebInspector.FileSystemView(this._fileSystem);
    20082010        this._storagePanel.showFileSystem(this._fileSystemView);
     
    20112013    clear: function()
    20122014    {
    2013         if (this.fileSystemView && this._storagePanel.visibleView == this.fileSystemView)
     2015        if (this.fileSystemView && this._storagePanel.visibleView === this.fileSystemView)
    20142016            this._storagePanel.closeVisibleView();
    20152017    },
     
    20692071            return this._searchResult(currentTreeElement, 0);
    20702072
    2071         if (this._lastIndex == currentTreeElement.searchMatchesCount - 1)
     2073        if (this._lastIndex === currentTreeElement.searchMatchesCount - 1)
    20722074            return this._searchResult(this._traverser.next(currentTreeElement), 0, this._currentMatchIndex % this._matchesCount + 1);
    20732075
Note: See TracChangeset for help on using the changeset viewer.