Web Inspector: Array/Collection Sizes should be visible and distinct
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Mar 2015 02:27:23 +0000 (02:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Mar 2015 02:27:23 +0000 (02:27 +0000)
commit12fd0bcb40b78a4949ffae5e38cd14f9ff493312
treea7e45e6582802140b5a2279f57b38817496c2081
parent0bde4c88b4e979d118ae9544da3cb35ce26bfa7e
Web Inspector: Array/Collection Sizes should be visible and distinct
https://bugs.webkit.org/show_bug.cgi?id=142254

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-04
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* runtime/WeakMapData.h:
(JSC::WeakMapData::size):
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::weakMapSize):
* inspector/JSInjectedScriptHost.h:
* inspector/JSInjectedScriptHostPrototype.cpp:
(Inspector::JSInjectedScriptHostPrototype::finishCreation):
(Inspector::jsInjectedScriptHostPrototypeFunctionWeakMapSize):
Add a way to get a WeakMap's size.

* inspector/protocol/Runtime.json:
Include size in RemoteObject and ObjectPreview.

* inspector/InjectedScriptSource.js:
Set the size of RemoteObjects and previews if they
are array/collection types.

Source/WebInspectorUI:

* UserInterface/Models/ObjectPreview.js:
(WebInspector.ObjectPreview):
(WebInspector.ObjectPreview.fromPayload):
(WebInspector.ObjectPreview.prototype.get size):
(WebInspector.ObjectPreview.prototype.hasSize):
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject):
(WebInspector.RemoteObject.fromPrimitiveValue):
(WebInspector.RemoteObject.fromPayload):
(WebInspector.RemoteObject.prototype.get size):
(WebInspector.RemoteObject.prototype.hasSize):
Check if this type has a size and get the size.
Gracefully handle construction for legacy protocols.

* UserInterface/Views/ObjectPreviewView.css:
(.object-preview > .size):
* UserInterface/Views/FormattedValue.css:
(:matches(.formatted-array, .formatted-map, .formatted-set, .formatted-weakmap) > .size):
Style the array/collection size.

* UserInterface/Views/ObjectPreviewView.js:
(WebInspector.ObjectPreviewView):
* UserInterface/Views/FormattedValue.js:
(WebInspector.FormattedValue.createElementForTypesAndValue):
(WebInspector.FormattedValue.createElementForRemoteObject):
(WebInspector.FormattedValue.createElementForObjectPreview):
(WebInspector.FormattedValue.createElementForPropertyPreview):
Add an element showing the array/collection size.

* UserInterface/Views/ObjectTreePropertyTreeElement.js:
(WebInspector.ObjectTreePropertyTreeElement.prototype):
Remove special handling for Array sizes now that this is handled earlier.

* UserInterface/Controllers/StorageManager.js:
(WebInspector.StorageManager.prototype.processData):
(WebInspector.StorageManager.prototype.requestIndexedDatabaseData):
Fix what looks like broken RemoteObject construction.

LayoutTests:

* inspector-protocol/runtime/getProperties-expected.txt:
* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
Update tests now that RemoteObjects and Previews may have an explicit size.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector-protocol/runtime/getProperties-expected.txt
LayoutTests/inspector/model/remote-object-expected.txt
LayoutTests/inspector/model/remote-object.html
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/InjectedScriptSource.js
Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp
Source/JavaScriptCore/inspector/JSInjectedScriptHost.h
Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp
Source/JavaScriptCore/inspector/protocol/Runtime.json
Source/JavaScriptCore/runtime/WeakMapData.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js
Source/WebInspectorUI/UserInterface/Models/ObjectPreview.js
Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js
Source/WebInspectorUI/UserInterface/Views/FormattedValue.css
Source/WebInspectorUI/UserInterface/Views/FormattedValue.js
Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.css
Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js
Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js