<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181061] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181061">181061</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-04 18:27:23 -0800 (Wed, 04 Mar 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>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.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjectexpectedtxt">trunk/LayoutTests/inspector/model/remote-object-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjecthtml">trunk/LayoutTests/inspector/model/remote-object.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolruntimegetPropertiesexpectedtxt">trunk/LayoutTests/inspector-protocol/runtime/getProperties-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs">trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHosth">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostPrototypecpp">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolRuntimejson">trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeWeakMapDatah">trunk/Source/JavaScriptCore/runtime/WeakMapData.h</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersStorageManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsObjectPreviewjs">trunk/Source/WebInspectorUI/UserInterface/Models/ObjectPreview.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFormattedValuecss">trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFormattedValuejs">trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectPreviewViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectPreviewViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreePropertyTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/LayoutTests/ChangeLog        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-03-04 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Array/Collection Sizes should be visible and distinct
+ https://bugs.webkit.org/show_bug.cgi?id=142254
+
+ Reviewed by Timothy Hatcher.
+
+ * 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.
+
</ins><span class="cx"> 2015-03-04 Timothy Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> <attachment> should show the file size as detail text below the icon
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjectexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object-expected.txt (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -517,13 +517,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Array[0]",
</del><ins>+ "_description": "Array",
+ "_size": 0,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[0]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 0,
</ins><span class="cx"> "_properties": [],
</span><span class="cx"> "_entries": null
</span><span class="cx"> }
</span><span class="lines">@@ -535,13 +537,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Array[2]",
</del><ins>+ "_description": "Array",
+ "_size": 2,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[2]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 2,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -564,31 +568,33 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Array[3]",
</del><ins>+ "_description": "Array",
+ "_size": 3,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[3]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 3,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_value": "Array[1]"
</del><ins>+ "_value": "Array"
</ins><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> "_name": "1",
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_value": "Array[1]"
</del><ins>+ "_value": "Array"
</ins><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> "_name": "2",
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_value": "Array[1]"
</del><ins>+ "_value": "Array"
</ins><span class="cx"> }
</span><span class="cx"> ],
</span><span class="cx"> "_entries": null
</span><span class="lines">@@ -601,13 +607,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Array[5]",
</del><ins>+ "_description": "Array",
+ "_size": 5,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[5]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 5,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -646,13 +654,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Array[3]",
</del><ins>+ "_description": "Array",
+ "_size": 3,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[3]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 3,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -680,19 +690,21 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Array[1]",
</del><ins>+ "_description": "Array",
+ "_size": 1,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[1]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 1,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_value": "Array[3]"
</del><ins>+ "_value": "Array"
</ins><span class="cx"> }
</span><span class="cx"> ],
</span><span class="cx"> "_entries": null
</span><span class="lines">@@ -705,13 +717,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Array[100]",
</del><ins>+ "_description": "Array",
+ "_size": 100,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[100]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 100,
</ins><span class="cx"> "_properties": [],
</span><span class="cx"> "_entries": null
</span><span class="cx"> }
</span><span class="lines">@@ -723,13 +737,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Array[100]",
</del><ins>+ "_description": "Array",
+ "_size": 100,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[100]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 100,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -1242,13 +1258,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Array[100]",
</del><ins>+ "_description": "Array",
+ "_size": 100,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[100]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 100,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "10",
</span><span class="lines">@@ -1266,13 +1284,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Arguments[3]",
</del><ins>+ "_description": "Arguments",
+ "_size": 3,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Arguments[3]",
</del><ins>+ "_description": "Arguments",
</ins><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 3,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -1301,13 +1321,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Int32Array[4]",
</del><ins>+ "_description": "Int32Array",
+ "_size": 4,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Int32Array[4]",
</del><ins>+ "_description": "Int32Array",
</ins><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 4,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -1355,13 +1377,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "Int32Array[4]",
</del><ins>+ "_description": "Int32Array",
+ "_size": 4,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Int32Array[4]",
</del><ins>+ "_description": "Int32Array",
</ins><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 4,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -1894,13 +1918,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "HTMLCollection[3]",
</del><ins>+ "_description": "HTMLCollection",
+ "_size": 3,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "HTMLCollection[3]",
</del><ins>+ "_description": "HTMLCollection",
</ins><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 3,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -1941,13 +1967,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "NodeList[3]",
</del><ins>+ "_description": "NodeList",
+ "_size": 3,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "NodeList[3]",
</del><ins>+ "_description": "NodeList",
</ins><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 3,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -1988,13 +2016,15 @@
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><del>- "_description": "NodeList[3]",
</del><ins>+ "_description": "NodeList",
+ "_size": 3,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "NodeList[3]",
</del><ins>+ "_description": "NodeList",
</ins><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 3,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -2152,50 +2182,20 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> -----------------------------------------------------
</span><del>-EXPRESSION: Object.seal({})
-{
- "_type": "object",
- "_objectId": "<filtered>",
- "_description": "Object",
- "_preview": {
- "_type": "object",
- "_description": "Object",
- "_lossless": true,
- "_overflow": false,
- "_properties": [],
- "_entries": null
- }
-}
-
------------------------------------------------------
-EXPRESSION: Object.freeze({})
-{
- "_type": "object",
- "_objectId": "<filtered>",
- "_description": "Object",
- "_preview": {
- "_type": "object",
- "_description": "Object",
- "_lossless": true,
- "_overflow": false,
- "_properties": [],
- "_entries": null
- }
-}
-
------------------------------------------------------
</del><span class="cx"> EXPRESSION: new Map
</span><span class="cx"> {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "map",
</span><span class="cx"> "_objectId": "<filtered>",
</span><span class="cx"> "_description": "Map",
</span><ins>+ "_size": 0,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "map",
</span><span class="cx"> "_description": "Map",
</span><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 0,
</ins><span class="cx"> "_properties": [],
</span><span class="cx"> "_entries": []
</span><span class="cx"> }
</span><span class="lines">@@ -2208,12 +2208,14 @@
</span><span class="cx"> "_subtype": "map",
</span><span class="cx"> "_objectId": "<filtered>",
</span><span class="cx"> "_description": "Map",
</span><ins>+ "_size": 2,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "map",
</span><span class="cx"> "_description": "Map",
</span><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 2,
</ins><span class="cx"> "_properties": [],
</span><span class="cx"> "_entries": [
</span><span class="cx"> {
</span><span class="lines">@@ -2263,12 +2265,14 @@
</span><span class="cx"> "_subtype": "map",
</span><span class="cx"> "_objectId": "<filtered>",
</span><span class="cx"> "_description": "Map",
</span><ins>+ "_size": 2,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "map",
</span><span class="cx"> "_description": "Map",
</span><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 2,
</ins><span class="cx"> "_properties": [],
</span><span class="cx"> "_entries": [
</span><span class="cx"> {
</span><span class="lines">@@ -2340,9 +2344,10 @@
</span><span class="cx"> "_value": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[2]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 2,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -2369,12 +2374,14 @@
</span><span class="cx"> "_subtype": "map",
</span><span class="cx"> "_objectId": "<filtered>",
</span><span class="cx"> "_description": "Map",
</span><ins>+ "_size": 101,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "map",
</span><span class="cx"> "_description": "Map",
</span><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": true,
</span><ins>+ "_size": 101,
</ins><span class="cx"> "_properties": [],
</span><span class="cx"> "_entries": [
</span><span class="cx"> {
</span><span class="lines">@@ -2478,12 +2485,14 @@
</span><span class="cx"> "_subtype": "weakmap",
</span><span class="cx"> "_objectId": "<filtered>",
</span><span class="cx"> "_description": "WeakMap",
</span><ins>+ "_size": 1,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "weakmap",
</span><span class="cx"> "_description": "WeakMap",
</span><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 1,
</ins><span class="cx"> "_properties": [],
</span><span class="cx"> "_entries": [
</span><span class="cx"> {
</span><span class="lines">@@ -2504,9 +2513,10 @@
</span><span class="cx"> "_value": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[2]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 2,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -2533,12 +2543,14 @@
</span><span class="cx"> "_subtype": "set",
</span><span class="cx"> "_objectId": "<filtered>",
</span><span class="cx"> "_description": "Set",
</span><ins>+ "_size": 0,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "set",
</span><span class="cx"> "_description": "Set",
</span><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 0,
</ins><span class="cx"> "_properties": [],
</span><span class="cx"> "_entries": []
</span><span class="cx"> }
</span><span class="lines">@@ -2551,12 +2563,14 @@
</span><span class="cx"> "_subtype": "set",
</span><span class="cx"> "_objectId": "<filtered>",
</span><span class="cx"> "_description": "Set",
</span><ins>+ "_size": 3,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "set",
</span><span class="cx"> "_description": "Set",
</span><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 3,
</ins><span class="cx"> "_properties": [],
</span><span class="cx"> "_entries": [
</span><span class="cx"> {
</span><span class="lines">@@ -2600,12 +2614,14 @@
</span><span class="cx"> "_subtype": "set",
</span><span class="cx"> "_objectId": "<filtered>",
</span><span class="cx"> "_description": "Set",
</span><ins>+ "_size": 3,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "set",
</span><span class="cx"> "_description": "Set",
</span><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 3,
</ins><span class="cx"> "_properties": [],
</span><span class="cx"> "_entries": [
</span><span class="cx"> {
</span><span class="lines">@@ -2665,9 +2681,10 @@
</span><span class="cx"> "_value": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><del>- "_description": "Array[2]",
</del><ins>+ "_description": "Array",
</ins><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><ins>+ "_size": 2,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="lines">@@ -2694,12 +2711,14 @@
</span><span class="cx"> "_subtype": "set",
</span><span class="cx"> "_objectId": "<filtered>",
</span><span class="cx"> "_description": "Set",
</span><ins>+ "_size": 101,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "set",
</span><span class="cx"> "_description": "Set",
</span><span class="cx"> "_lossless": false,
</span><span class="cx"> "_overflow": true,
</span><ins>+ "_size": 101,
</ins><span class="cx"> "_properties": [],
</span><span class="cx"> "_entries": [
</span><span class="cx"> {
</span><span class="lines">@@ -2895,3 +2914,35 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+-----------------------------------------------------
+EXPRESSION: Object.seal({})
+{
+ "_type": "object",
+ "_objectId": "<filtered>",
+ "_description": "Object",
+ "_preview": {
+ "_type": "object",
+ "_description": "Object",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": [],
+ "_entries": null
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: Object.freeze({})
+{
+ "_type": "object",
+ "_objectId": "<filtered>",
+ "_description": "Object",
+ "_preview": {
+ "_type": "object",
+ "_description": "Object",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": [],
+ "_entries": null
+ }
+}
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjecthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object.html (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object.html        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/LayoutTests/inspector/model/remote-object.html        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -116,12 +116,6 @@
</span><span class="cx"> {expression: "error = null; try { eval('if()'); } catch (e) { error = e; }; error"},
</span><span class="cx"> {expression: "error = null; try { document.createTextNode('').splitText(100); } catch (e) { error = e; }; error"},
</span><span class="cx">
</span><del>- // Improveable:
-
- // Sealed / Frozen objects.
- {expression: "Object.seal({})"},
- {expression: "Object.freeze({})"},
-
</del><span class="cx"> // Map / WeakMap
</span><span class="cx"> {expression: "new Map"},
</span><span class="cx"> {expression: "map = new Map; map.set(1, 2); map.set('key', 'value'); map"},
</span><span class="lines">@@ -142,6 +136,11 @@
</span><span class="cx"> {expression: "Promise.resolve()"},
</span><span class="cx"> {expression: "Promise.resolve({result:1})"},
</span><span class="cx">
</span><ins>+ // Improveable:
+
+ // Sealed / Frozen objects.
+ {expression: "Object.seal({})"},
+ {expression: "Object.freeze({})"},
</ins><span class="cx"> ];
</span><span class="cx">
</span><span class="cx"> if (!window.WebInspector) {
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolruntimegetPropertiesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/runtime/getProperties-expected.txt (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/runtime/getProperties-expected.txt        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/LayoutTests/inspector-protocol/runtime/getProperties-expected.txt        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> __proto__ object Number
</span><span class="cx"> foo string cat
</span><span class="cx"> Properties of array
</span><del>- __proto__ object Array[0]
</del><ins>+ __proto__ object Array
</ins><span class="cx"> 0 string red
</span><span class="cx"> 1 string green
</span><span class="cx"> 2 string blue
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> length number 0
</span><span class="cx"> name string Number
</span><span class="cx"> Internal properties
</span><del>- boundArgs object Array[1]
</del><ins>+ boundArgs object Array
</ins><span class="cx"> boundThis object Object
</span><span class="cx"> targetFunction function function Number() {
</span><span class="cx"> [native code]
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-03-04 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Array/Collection Sizes should be visible and distinct
+ https://bugs.webkit.org/show_bug.cgi?id=142254
+
+ Reviewed by Timothy Hatcher.
+
+ * 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.
+
</ins><span class="cx"> 2015-03-04 Andreas Kling <akling@apple.com>
</span><span class="cx">
</span><span class="cx"> GC should compute stack bounds and dump registers at the earliest opportunity.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -768,11 +768,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> var className = InjectedScriptHost.internalConstructorName(obj);
</span><del>- if (subtype === "array") {
- if (typeof obj.length === "number")
- className += "[" + obj.length + "]";
</del><ins>+ if (subtype === "array")
</ins><span class="cx"> return className;
</span><del>- }
</del><span class="cx">
</span><span class="cx"> // NodeList in JSC is a function, check for array prior to this.
</span><span class="cx"> if (typeof obj === "function")
</span><span class="lines">@@ -904,6 +901,13 @@
</span><span class="cx"> this.className = InjectedScriptHost.internalConstructorName(object);
</span><span class="cx"> this.description = injectedScript._describe(object);
</span><span class="cx">
</span><ins>+ if (subtype === "array")
+ this.size = typeof object.length === "number" ? object.length : 0;
+ else if (subtype === "set" || subtype === "map")
+ this.size = object.size;
+ else if (subtype === "weakmap")
+ this.size = InjectedScriptHost.weakMapSize(object);
+
</ins><span class="cx"> if (generatePreview && this.type === "object")
</span><span class="cx"> this.preview = this._generatePreview(object, undefined, columnNames);
</span><span class="cx"> }
</span><span class="lines">@@ -925,6 +929,9 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if ("size" in this)
+ preview.size = this.size;
+
</ins><span class="cx"> return preview;
</span><span class="cx"> },
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -253,6 +253,19 @@
</span><span class="cx"> return jsUndefined();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+JSValue JSInjectedScriptHost::weakMapSize(ExecState* exec)
+{
+ if (exec->argumentCount() < 1)
+ return jsUndefined();
+
+ JSValue value = exec->uncheckedArgument(0);
+ JSWeakMap* weakMap = jsDynamicCast<JSWeakMap*>(value);
+ if (!weakMap)
+ return jsUndefined();
+
+ return jsNumber(weakMap->weakMapData()->size());
+}
+
</ins><span class="cx"> JSValue JSInjectedScriptHost::weakMapEntries(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx"> if (exec->argumentCount() < 1)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx"> JSC::JSValue subtype(JSC::ExecState*);
</span><span class="cx"> JSC::JSValue functionDetails(JSC::ExecState*);
</span><span class="cx"> JSC::JSValue getInternalProperties(JSC::ExecState*);
</span><ins>+ JSC::JSValue weakMapSize(JSC::ExecState*);
</ins><span class="cx"> JSC::JSValue weakMapEntries(JSC::ExecState*);
</span><span class="cx">
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionGetInternalProperties(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionInternalConstructorName(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection(ExecState*);
</span><ins>+static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapSize(ExecState*);
</ins><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapEntries(ExecState*);
</span><span class="cx">
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState*);
</span><span class="lines">@@ -60,6 +61,7 @@
</span><span class="cx"> JSC_NATIVE_FUNCTION("getInternalProperties", jsInjectedScriptHostPrototypeFunctionGetInternalProperties, DontEnum, 1);
</span><span class="cx"> JSC_NATIVE_FUNCTION("internalConstructorName", jsInjectedScriptHostPrototypeFunctionInternalConstructorName, DontEnum, 1);
</span><span class="cx"> JSC_NATIVE_FUNCTION("isHTMLAllCollection", jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection, DontEnum, 1);
</span><ins>+ JSC_NATIVE_FUNCTION("weakMapSize", jsInjectedScriptHostPrototypeFunctionWeakMapSize, DontEnum, 1);
</ins><span class="cx"> JSC_NATIVE_FUNCTION("weakMapEntries", jsInjectedScriptHostPrototypeFunctionWeakMapEntries, DontEnum, 1);
</span><span class="cx">
</span><span class="cx"> Identifier evaluateIdentifier(&vm, "evaluate");
</span><span class="lines">@@ -102,6 +104,17 @@
</span><span class="cx"> return JSValue::encode(castedThis->isHTMLAllCollection(exec));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapSize(ExecState* exec)
+{
+ JSValue thisValue = exec->thisValue();
+ JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue);
+ if (!castedThis)
+ return throwVMTypeError(exec);
+
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info());
+ return JSValue::encode(castedThis->weakMapSize(exec));
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapEntries(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolRuntimejson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -18,6 +18,7 @@
</span><span class="cx"> { "name": "value", "type": "any", "optional": true, "description": "Remote object value (in case of primitive values or JSON values if it was requested)." },
</span><span class="cx"> { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
</span><span class="cx"> { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." },
</span><ins>+ { "name": "size", "type": "integer", "optional": true, "description": "Size of the array/collection. Specified for array/map/set/weakmap object type values only." },
</ins><span class="cx"> { "name": "preview", "$ref": "ObjectPreview", "optional": true, "description": "Preview containing abbreviated property values. Specified for <code>object</code> type values only." }
</span><span class="cx"> ]
</span><span class="cx"> },
</span><span class="lines">@@ -32,7 +33,8 @@
</span><span class="cx"> { "name": "lossless", "type": "boolean", "description": "Determines whether preview is lossless (contains all information of the original object)." },
</span><span class="cx"> { "name": "overflow", "type": "boolean", "optional": true, "description": "True iff some of the properties of the original did not fit." },
</span><span class="cx"> { "name": "properties", "type": "array", "items": { "$ref": "PropertyPreview" }, "optional": true, "description": "List of the properties." },
</span><del>- { "name": "entries", "type": "array", "items": { "$ref": "EntryPreview" }, "optional": true, "description": "List of the entries. Specified for <code>map</code> and <code>set</code> subtype values only." }
</del><ins>+ { "name": "entries", "type": "array", "items": { "$ref": "EntryPreview" }, "optional": true, "description": "List of the entries. Specified for <code>map</code> and <code>set</code> subtype values only." },
+ { "name": "size", "type": "integer", "optional": true, "description": "Size of the array/collection. Specified for array/map/set/weakmap object type values only." }
</ins><span class="cx"> ]
</span><span class="cx"> },
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeWeakMapDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/WeakMapData.h (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/WeakMapData.h        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/JavaScriptCore/runtime/WeakMapData.h        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -67,6 +67,8 @@
</span><span class="cx"> MapType::const_iterator begin() const { return m_map.begin(); }
</span><span class="cx"> MapType::const_iterator end() const { return m_map.end(); }
</span><span class="cx">
</span><ins>+ int size() const { return m_map.size(); }
+
</ins><span class="cx"> private:
</span><span class="cx"> WeakMapData(VM&);
</span><span class="cx"> static void destroy(JSCell*);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2015-03-04 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Array/Collection Sizes should be visible and distinct
+ https://bugs.webkit.org/show_bug.cgi?id=142254
+
+ Reviewed by Timothy Hatcher.
+
+ * 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.
+
</ins><span class="cx"> 2015-03-04 Brian J. Burg <burg@cs.washington.edu>
</span><span class="cx">
</span><span class="cx"> Web Inspector: TimelineViews should be displayed in a ContentViewContainer
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersStorageManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -150,9 +150,9 @@
</span><span class="cx">
</span><span class="cx"> for (var entryPayload of entryPayloads) {
</span><span class="cx"> var entry = {};
</span><del>- entry.primaryKey = new WebInspector.RemoteObject.fromPayload(entryPayload.primaryKey);
- entry.key = new WebInspector.RemoteObject.fromPayload(entryPayload.key);
- entry.value = new WebInspector.RemoteObject.fromPayload(entryPayload.value);
</del><ins>+ entry.primaryKey = WebInspector.RemoteObject.fromPayload(entryPayload.primaryKey);
+ entry.key = WebInspector.RemoteObject.fromPayload(entryPayload.key);
+ entry.value = WebInspector.RemoteObject.fromPayload(entryPayload.value);
</ins><span class="cx"> entries.push(entry);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsObjectPreviewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ObjectPreview.js (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ObjectPreview.js        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ObjectPreview.js        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.ObjectPreview = function(type, subtype, description, lossless, overflow, properties, entries)
</del><ins>+WebInspector.ObjectPreview = function(type, subtype, description, lossless, overflow, properties, entries, size)
</ins><span class="cx"> {
</span><span class="cx"> WebInspector.Object.call(this);
</span><span class="cx">
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> this._description = description || "";
</span><span class="cx"> this._lossless = lossless;
</span><span class="cx"> this._overflow = overflow || false;
</span><ins>+ this._size = size;
</ins><span class="cx">
</span><span class="cx"> this._properties = properties || null;
</span><span class="cx"> this._entries = entries || null;
</span><span class="lines">@@ -50,7 +51,17 @@
</span><span class="cx"> if (payload.entries)
</span><span class="cx"> payload.entries = payload.entries.map(function(entry) { return WebInspector.CollectionEntryPreview.fromPayload(entry); });
</span><span class="cx">
</span><del>- return new WebInspector.ObjectPreview(payload.type, payload.subtype, payload.description, payload.lossless, payload.overflow, payload.properties, payload.entries);
</del><ins>+ if (payload.subtype === "array") {
+ // COMPATIBILITY (iOS 8): Runtime.ObjectPreview did not have size property,
+ // instead it was tacked onto the end of the description, like "Array[#]".
+ var match = payload.description.match(/\[(\d+)\]$/);
+ if (match) {
+ payload.size = parseInt(match[1]);
+ payload.description = payload.description.replace(/\[\d+\]$/, "");
+ }
+ }
+
+ return new WebInspector.ObjectPreview(payload.type, payload.subtype, payload.description, payload.lossless, payload.overflow, payload.properties, payload.entries, payload.size);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.ObjectPreview.prototype = {
</span><span class="lines">@@ -92,5 +103,15 @@
</span><span class="cx"> get collectionEntryPreviews()
</span><span class="cx"> {
</span><span class="cx"> return this._entries;
</span><ins>+ },
+
+ get size()
+ {
+ return this._size;
+ },
+
+ hasSize: function()
+ {
+ return this._size !== undefined && (this._subtype === "array" || this._subtype === "set" || this._subtype === "map" || this._subtype === "weakmap");
</ins><span class="cx"> }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.RemoteObject = function(objectId, type, subtype, value, description, preview)
</del><ins>+WebInspector.RemoteObject = function(objectId, type, subtype, value, description, size, preview)
</ins><span class="cx"> {
</span><span class="cx"> // No superclass.
</span><span class="cx">
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> this._objectId = objectId;
</span><span class="cx"> this._description = description;
</span><span class="cx"> this._hasChildren = type !== "symbol";
</span><ins>+ this._size = size;
</ins><span class="cx"> this._preview = preview;
</span><span class="cx"> } else {
</span><span class="cx"> // Primitive or null.
</span><span class="lines">@@ -61,13 +62,23 @@
</span><span class="cx">
</span><span class="cx"> WebInspector.RemoteObject.fromPrimitiveValue = function(value)
</span><span class="cx"> {
</span><del>- return new WebInspector.RemoteObject(undefined, typeof value, undefined, value);
</del><ins>+ return new WebInspector.RemoteObject(undefined, typeof value, undefined, undefined, value);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.RemoteObject.fromPayload = function(payload)
</span><span class="cx"> {
</span><span class="cx"> console.assert(typeof payload === "object", "Remote object payload should only be an object");
</span><span class="cx">
</span><ins>+ if (payload.subtype === "array") {
+ // COMPATIBILITY (iOS 8): Runtime.RemoteObject did not have size property,
+ // instead it was tacked onto the end of the description, like "Array[#]".
+ var match = payload.description.match(/\[(\d+)\]$/);
+ if (match) {
+ payload.size = parseInt(match[1]);
+ payload.description = payload.description.replace(/\[\d+\]$/, "");
+ }
+ }
+
</ins><span class="cx"> if (payload.preview) {
</span><span class="cx"> // COMPATIBILITY (iOS 8): iOS 7 and 8 did not have type/subtype/description on
</span><span class="cx"> // Runtime.ObjectPreview. Copy them over from the RemoteObject.
</span><span class="lines">@@ -75,11 +86,12 @@
</span><span class="cx"> payload.preview.type = payload.type;
</span><span class="cx"> payload.preview.subtype = payload.subtype;
</span><span class="cx"> payload.preview.description = payload.description;
</span><ins>+ payload.preview.size = payload.size;
</ins><span class="cx"> }
</span><span class="cx"> payload.preview = WebInspector.ObjectPreview.fromPayload(payload.preview);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return new WebInspector.RemoteObject(payload.objectId, payload.type, payload.subtype, payload.value, payload.description, payload.preview);
</del><ins>+ return new WebInspector.RemoteObject(payload.objectId, payload.type, payload.subtype, payload.value, payload.description, payload.size, payload.preview);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.RemoteObject.createCallArgument = function(valueOrObject)
</span><span class="lines">@@ -151,11 +163,21 @@
</span><span class="cx"> return this._value;
</span><span class="cx"> },
</span><span class="cx">
</span><ins>+ get size()
+ {
+ return this._size || 0;
+ },
+
</ins><span class="cx"> get preview()
</span><span class="cx"> {
</span><span class="cx"> return this._preview;
</span><span class="cx"> },
</span><span class="cx">
</span><ins>+ hasSize: function()
+ {
+ return this.isArray() || this.isCollectionType();
+ },
+
</ins><span class="cx"> hasValue: function()
</span><span class="cx"> {
</span><span class="cx"> return "_value" in this;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFormattedValuecss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.css (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.css        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.css        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -30,6 +30,11 @@
</span><span class="cx"> color: black;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+:matches(.formatted-array, .formatted-map, .formatted-set, .formatted-weakmap) > .size {
+ font-style: normal;
+ color: hsl(0, 0%, 67%);
+}
+
</ins><span class="cx"> .formatted-node > ol {
</span><span class="cx"> display: block !important;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFormattedValuejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> return span;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-WebInspector.FormattedValue.createElementForTypesAndValue = function(type, subtype, displayString, isPreview, hadException)
</del><ins>+WebInspector.FormattedValue.createElementForTypesAndValue = function(type, subtype, displayString, size, isPreview, hadException)
</ins><span class="cx"> {
</span><span class="cx"> var span = document.createElement("span");
</span><span class="cx"> span.classList.add(WebInspector.FormattedValue.classNameForTypes(type, subtype));
</span><span class="lines">@@ -94,22 +94,30 @@
</span><span class="cx">
</span><span class="cx"> // Everything else, the description/value string.
</span><span class="cx"> span.textContent = displayString;
</span><ins>+
+ // If there is a size, include it.
+ if (size !== undefined && (subtype === "array" || subtype === "set" || subtype === "map" || subtype === "weakmap")) {
+ var sizeElement = span.appendChild(document.createElement("span"));
+ sizeElement.className = "size";
+ sizeElement.textContent = " (" + size + ")";
+ }
+
</ins><span class="cx"> return span;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.FormattedValue.createElementForRemoteObject = function(object, hadException)
</span><span class="cx"> {
</span><del>- return WebInspector.FormattedValue.createElementForTypesAndValue(object.type, object.subtype, object.description, false, hadException);
</del><ins>+ return WebInspector.FormattedValue.createElementForTypesAndValue(object.type, object.subtype, object.description, object.size, false, hadException);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.FormattedValue.createElementForObjectPreview = function(objectPreview)
</span><span class="cx"> {
</span><del>- return WebInspector.FormattedValue.createElementForTypesAndValue(objectPreview.type, objectPreview.subtype, objectPreview.description, true, false);
</del><ins>+ return WebInspector.FormattedValue.createElementForTypesAndValue(objectPreview.type, objectPreview.subtype, objectPreview.description, objectPreview.size, true, false);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.FormattedValue.createElementForPropertyPreview = function(propertyPreview)
</span><span class="cx"> {
</span><del>- return WebInspector.FormattedValue.createElementForTypesAndValue(propertyPreview.type, propertyPreview.subtype, propertyPreview.value, true, false);
</del><ins>+ return WebInspector.FormattedValue.createElementForTypesAndValue(propertyPreview.type, propertyPreview.subtype, propertyPreview.value, undefined, true, false);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.FormattedValue.createObjectTreeOrFormattedValueForRemoteObject = function(object, propertyPath)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectPreviewViewcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.css (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.css        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.css        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -38,3 +38,8 @@
</span><span class="cx"> .object-preview .name {
</span><span class="cx"> color: rgb(136, 19, 145);
</span><span class="cx"> }
</span><ins>+
+.object-preview > .size {
+ font-style: normal;
+ color: hsl(0, 0%, 67%);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectPreviewViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -44,6 +44,12 @@
</span><span class="cx"> this._titleElement.hidden = true;
</span><span class="cx"> this._initTitleElement();
</span><span class="cx">
</span><ins>+ if (this._preview.hasSize()) {
+ var sizeElement = this._element.appendChild(document.createElement("span"));
+ sizeElement.className = "size";
+ sizeElement.textContent = " (" + this._preview.size + ")";
+ }
+
</ins><span class="cx"> if (this._lossless)
</span><span class="cx"> this._element.classList.add("lossless");
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreePropertyTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js (181060 => 181061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js        2015-03-05 02:19:14 UTC (rev 181060)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js        2015-03-05 02:27:23 UTC (rev 181061)
</span><span class="lines">@@ -375,7 +375,7 @@
</span><span class="cx"> if (value.subtype === "regexp")
</span><span class="cx"> return "RegExp";
</span><span class="cx">
</span><del>- return value.description.replace(/\[\d+\]$/, "").replace(/Prototype$/, "");
</del><ins>+ return value.description.replace(/Prototype$/, "");
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> _propertyPathString: function(propertyPath)
</span></span></pre>
</div>
</div>
</body>
</html>