<!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>[180371] trunk/Source/WebInspectorUI</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/180371">180371</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-02-19 16:37:29 -0800 (Thu, 19 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Introduce FormattedValue helpers and use them in Console/ObjectTree
https://bugs.webkit.org/show_bug.cgi?id=141812

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2015-02-19
Reviewed by Timothy Hatcher.

There were a few different ways to get styled values. Try to consolidate them
all in FormattedValue. That is also a convenient place to have the styles.

* UserInterface/Main.html:
* UserInterface/Views/ConsoleMessageImpl.js:
(WebInspector.ConsoleMessageImpl.prototype._formatMessage):
(WebInspector.ConsoleMessageImpl.prototype._formatParameter):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsValue):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsString):

(WebInspector.ConsoleMessageImpl.prototype._userProvidedColumnNames):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsTable):
(WebInspector.ConsoleMessageImpl.prototype._populateStackTraceTreeElement):
(WebInspector.ConsoleMessageImpl.prototype._propertyPreviewElement): Deleted.
Fix console.table after renaming ObjectPreview.properties to ObjectPreview.propertyPreviews.
Also, use FormattedValue to create the value elements. Also, remove class
&quot;source-code&quot; as I do not see it actually being used in a meaningful way.

* UserInterface/Views/FormattedValue.css: Added.
(.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap):
(.formatted-number):
(.formatted-string, .formatted-regexp):
(.formatted-string):
(.formatted-regexp):
(.formatted-symbol):
(.formatted-null, .formatted-undefined):
* UserInterface/Views/FormattedValue.js: Added.
(WebInspector.FormattedValue.classNameForTypes):
(WebInspector.FormattedValue.classNameForObject):
(WebInspector.FormattedValue.createLinkifiedElementString):
(WebInspector.FormattedValue.createElementForTypesAndValue):
(WebInspector.FormattedValue.createElementForRemoteObject):
(WebInspector.FormattedValue.createElementForObjectPreview):
(WebInspector.FormattedValue.createElementForPropertyPreview):
Styles and formatted value element creation.

* UserInterface/Views/LogContentView.css:
(.expandable.source-code): Deleted.
Remove &quot;.source-code&quot;. I do not see it actually being used in a meaningful way.

