Changeset 216147 in webkit


Ignore:
Timestamp:
May 3, 2017 3:13:26 PM (7 years ago)
Author:
Nikita Vasilyev
Message:

Uncaught Exception: Can't make a ContentView for an unknown representedObject of type: IndexedDatabase
https://bugs.webkit.org/show_bug.cgi?id=167473
<rdar://problem/30249715>

Reviewed by Matt Baker.

When an indexed database is selected in the Storage navigation sidebar, show its host, security origin, and version.

Previously, selecting an indexed database didn't change the content view. It could lead to a misleading state
when an indexed database is selected in the sidebar, but the content view showed previously selected item such as
Cookies or Local Storage.

  • UserInterface/Main.html:
  • UserInterface/Views/ContentView.css:

(.content-view .details-section):
(.content-view .details-section > .content):
(.content-view .details-section > .content > .group > .row.simple > .label):
(.content-view .details-section:last-child):

  • UserInterface/Views/ContentView.js:

(WebInspector.ContentView.createFromRepresentedObject):
(WebInspector.ContentView.isViewable):

  • UserInterface/Views/IndexedDatabaseContentView.css: Added.

(.indexed-database.content-view):
(.indexed-database.content-view .indexed-database-details):
(.indexed-database.content-view .details-section > .header):

  • UserInterface/Views/IndexedDatabaseContentView.js: Added.

(WebInspector.IndexedDatabaseContentView):

  • UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:

(WebInspector.IndexedDatabaseDetailsSidebarPanel.prototype.inspect):
Don't show the details sidebar for IndexedDB top level item since it has the same content as the content view.

  • UserInterface/Views/StorageSidebarPanel.js:

(WebInspector.StorageSidebarPanel._treeSelectionDidChange):

  • UserInterface/Views/StorageTabContentView.js:

(WebInspector.StorageTabContentView.prototype.canShowRepresentedObject):
(WebInspector.StorageTabContentView):

