Web Inspector: Array/Collection Sizes should be visible and distinct
https://bugs.webkit.org/show_bug.cgi?id=142254
Patch by Joseph Pecoraro <Joseph Pecoraro> on 2015-03-04
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
(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.