* UserInterface/Views/ObjectPreviewView.js:
(WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews):
(WebInspector.ObjectPreviewView.prototype._appendValuePreview):
(WebInspector.ObjectPreviewView.prototype._formattedObjectElementForPreview): Deleted.
* UserInterface/Views/ObjectTreePropertyTreeElement.js:
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitlePropertyStyle):
(WebInspector.ObjectTreePropertyTreeElement.prototype._descriptionString): Deleted.
* UserInterface/Views/ObjectTreeView.css:
(.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap): Deleted.
(.formatted-number): Deleted.
(.formatted-string, .formatted-regexp): Deleted.
(.formatted-string): Deleted.
(.formatted-regexp): Deleted.
(.formatted-symbol): Deleted.
(.formatted-null, .formatted-undefined): Deleted.
* UserInterface/Views/ObjectTreeView.js:
(WebInspector.ObjectTreeView.classNameForObject): Deleted.
Extract styles and value formatting to FormattedValue helpers.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageImpljs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.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>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (180370 => 180371)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-02-20 00:20:54 UTC (rev 180370)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-02-20 00:37:29 UTC (rev 180371)
</span><span class="lines">@@ -1,5 +1,71 @@
</span><span class="cx"> 2015-02-19  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Web Inspector: Introduce FormattedValue helpers and use them in Console/ObjectTree
+        https://bugs.webkit.org/show_bug.cgi?id=141812
+
+        Reviewed by Timothy Hatcher.
+
+        There were a few different ways to get styled values. Try to consolidate them
+        all in FormattedValue. That is also a convenient place to have the styles.
+
+        * UserInterface/Main.html:
+        * UserInterface/Views/ConsoleMessageImpl.js:
+        (WebInspector.ConsoleMessageImpl.prototype._formatMessage):
+        (WebInspector.ConsoleMessageImpl.prototype._formatParameter):
+        (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsValue):
+        (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsString):
+
+        (WebInspector.ConsoleMessageImpl.prototype._userProvidedColumnNames):
+        (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsTable):
+        (WebInspector.ConsoleMessageImpl.prototype._populateStackTraceTreeElement):
+        (WebInspector.ConsoleMessageImpl.prototype._propertyPreviewElement): Deleted.
+        Fix console.table after renaming ObjectPreview.properties to ObjectPreview.propertyPreviews.
+        Also, use FormattedValue to create the value elements. Also, remove class
+        &quot;source-code&quot; as I do not see it actually being used in a meaningful way.
+
+        * UserInterface/Views/FormattedValue.css: Added.
+        (.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap):
+        (.formatted-number):
+        (.formatted-string, .formatted-regexp):
+        (.formatted-string):
+        (.formatted-regexp):
+        (.formatted-symbol):
+        (.formatted-null, .formatted-undefined):
+        * UserInterface/Views/FormattedValue.js: Added.
+        (WebInspector.FormattedValue.classNameForTypes):
+        (WebInspector.FormattedValue.classNameForObject):
+        (WebInspector.FormattedValue.createLinkifiedElementString):
+        (WebInspector.FormattedValue.createElementForTypesAndValue):
+        (WebInspector.FormattedValue.createElementForRemoteObject):
+        (WebInspector.FormattedValue.createElementForObjectPreview):
+        (WebInspector.FormattedValue.createElementForPropertyPreview):
+        Styles and formatted value element creation.
+
+        * UserInterface/Views/LogContentView.css:
+        (.expandable.source-code): Deleted.
+        Remove &quot;.source-code&quot;. I do not see it actually being used in a meaningful way.
+
+        * UserInterface/Views/ObjectPreviewView.js:
+        (WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews):
+        (WebInspector.ObjectPreviewView.prototype._appendValuePreview):
+        (WebInspector.ObjectPreviewView.prototype._formattedObjectElementForPreview): Deleted.
+        * UserInterface/Views/ObjectTreePropertyTreeElement.js:
+        (WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitlePropertyStyle):
+        (WebInspector.ObjectTreePropertyTreeElement.prototype._descriptionString): Deleted.
+        * UserInterface/Views/ObjectTreeView.css:
+        (.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap): Deleted.
+        (.formatted-number): Deleted.
+        (.formatted-string, .formatted-regexp): Deleted.
+        (.formatted-string): Deleted.
+        (.formatted-regexp): Deleted.
+        (.formatted-symbol): Deleted.
+        (.formatted-null, .formatted-undefined): Deleted.
+        * UserInterface/Views/ObjectTreeView.js:
+        (WebInspector.ObjectTreeView.classNameForObject): Deleted.
+        Extract styles and value formatting to FormattedValue helpers.
+
+2015-02-19  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
</ins><span class="cx">         Web Inspector: Disable DOM Tree Editing / Styles Editing of Shadow DOM Nodes
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=141793
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (180370 => 180371)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-02-20 00:20:54 UTC (rev 180370)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-02-20 00:37:29 UTC (rev 180371)
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/FlexibleSpaceNavigationItem.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/FolderIcon.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/FontResourceContentView.css&quot;&gt;
</span><ins>+    &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/FormattedValue.css&quot;&gt;
</ins><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/GoToLineDialog.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/GradientSlider.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/HierarchicalPathComponent.css&quot;&gt;
</span><span class="lines">@@ -360,16 +361,16 @@
</span><span class="cx">     &lt;script src=&quot;Views/DOMTreeOutline.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/DOMTreeUpdater.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/DashboardContainerView.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Views/DashboardView.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Views/DatabaseContentView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/DatabaseHostTreeElement.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/DatabaseTableContentView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/DatabaseTableTreeElement.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/DatabaseTreeElement.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Views/DebuggerDashboardView.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Views/DebuggerSidebarPanel.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Views/DefaultDashboardView.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Views/DetailsSection.js&quot;&gt;&lt;/script&gt;
</span><del>-    &lt;script src=&quot;Views/DashboardView.js&quot;&gt;&lt;/script&gt;
-    &lt;script src=&quot;Views/DebuggerDashboardView.js&quot;&gt;&lt;/script&gt;
-    &lt;script src=&quot;Views/DefaultDashboardView.js&quot;&gt;&lt;/script&gt;
</del><span class="cx">     &lt;script src=&quot;Views/DetailsSectionDataGridRow.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/DetailsSectionGroup.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/DetailsSectionPropertiesRow.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -384,6 +385,7 @@
</span><span class="cx">     &lt;script src=&quot;Views/FlexibleSpaceNavigationItem.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/FolderTreeElement.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/FontResourceContentView.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Views/FormattedValue.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Views/FrameContentView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/FrameDOMTreeContentView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/FrameTreeElement.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageImpljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js (180370 => 180371)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js        2015-02-20 00:20:54 UTC (rev 180370)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js        2015-02-20 00:37:29 UTC (rev 180371)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">     _formatMessage: function()
</span><span class="cx">     {
</span><span class="cx">         this._formattedMessage = document.createElement(&quot;span&quot;);
</span><del>-        this._formattedMessage.className = &quot;console-message-text source-code&quot;;
</del><ins>+        this._formattedMessage.className = &quot;console-message-text&quot;;
</ins><span class="cx"> 
</span><span class="cx">         var messageText;
</span><span class="cx">         if (this.source === WebInspector.ConsoleMessage.MessageSource.ConsoleAPI) {
</span><span class="lines">@@ -283,7 +283,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         var span = document.createElement(&quot;span&quot;);
</span><del>-        span.className = &quot;console-formatted-&quot; + type + &quot; source-code&quot;;
</del><ins>+        span.className = &quot;console-formatted-&quot; + type;
</ins><span class="cx"> 
</span><span class="cx">         if (this._isExpandable(output))
</span><span class="cx">             span.classList.add(&quot;expandable&quot;);
</span><span class="lines">@@ -292,9 +292,9 @@
</span><span class="cx">         return span;
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _formatParameterAsValue: function(val, elem)
</del><ins>+    _formatParameterAsValue: function(value, elem)
</ins><span class="cx">     {
</span><del>-        elem.appendChild(document.createTextNode(val));
</del><ins>+        elem.appendChild(WebInspector.FormattedValue.createElementForRemoteObject(value));
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     _formatParameterAsObject: function(obj, elem, forceExpansion)
</span><span class="lines">@@ -303,25 +303,11 @@
</span><span class="cx">         elem.appendChild(objectTree.element);
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _propertyPreviewElement: function(property)
</del><ins>+    _formatParameterAsString: function(output, elem)
</ins><span class="cx">     {
</span><del>-        // FIXME: Used by console.table. We should be able to eliminate this in favor of ObjectPreview.
-
-        var span = document.createElement(&quot;span&quot;);
-        span.classList.add(WebInspector.ObjectTreeView.classNameForObject(property));
-
-        if (property.type === &quot;string&quot;) {
-            span.textContent = &quot;\&quot;&quot; + property.value.replace(/\n/g, &quot;\u21B5&quot;).replace(/&quot;/g, &quot;\\\&quot;&quot;) + &quot;\&quot;&quot;;
-            return span;
-        }
-
-        if (property.type === &quot;function&quot;) {
-            span.textContent = &quot;function&quot;;
-            return span;
-        }
-
-        span.textContent = property.value;
-        return span;
</del><ins>+        var span = WebInspector.FormattedValue.createLinkifiedElementString(output.description);
+        elem.classList.remove(&quot;console-formatted-string&quot;);
+        elem.appendChild(span);
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     _formatParameterAsNode: function(object, elem)
</span><span class="lines">@@ -363,12 +349,12 @@
</span><span class="cx">             return [String(columnNamesArgument.value)];
</span><span class="cx"> 
</span><span class="cx">         // Ignore everything that is not an array with property previews.
</span><del>-        if (remoteObject.type !== &quot;object&quot; || remoteObject.subtype !== &quot;array&quot; || !remoteObject.preview || !remoteObject.preview.properties)
</del><ins>+        if (remoteObject.type !== &quot;object&quot; || remoteObject.subtype !== &quot;array&quot; || !remoteObject.preview || !remoteObject.preview.propertyPreviews)
</ins><span class="cx">             return null;
</span><span class="cx"> 
</span><span class="cx">         // Array. Look into the preview and get string values.
</span><span class="cx">         var extractedColumnNames = [];
</span><del>-        for (var propertyPreview of remoteObject.preview.properties) {
</del><ins>+        for (var propertyPreview of remoteObject.preview.propertyPreviews) {
</ins><span class="cx">             if (propertyPreview.type === &quot;string&quot; || propertyPreview.type === &quot;number&quot;)
</span><span class="cx">                 extractedColumnNames.push(String(propertyPreview.value));
</span><span class="cx">         }
</span><span class="lines">@@ -397,27 +383,29 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Check first for valuePreviews in the properties meaning this was an array of objects.
</span><del>-        for (var i = 0; i &lt; preview.properties.length; ++i) {
-            var rowProperty = preview.properties[i];
-            var rowPreview = rowProperty.valuePreview;
-            if (!rowPreview)
-                continue;
</del><ins>+        if (preview.propertyPreviews) {
+            for (var i = 0; i &lt; preview.propertyPreviews.length; ++i) {
+                var rowProperty = preview.propertyPreviews[i];
+                var rowPreview = rowProperty.valuePreview;
+                if (!rowPreview)
+                    continue;
</ins><span class="cx"> 
</span><del>-            var rowValue = {};
-            const maxColumnsToRender = 10;
-            for (var j = 0; j &lt; rowPreview.properties.length; ++j) {
-                var cellProperty = rowPreview.properties[j];
-                var columnRendered = columnNames.contains(cellProperty.name);
-                if (!columnRendered) {
-                    if (userProvidedColumnNames || columnNames.length === maxColumnsToRender)
-                        continue;
-                    columnRendered = true;
-                    columnNames.push(cellProperty.name);
-                }
</del><ins>+                var rowValue = {};
+                const maxColumnsToRender = 10;
+                for (var j = 0; j &lt; rowPreview.propertyPreviews.length; ++j) {
+                    var cellProperty = rowPreview.propertyPreviews[j];
+                    var columnRendered = columnNames.contains(cellProperty.name);
+                    if (!columnRendered) {
+                        if (userProvidedColumnNames || columnNames.length === maxColumnsToRender)
+                            continue;
+                        columnRendered = true;
+                        columnNames.push(cellProperty.name);
+                    }
</ins><span class="cx"> 
</span><del>-                rowValue[cellProperty.name] = this._propertyPreviewElement(cellProperty);
</del><ins>+                    rowValue[cellProperty.name] = WebInspector.FormattedValue.createElementForPropertyPreview(cellProperty);
+                }
+                rows.push([rowProperty.name, rowValue]);
</ins><span class="cx">             }
</span><del>-            rows.push([rowProperty.name, rowValue]);
</del><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // If there were valuePreviews, convert to a flat list.
</span><span class="lines">@@ -439,9 +427,9 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // If there were no value Previews, then check for an array of values.
</span><del>-        if (!flatValues.length) {
-            for (var i = 0; i &lt; preview.properties.length; ++i) {
-                var rowProperty = preview.properties[i];
</del><ins>+        if (!flatValues.length &amp;&amp; preview.propertyPreviews) {
+            for (var i = 0; i &lt; preview.propertyPreviews.length; ++i) {
+                var rowProperty = preview.propertyPreviews[i];
</ins><span class="cx">                 if (!(&quot;value&quot; in rowProperty))
</span><span class="cx">                     continue;
</span><span class="cx"> 
</span><span class="lines">@@ -451,13 +439,13 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 flatValues.push(rowProperty.name);
</span><del>-                flatValues.push(this._propertyPreviewElement(rowProperty));
</del><ins>+                flatValues.push(WebInspector.FormattedValue.createElementForPropertyPreview(rowProperty));
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // If lossless or not table data, output the object so full data can be gotten.
</span><span class="cx">         if (!preview.lossless || !flatValues.length) {
</span><del>-            element.appendChild(this._formatParameter(table, true));
</del><ins>+            element.appendChild(this._formatParameter(table));
</ins><span class="cx">             if (!flatValues.length)
</span><span class="cx">                 return element;
</span><span class="cx">         }
</span><span class="lines">@@ -470,18 +458,6 @@
</span><span class="cx">         return element;
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _formatParameterAsString: function(output, elem)
-    {
-        var span = document.createElement(&quot;span&quot;);
-        span.className = &quot;console-formatted-string source-code&quot;;
-        span.appendChild(document.createTextNode(&quot;\&quot;&quot;));
-        span.appendChild(WebInspector.linkifyStringAsFragment(output.description.replace(/&quot;/g, &quot;\\\&quot;&quot;)));
-        span.appendChild(document.createTextNode(&quot;\&quot;&quot;));
-
-        elem.classList.remove(&quot;console-formatted-string&quot;);
-        elem.appendChild(span);
-    },
-
</del><span class="cx">     _printArray: function(array, elem, properties)
</span><span class="cx">     {
</span><span class="cx">         if (!properties)
</span><span class="lines">@@ -685,7 +661,7 @@
</span><span class="cx"> 
</span><span class="cx">             var content = document.createElement(&quot;div&quot;);
</span><span class="cx">             var messageTextElement = document.createElement(&quot;span&quot;);
</span><del>-            messageTextElement.className = &quot;console-message-text source-code&quot;;
</del><ins>+            messageTextElement.className = &quot;console-message-text&quot;;
</ins><span class="cx">             var functionName = frame.functionName || WebInspector.UIString(&quot;(anonymous function)&quot;);
</span><span class="cx">             messageTextElement.appendChild(document.createTextNode(functionName));
</span><span class="cx">             content.appendChild(messageTextElement);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFormattedValuecss"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.css (0 => 180371)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.css                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.css        2015-02-20 00:37:29 UTC (rev 180371)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap {
+    position: relative;
+    display: inline-block;
+    vertical-align: top;
+    color: black;
+}
+
+.formatted-number {
+    color: rgb(28, 0, 207);
+}
+
+.formatted-string, .formatted-regexp {
+    white-space: pre;
+}
+
+.formatted-string {
+    color: rgb(196, 26, 22);
+}
+
+.formatted-regexp {
+    color: rgb(255, 88, 0);
+}
+
+.formatted-symbol {
+    color: rgb(63, 169, 156);
+}
+
+.formatted-null, .formatted-undefined {
+    color: rgb(128, 128, 128);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFormattedValuejs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js (0 => 180371)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js        2015-02-20 00:37:29 UTC (rev 180371)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.FormattedValue = {};
+
+WebInspector.FormattedValue.classNameForTypes = function(type, subtype)
+{
+    return &quot;formatted-&quot; + (subtype ? subtype : type);
+}
+
+WebInspector.FormattedValue.classNameForObject = function(object)
+{
+    return WebInspector.FormattedValue.classNameForTypes(object.type, object.subtype);
+}
+
+WebInspector.FormattedValue.createLinkifiedElementString = function(string)
+{
+    var span = document.createElement(&quot;span&quot;);
+    span.className = &quot;formatted-string&quot;;
+    span.appendChild(document.createTextNode(&quot;\&quot;&quot;));
+    span.appendChild(WebInspector.linkifyStringAsFragment(string.replace(/&quot;/g, &quot;\\\&quot;&quot;)));
+    span.appendChild(document.createTextNode(&quot;\&quot;&quot;));
+    return span;
+}
+
+WebInspector.FormattedValue.createElementForTypesAndValue = function(type, subtype, displayString, isPreview, hadException)
+{
+    var span = document.createElement(&quot;span&quot;);
+    span.classList.add(WebInspector.FormattedValue.classNameForTypes(type, subtype));
+
+    // Exception.
+    if (hadException) {
+        span.textContent = &quot;[Exception: &quot; + displayString + &quot;]&quot;;
+        return span;
+    }
+
+    // String: quoted and replace newlines as nice unicode symbols.
+    if (type === &quot;string&quot;) {
+        span.textContent = &quot;\&quot;&quot; + displayString.replace(/\n/g, &quot;\u21B5&quot;).replace(/&quot;/g, &quot;\\\&quot;&quot;) + &quot;\&quot;&quot;;
+        return span;
+    }
+
+    // Function: ellided in previews, collapsed whitespace normally.
+    if (type === &quot;function&quot;) {
+        if (isPreview)
+            span.textContent = &quot;function&quot;;
+        else
+            span.textContent = /.*/.exec(displayString)[0].replace(/ +$/g, &quot;&quot;);
+        return span;
+    }
+
+    // Everything else, the description/value string.
+    span.textContent = displayString;
+    return span;
+}
+
+WebInspector.FormattedValue.createElementForRemoteObject = function(object, hadException)
+{
+    return WebInspector.FormattedValue.createElementForTypesAndValue(object.type, object.subtype, object.description, false, hadException);
+}
+
+WebInspector.FormattedValue.createElementForObjectPreview = function(objectPreview)
+{
+    return WebInspector.FormattedValue.createElementForTypesAndValue(objectPreview.type, objectPreview.subtype, objectPreview.description, true, false);
+}
+
+WebInspector.FormattedValue.createElementForPropertyPreview = function(propertyPreview)
+{
+    return WebInspector.FormattedValue.createElementForTypesAndValue(propertyPreview.type, propertyPreview.subtype, propertyPreview.value, true, false);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css (180370 => 180371)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css        2015-02-20 00:20:54 UTC (rev 180370)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css        2015-02-20 00:37:29 UTC (rev 180371)
</span><span class="lines">@@ -47,10 +47,6 @@
</span><span class="cx">     font-size: 11px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.expandable.source-code {
-    display: block;
-}
-
</del><span class="cx"> .console-messages &gt; :first-child {
</span><span class="cx">     margin-top: auto;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectPreviewViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js (180370 => 180371)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js        2015-02-20 00:20:54 UTC (rev 180370)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js        2015-02-20 00:37:29 UTC (rev 180371)
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx">                 element.appendChild(document.createTextNode(&quot;: &quot;));
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            element.appendChild(this._formattedObjectElementForPreview(property, property.value));
</del><ins>+            element.appendChild(WebInspector.FormattedValue.createElementForPropertyPreview(property));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (preview.overflow)
</span><span class="lines">@@ -166,26 +166,7 @@
</span><span class="cx"> 
</span><span class="cx">     _appendValuePreview: function(element, preview)
</span><span class="cx">     {
</span><del>-        element.appendChild(this._formattedObjectElementForPreview(preview, preview.description));
</del><ins>+        element.appendChild(WebInspector.FormattedValue.createElementForObjectPreview(preview));
</ins><span class="cx">         return true;
</span><del>-    },
-
-    _formattedObjectElementForPreview: function(propertyPreviewOrObjectPreview, value)
-    {
-        var span = document.createElement(&quot;span&quot;);
-        span.classList.add(WebInspector.ObjectTreeView.classNameForObject(propertyPreviewOrObjectPreview));
-
-        if (propertyPreviewOrObjectPreview.type === &quot;string&quot;) {
-            span.textContent = &quot;\&quot;&quot; + value.replace(/\n/g, &quot;\u21B5&quot;).replace(/&quot;/g, &quot;\\\&quot;&quot;) + &quot;\&quot;&quot;;
-            return span;
-        }
-
-        if (propertyPreviewOrObjectPreview.type === &quot;function&quot;) {
-            span.textContent = &quot;function&quot;;
-            return span;
-        }
-
-        span.textContent = value;
-        return span;
</del><span class="cx">     }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreePropertyTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js (180370 => 180371)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js        2015-02-20 00:20:54 UTC (rev 180370)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js        2015-02-20 00:37:29 UTC (rev 180371)
</span><span class="lines">@@ -97,21 +97,20 @@
</span><span class="cx">         separatorElement.textContent = &quot;: &quot;;
</span><span class="cx"> 
</span><span class="cx">         // Value / Getter.
</span><del>-        var valueOrGetterElement = document.createElement(&quot;span&quot;);
-        valueOrGetterElement.className = &quot;value&quot;;
-
</del><ins>+        var valueOrGetterElement;
</ins><span class="cx">         if (this._property.hasValue()) {
</span><del>-            valueOrGetterElement.textContent = this._descriptionString();
-            valueOrGetterElement.classList.add(WebInspector.ObjectTreeView.classNameForObject(this._property.value));
</del><ins>+            valueOrGetterElement = WebInspector.FormattedValue.createElementForRemoteObject(this._property.value, this._property.wasThrown);
</ins><span class="cx">             // FIXME: Context Menu for Value. (See ObjectPropertiesSection).
</span><span class="cx">             // FIXME: Option+Click for Value.
</span><span class="cx">         } else {
</span><span class="cx">             console.assert(this._property.hasGetter());
</span><ins>+            valueOrGetterElement = document.createElement(&quot;span&quot;);
</ins><span class="cx">             valueOrGetterElement.textContent = &quot;(...)&quot;;
</span><span class="cx">             // FIXME: Click to Populate Value.
</span><span class="cx">             // FIXME: Context Menu to Populate Value.
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        valueOrGetterElement.classList.add(&quot;value&quot;);
</ins><span class="cx">         if (this._property.wasThrown)
</span><span class="cx">             valueOrGetterElement.classList.add(&quot;error&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -158,26 +157,6 @@
</span><span class="cx">         }
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _descriptionString: function()
-    {
-        var value = this._property.value;
-        var description = value.description;
-
-        // Exception.
-        if (this._property.wasThrown)
-            return &quot;[Exception: &quot; + description + &quot;]&quot;;
-
-        // String: replace newlines as nice unicode symbols.
-        if (value.type === &quot;string&quot;)
-            return &quot;\&quot;&quot; + description.replace(/\n/g, &quot;\u21B5&quot;).replace(/&quot;/g, &quot;\\\&quot;&quot;) + &quot;\&quot;&quot;;
-
-        // Function: Collapse whitespace in function display strings.
-        if (value.type === &quot;function&quot;)
-            return /.*/.exec(description)[0].replace(/ +$/g, &quot;&quot;);
-
-        return description;
-    },
-
</del><span class="cx">     _functionParameterString: function()
</span><span class="cx">     {
</span><span class="cx">         console.assert(this._property.value.type === &quot;function&quot;);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css (180370 => 180371)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css        2015-02-20 00:20:54 UTC (rev 180370)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css        2015-02-20 00:37:29 UTC (rev 180371)
</span><span class="lines">@@ -142,40 +142,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-/* Object Tree Type Colors */
-
-.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap {
-    position: relative;
-    display: inline-block;
-    vertical-align: top;
-    color: black;
-}
-
-.formatted-number {
-    color: rgb(28, 0, 207);
-}
-
-.formatted-string, .formatted-regexp {
-    white-space: pre;
-}
-
-.formatted-string {
-    color: rgb(196, 26, 22);
-}
-
-.formatted-regexp {
-    color: rgb(255, 88, 0);
-}
-
-.formatted-symbol {
-    color: rgb(63, 169, 156);
-}
-
-.formatted-null, .formatted-undefined {
-    color: rgb(128, 128, 128);
-}
-
-
</del><span class="cx"> /* Console Overrides */
</span><span class="cx"> 
</span><span class="cx"> .console-group-messages .object-tree:not(.lossless-preview) {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js (180370 => 180371)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js        2015-02-20 00:20:54 UTC (rev 180370)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js        2015-02-20 00:37:29 UTC (rev 180371)
</span><span class="lines">@@ -71,11 +71,6 @@
</span><span class="cx">     API: Symbol(&quot;object-tree-api&quot;),
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.ObjectTreeView.classNameForObject = function(object)
-{
-    return &quot;formatted-&quot; + (object.subtype ? object.subtype : object.type);
-}
-
</del><span class="cx"> WebInspector.ObjectTreeView.ComparePropertyDescriptors = function(propertyA, propertyB)
</span><span class="cx"> {
</span><span class="cx">     var a = propertyA.name;
</span></span></pre>
</div>
</div>

</body>
</html>