- Revision
- 216147
- Author
- [email protected]
- Date
- 2017-05-03 15:13:26 -0700 (Wed, 03 May 2017)
Log 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):
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (216146 => 216147)
--- trunk/Source/WebInspectorUI/ChangeLog 2017-05-03 22:06:11 UTC (rev 216146)
+++ trunk/Source/WebInspectorUI/ChangeLog 2017-05-03 22:13:26 UTC (rev 216147)
@@ -1,3 +1,42 @@
+2017-05-03 Nikita Vasilyev <[email protected]>
+
+ 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):
+
2017-05-03 Joseph Pecoraro <[email protected]>
Web Inspector: 404 Image Load does not appear as a failure in Web Inspector
Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (216146 => 216147)
--- trunk/Source/WebInspectorUI/UserInterface/Main.html 2017-05-03 22:06:11 UTC (rev 216146)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html 2017-05-03 22:13:26 UTC (rev 216147)
@@ -102,6 +102,7 @@
<link rel="stylesheet" href=""
<link rel="stylesheet" href=""
<link rel="stylesheet" href=""
+ <link rel="stylesheet" href=""
<link rel="stylesheet" href=""
<link rel="stylesheet" href=""
<link rel="stylesheet" href=""
@@ -586,6 +587,7 @@
<script src=""
<script src=""
<script src=""
+ <script src=""
<script src=""
<script src=""
<script src=""
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.css (216146 => 216147)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.css 2017-05-03 22:06:11 UTC (rev 216146)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.css 2017-05-03 22:13:26 UTC (rev 216147)
@@ -34,3 +34,21 @@
margin-left: -16px;
margin-right: -16px;
}
+
+.content-view .details-section {
+ font-size: 11px;
+ background-color: initial;
+}
+
+.content-view .details-section > .content {
+ width: auto;
+}
+
+.content-view .details-section > .content > .group > .row.simple > .label {
+ width: auto;
+ font-weight: 600;
+}
+
+.content-view .details-section:last-child {
+ border-bottom: none;
+}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js (216146 => 216147)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js 2017-05-03 22:06:11 UTC (rev 216146)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js 2017-05-03 22:13:26 UTC (rev 216147)
@@ -95,6 +95,9 @@
if (representedObject instanceof WebInspector.DatabaseObject)
return new WebInspector.DatabaseContentView(representedObject, extraArguments);
+ if (representedObject instanceof WebInspector.IndexedDatabase)
+ return new WebInspector.IndexedDatabaseContentView(representedObject, extraArguments);
+
if (representedObject instanceof WebInspector.IndexedDatabaseObjectStore)
return new WebInspector.IndexedDatabaseObjectStoreContentView(representedObject, extraArguments);
@@ -245,6 +248,8 @@
return true;
if (representedObject instanceof WebInspector.DatabaseObject)
return true;
+ if (representedObject instanceof WebInspector.IndexedDatabase)
+ return true;
if (representedObject instanceof WebInspector.IndexedDatabaseObjectStore)
return true;
if (representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex)
Copied: trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseContentView.css (from rev 216145, trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.css) (0 => 216147)
--- trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseContentView.css (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseContentView.css 2017-05-03 22:13:26 UTC (rev 216147)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+.indexed-database.content-view {
+ -webkit-user-select: text;
+}
+
+.indexed-database.content-view .indexed-database-details {
+ margin: 0.4em 1.2em;
+}
+
+.indexed-database.content-view .details-section > .header {
+ display: none;
+}
Copied: trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseContentView.js (from rev 216145, trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.css) (0 => 216147)
--- trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseContentView.js (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseContentView.js 2017-05-03 22:13:26 UTC (rev 216147)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.IndexedDatabaseContentView = class IndexedDatabaseContentView extends WebInspector.ContentView
+{
+ constructor(database)
+ {
+ super(database);
+
+ this._element.classList.add("indexed-database");
+
+ this._databaseHostRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Host"));
+ this._databaseSecurityOriginRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Security Origin"));
+ this._databaseVersionRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Version"));
+ this._databaseGroup = new WebInspector.DetailsSectionGroup([this._databaseHostRow, this._databaseSecurityOriginRow, this._databaseVersionRow]);
+ this._databaseSection = new WebInspector.DetailsSection("indexed-database-details", WebInspector.UIString("Database"), [this._databaseGroup]);
+
+ this.element.append(this._databaseSection.element);
+
+ this._databaseHostRow.value = database.host;
+ this._databaseSecurityOriginRow.value = database.securityOrigin;
+ this._databaseVersionRow.value = database.version.toLocaleString();
+ }
+};
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js (216146 => 216147)
--- trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js 2017-05-03 22:06:11 UTC (rev 216146)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js 2017-05-03 22:13:26 UTC (rev 216147)
@@ -72,11 +72,8 @@
this._index = null;
for (let object of objects) {
- if (object instanceof WebInspector.IndexedDatabase) {
+ if (object instanceof WebInspector.IndexedDatabaseObjectStore) {
console.assert(!this._database, "Shouldn't have multiple IndexedDatabase objects in the list.");
- this._database = object;
- } else if (object instanceof WebInspector.IndexedDatabaseObjectStore) {
- console.assert(!this._database, "Shouldn't have multiple IndexedDatabase objects in the list.");
this._objectStore = object;
this._database = this._objectStore.parentDatabase;
} else if (object instanceof WebInspector.IndexedDatabaseObjectStoreIndex) {
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js (216146 => 216147)
--- trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js 2017-05-03 22:06:11 UTC (rev 216146)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js 2017-05-03 22:13:26 UTC (rev 216147)
@@ -178,13 +178,12 @@
return;
if (treeElement instanceof WebInspector.FolderTreeElement || treeElement instanceof WebInspector.DatabaseHostTreeElement ||
- treeElement instanceof WebInspector.IndexedDatabaseHostTreeElement || treeElement instanceof WebInspector.IndexedDatabaseTreeElement
- || treeElement instanceof WebInspector.ApplicationCacheManifestTreeElement)
+ treeElement instanceof WebInspector.IndexedDatabaseHostTreeElement || treeElement instanceof WebInspector.ApplicationCacheManifestTreeElement)
return;
if (treeElement instanceof WebInspector.StorageTreeElement || treeElement instanceof WebInspector.DatabaseTableTreeElement ||
treeElement instanceof WebInspector.DatabaseTreeElement || treeElement instanceof WebInspector.ApplicationCacheFrameTreeElement ||
- treeElement instanceof WebInspector.IndexedDatabaseObjectStoreTreeElement || treeElement instanceof WebInspector.IndexedDatabaseObjectStoreIndexTreeElement) {
+ treeElement instanceof WebInspector.IndexedDatabaseTreeElement || treeElement instanceof WebInspector.IndexedDatabaseObjectStoreTreeElement || treeElement instanceof WebInspector.IndexedDatabaseObjectStoreIndexTreeElement) {
WebInspector.showRepresentedObject(treeElement.representedObject);
return;
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/StorageTabContentView.js (216146 => 216147)
--- trunk/Source/WebInspectorUI/UserInterface/Views/StorageTabContentView.js 2017-05-03 22:06:11 UTC (rev 216146)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/StorageTabContentView.js 2017-05-03 22:13:26 UTC (rev 216147)
@@ -64,7 +64,7 @@
return representedObject instanceof WebInspector.DOMStorageObject || representedObject instanceof WebInspector.CookieStorageObject ||
representedObject instanceof WebInspector.DatabaseTableObject || representedObject instanceof WebInspector.DatabaseObject ||
representedObject instanceof WebInspector.ApplicationCacheFrame || representedObject instanceof WebInspector.IndexedDatabaseObjectStore ||
- representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex;
+ representedObject instanceof WebInspector.IndexedDatabase || representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex;
}
};