Location:
trunk/Source/WebInspectorUI
Files:
7 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r216138 r216147  
     12017-05-03  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        Uncaught Exception: Can't make a ContentView for an unknown representedObject of type: IndexedDatabase
     4        https://bugs.webkit.org/show_bug.cgi?id=167473
     5        <rdar://problem/30249715>
     6
     7        Reviewed by Matt Baker.
     8
     9        When an indexed database is selected in the Storage navigation sidebar, show its host, security origin, and version.
     10
     11        Previously, selecting an indexed database didn't change the content view. It could lead to a misleading state
     12        when an indexed database is selected in the sidebar, but the content view showed previously selected item such as
     13        Cookies or Local Storage.
     14
     15        * UserInterface/Main.html:
     16        * UserInterface/Views/ContentView.css:
     17        (.content-view .details-section):
     18        (.content-view .details-section > .content):
     19        (.content-view .details-section > .content > .group > .row.simple > .label):
     20        (.content-view .details-section:last-child):
     21        * UserInterface/Views/ContentView.js:
     22        (WebInspector.ContentView.createFromRepresentedObject):
     23        (WebInspector.ContentView.isViewable):
     24        * UserInterface/Views/IndexedDatabaseContentView.css: Added.
     25        (.indexed-database.content-view):
     26        (.indexed-database.content-view .indexed-database-details):
     27        (.indexed-database.content-view .details-section > .header):
     28        * UserInterface/Views/IndexedDatabaseContentView.js: Added.
     29        (WebInspector.IndexedDatabaseContentView):
     30        * UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:
     31        (WebInspector.IndexedDatabaseDetailsSidebarPanel.prototype.inspect):
     32        Don't show the details sidebar for IndexedDB top level item since it has the same content as the content view.
     33
     34        * UserInterface/Views/StorageSidebarPanel.js:
     35        (WebInspector.StorageSidebarPanel._treeSelectionDidChange):
     36        * UserInterface/Views/StorageTabContentView.js:
     37        (WebInspector.StorageTabContentView.prototype.canShowRepresentedObject):
     38        (WebInspector.StorageTabContentView):
     39
    1402017-05-03  Joseph Pecoraro  <pecoraro@apple.com>
    241
  • trunk/Source/WebInspectorUI/UserInterface/Main.html

    r215915 r216147  
    103103    <link rel="stylesheet" href="Views/ImageResourceContentView.css">
    104104    <link rel="stylesheet" href="Views/IndeterminateProgressSpinner.css">
     105    <link rel="stylesheet" href="Views/IndexedDatabaseContentView.css">
    105106    <link rel="stylesheet" href="Views/IndexedDatabaseObjectStoreContentView.css">
    106107    <link rel="stylesheet" href="Views/InlineSwatch.css">
     
    587588    <script src="Views/ImageResourceContentView.js"></script>
    588589    <script src="Views/IndeterminateProgressSpinner.js"></script>
     590    <script src="Views/IndexedDatabaseContentView.js"></script>
    589591    <script src="Views/IndexedDatabaseDetailsSidebarPanel.js"></script>
    590592    <script src="Views/IndexedDatabaseEntryDataGridNode.js"></script>
  • trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.css

    r164543 r216147  
    3535    margin-right: -16px;
    3636}
     37
     38.content-view .details-section {
     39    font-size: 11px;
     40    background-color: initial;
     41}
     42
     43.content-view .details-section > .content {
     44    width: auto;
     45}
     46
     47.content-view .details-section > .content > .group > .row.simple > .label {
     48    width: auto;
     49    font-weight: 600;
     50}
     51
     52.content-view .details-section:last-child {
     53    border-bottom: none;
     54}
  • trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js

    r215113 r216147  
    9696            return new WebInspector.DatabaseContentView(representedObject, extraArguments);
    9797
     98        if (representedObject instanceof WebInspector.IndexedDatabase)
     99            return new WebInspector.IndexedDatabaseContentView(representedObject, extraArguments);
     100
    98101        if (representedObject instanceof WebInspector.IndexedDatabaseObjectStore)
    99102            return new WebInspector.IndexedDatabaseObjectStoreContentView(representedObject, extraArguments);
     
    246249        if (representedObject instanceof WebInspector.DatabaseObject)
    247250            return true;
     251        if (representedObject instanceof WebInspector.IndexedDatabase)
     252            return true;
    248253        if (representedObject instanceof WebInspector.IndexedDatabaseObjectStore)
    249254            return true;
  • trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseContentView.css

    r216145 r216147  
    11/*
    2  * Copyright (C) 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 .content-view > .indeterminate-progress-spinner {
    27     position: absolute;
    28     top: 50%;
    29     left: 50%;
     26.indexed-database.content-view {
     27    -webkit-user-select: text;
     28}
    3029
    31     width: 32px;
    32     height: 32px;
     30.indexed-database.content-view .indexed-database-details {
     31    margin: 0.4em 1.2em;
     32}
    3333
    34     margin-left: -16px;
    35     margin-right: -16px;
     34.indexed-database.content-view .details-section > .header {
     35    display: none;
    3636}
  • trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseContentView.js

    r216145 r216147  
    11/*
    2  * Copyright (C) 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 .content-view > .indeterminate-progress-spinner {
    27     position: absolute;
    28     top: 50%;
    29     left: 50%;
     26WebInspector.IndexedDatabaseContentView = class IndexedDatabaseContentView extends WebInspector.ContentView
     27{
     28    constructor(database)
     29    {
     30        super(database);
    3031
    31     width: 32px;
    32     height: 32px;
     32        this._element.classList.add("indexed-database");
    3333
    34     margin-left: -16px;
    35     margin-right: -16px;
    36 }
     34        this._databaseHostRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Host"));
     35        this._databaseSecurityOriginRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Security Origin"));
     36        this._databaseVersionRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Version"));
     37        this._databaseGroup = new WebInspector.DetailsSectionGroup([this._databaseHostRow, this._databaseSecurityOriginRow, this._databaseVersionRow]);
     38        this._databaseSection = new WebInspector.DetailsSection("indexed-database-details", WebInspector.UIString("Database"), [this._databaseGroup]);
     39
     40        this.element.append(this._databaseSection.element);
     41
     42        this._databaseHostRow.value = database.host;
     43        this._databaseSecurityOriginRow.value = database.securityOrigin;
     44        this._databaseVersionRow.value = database.version.toLocaleString();
     45    }
     46};
  • trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js

    r214405 r216147  
    7373
    7474        for (let object of objects) {
    75             if (object instanceof WebInspector.IndexedDatabase) {
    76                 console.assert(!this._database, "Shouldn't have multiple IndexedDatabase objects in the list.");
    77                 this._database = object;
    78             } else if (object instanceof WebInspector.IndexedDatabaseObjectStore) {
     75            if (object instanceof WebInspector.IndexedDatabaseObjectStore) {
    7976                console.assert(!this._database, "Shouldn't have multiple IndexedDatabase objects in the list.");
    8077                this._objectStore = object;
  • trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js

    r206195 r216147  
    179179
    180180        if (treeElement instanceof WebInspector.FolderTreeElement || treeElement instanceof WebInspector.DatabaseHostTreeElement ||
    181             treeElement instanceof WebInspector.IndexedDatabaseHostTreeElement || treeElement instanceof WebInspector.IndexedDatabaseTreeElement
    182             || treeElement instanceof WebInspector.ApplicationCacheManifestTreeElement)
     181            treeElement instanceof WebInspector.IndexedDatabaseHostTreeElement || treeElement instanceof WebInspector.ApplicationCacheManifestTreeElement)
    183182            return;
    184183
    185184        if (treeElement instanceof WebInspector.StorageTreeElement || treeElement instanceof WebInspector.DatabaseTableTreeElement ||
    186185            treeElement instanceof WebInspector.DatabaseTreeElement || treeElement instanceof WebInspector.ApplicationCacheFrameTreeElement ||
    187             treeElement instanceof WebInspector.IndexedDatabaseObjectStoreTreeElement || treeElement instanceof WebInspector.IndexedDatabaseObjectStoreIndexTreeElement) {
     186            treeElement instanceof WebInspector.IndexedDatabaseTreeElement || treeElement instanceof WebInspector.IndexedDatabaseObjectStoreTreeElement || treeElement instanceof WebInspector.IndexedDatabaseObjectStoreIndexTreeElement) {
    188187            WebInspector.showRepresentedObject(treeElement.representedObject);
    189188            return;
  • trunk/Source/WebInspectorUI/UserInterface/Views/StorageTabContentView.js

    r212400 r216147  
    6565            representedObject instanceof WebInspector.DatabaseTableObject || representedObject instanceof WebInspector.DatabaseObject ||
    6666            representedObject instanceof WebInspector.ApplicationCacheFrame || representedObject instanceof WebInspector.IndexedDatabaseObjectStore ||
    67             representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex;
     67            representedObject instanceof WebInspector.IndexedDatabase || representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex;
    6868    }
    6969};
Note: See TracChangeset for help on using the changeset viewer.