<!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>[184635] 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/184635">184635</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-05-20 08:46:04 -0700 (Wed, 20 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Slightly better node previews in arrays
https://bugs.webkit.org/show_bug.cgi?id=145188

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

Source/JavaScriptCore:

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype._nodeDescription):
(InjectedScript.prototype._nodePreview):
Different stringified representations for a basic object description or in a preview.

(InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
Use the node preview string representation inside previews.

LayoutTests:

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:</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="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs">trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (184634 => 184635)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-05-20 10:25:39 UTC (rev 184634)
+++ trunk/LayoutTests/ChangeLog        2015-05-20 15:46:04 UTC (rev 184635)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-05-20  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Slightly better node previews in arrays
+        https://bugs.webkit.org/show_bug.cgi?id=145188
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/model/remote-object-expected.txt:
+        * inspector/model/remote-object.html:
+
</ins><span class="cx"> 2015-05-17  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Organize event handlers a bit
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjectexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object-expected.txt (184634 => 184635)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-05-20 10:25:39 UTC (rev 184634)
+++ trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-05-20 15:46:04 UTC (rev 184635)
</span><span class="lines">@@ -2191,11 +2191,55 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><del>-EXPRESSION: document.createTextNode('text')
</del><ins>+EXPRESSION: input = document.createElement('input'); input.type = 'password'; input
</ins><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">   &quot;_subtype&quot;: &quot;node&quot;,
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><ins>+  &quot;_description&quot;: &quot;input&quot;,
+  &quot;_preview&quot;: {
+    &quot;_type&quot;: &quot;object&quot;,
+    &quot;_subtype&quot;: &quot;node&quot;,
+    &quot;_description&quot;: &quot;input&quot;,
+    &quot;_lossless&quot;: false,
+    &quot;_overflow&quot;: true,
+    &quot;_properties&quot;: [
+      {
+        &quot;_name&quot;: &quot;selectionStart&quot;,
+        &quot;_type&quot;: &quot;number&quot;,
+        &quot;_value&quot;: &quot;0&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;selectionEnd&quot;,
+        &quot;_type&quot;: &quot;number&quot;,
+        &quot;_value&quot;: &quot;0&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;selectionDirection&quot;,
+        &quot;_type&quot;: &quot;string&quot;,
+        &quot;_value&quot;: &quot;none&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;accept&quot;,
+        &quot;_type&quot;: &quot;string&quot;,
+        &quot;_value&quot;: &quot;&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;alt&quot;,
+        &quot;_type&quot;: &quot;string&quot;,
+        &quot;_value&quot;: &quot;&quot;
+      }
+    ],
+    &quot;_entries&quot;: null
+  }
+}
+
+-----------------------------------------------------
+EXPRESSION: text = document.createTextNode('text content'); text
+{
+  &quot;_type&quot;: &quot;object&quot;,
+  &quot;_subtype&quot;: &quot;node&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</ins><span class="cx">   &quot;_description&quot;: &quot;#text&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><span class="cx">     &quot;_type&quot;: &quot;object&quot;,
</span><span class="lines">@@ -2207,7 +2251,7 @@
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;wholeText&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;string&quot;,
</span><del>-        &quot;_value&quot;: &quot;text&quot;
</del><ins>+        &quot;_value&quot;: &quot;text content&quot;
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;splitText&quot;,
</span><span class="lines">@@ -2222,12 +2266,12 @@
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;data&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;string&quot;,
</span><del>-        &quot;_value&quot;: &quot;text&quot;
</del><ins>+        &quot;_value&quot;: &quot;text content&quot;
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;length&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;number&quot;,
</span><del>-        &quot;_value&quot;: &quot;4&quot;
</del><ins>+        &quot;_value&quot;: &quot;12&quot;
</ins><span class="cx">       }
</span><span class="cx">     ],
</span><span class="cx">     &quot;_entries&quot;: null
</span><span class="lines">@@ -2235,6 +2279,109 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><ins>+EXPRESSION: comment = document.createComment('comment content'); comment
+{
+  &quot;_type&quot;: &quot;object&quot;,
+  &quot;_subtype&quot;: &quot;node&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_description&quot;: &quot;#comment&quot;,
+  &quot;_preview&quot;: {
+    &quot;_type&quot;: &quot;object&quot;,
+    &quot;_subtype&quot;: &quot;node&quot;,
+    &quot;_description&quot;: &quot;#comment&quot;,
+    &quot;_lossless&quot;: false,
+    &quot;_overflow&quot;: true,
+    &quot;_properties&quot;: [
+      {
+        &quot;_name&quot;: &quot;data&quot;,
+        &quot;_type&quot;: &quot;string&quot;,
+        &quot;_value&quot;: &quot;comment content&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;length&quot;,
+        &quot;_type&quot;: &quot;number&quot;,
+        &quot;_value&quot;: &quot;15&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;previousElementSibling&quot;,
+        &quot;_type&quot;: &quot;object&quot;,
+        &quot;_subtype&quot;: &quot;null&quot;,
+        &quot;_value&quot;: &quot;null&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;nextElementSibling&quot;,
+        &quot;_type&quot;: &quot;object&quot;,
+        &quot;_subtype&quot;: &quot;null&quot;,
+        &quot;_value&quot;: &quot;null&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;substringData&quot;,
+        &quot;_type&quot;: &quot;function&quot;,
+        &quot;_value&quot;: &quot;&quot;
+      }
+    ],
+    &quot;_entries&quot;: null
+  }
+}
+
+-----------------------------------------------------
+EXPRESSION: [document.body, div, span, input, text, comment]
+{
+  &quot;_type&quot;: &quot;object&quot;,
+  &quot;_subtype&quot;: &quot;array&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_description&quot;: &quot;Array&quot;,
+  &quot;_size&quot;: 6,
+  &quot;_preview&quot;: {
+    &quot;_type&quot;: &quot;object&quot;,
+    &quot;_subtype&quot;: &quot;array&quot;,
+    &quot;_description&quot;: &quot;Array&quot;,
+    &quot;_lossless&quot;: false,
+    &quot;_overflow&quot;: false,
+    &quot;_size&quot;: 6,
+    &quot;_properties&quot;: [
+      {
+        &quot;_name&quot;: &quot;0&quot;,
+        &quot;_type&quot;: &quot;object&quot;,
+        &quot;_subtype&quot;: &quot;node&quot;,
+        &quot;_value&quot;: &quot;&lt;body&gt;&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;1&quot;,
+        &quot;_type&quot;: &quot;object&quot;,
+        &quot;_subtype&quot;: &quot;node&quot;,
+        &quot;_value&quot;: &quot;&lt;div class=\&quot;foo bar\&quot;&gt;&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;2&quot;,
+        &quot;_type&quot;: &quot;object&quot;,
+        &quot;_subtype&quot;: &quot;node&quot;,
+        &quot;_value&quot;: &quot;&lt;span id=\&quot;foo\&quot;&gt;&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;3&quot;,
+        &quot;_type&quot;: &quot;object&quot;,
+        &quot;_subtype&quot;: &quot;node&quot;,
+        &quot;_value&quot;: &quot;&lt;input type=\&quot;password\&quot;&gt;&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;4&quot;,
+        &quot;_type&quot;: &quot;object&quot;,
+        &quot;_subtype&quot;: &quot;node&quot;,
+        &quot;_value&quot;: &quot;#text \&quot;text content\&quot;&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;5&quot;,
+        &quot;_type&quot;: &quot;object&quot;,
+        &quot;_subtype&quot;: &quot;node&quot;,
+        &quot;_value&quot;: &quot;&lt;!--comment content--&gt;&quot;
+      }
+    ],
+    &quot;_entries&quot;: null
+  }
+}
+
+-----------------------------------------------------
</ins><span class="cx"> EXPRESSION: document.head.children
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><span class="lines">@@ -2254,19 +2401,19 @@
</span><span class="cx">         &quot;_name&quot;: &quot;0&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;node&quot;,
</span><del>-        &quot;_value&quot;: &quot;meta&quot;
</del><ins>+        &quot;_value&quot;: &quot;&lt;meta&gt;&quot;
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;1&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;node&quot;,
</span><del>-        &quot;_value&quot;: &quot;script&quot;
</del><ins>+        &quot;_value&quot;: &quot;&lt;script&gt;&quot;
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;2&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;node&quot;,
</span><del>-        &quot;_value&quot;: &quot;script&quot;
</del><ins>+        &quot;_value&quot;: &quot;&lt;script&gt;&quot;
</ins><span class="cx">       }
</span><span class="cx">     ],
</span><span class="cx">     &quot;_entries&quot;: null
</span><span class="lines">@@ -2293,19 +2440,19 @@
</span><span class="cx">         &quot;_name&quot;: &quot;0&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;node&quot;,
</span><del>-        &quot;_value&quot;: &quot;p.my-test&quot;
</del><ins>+        &quot;_value&quot;: &quot;&lt;p class=\&quot;my-test\&quot;&gt;&quot;
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;1&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;node&quot;,
</span><del>-        &quot;_value&quot;: &quot;p.my-test&quot;
</del><ins>+        &quot;_value&quot;: &quot;&lt;p class=\&quot;my-test\&quot;&gt;&quot;
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;2&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;node&quot;,
</span><del>-        &quot;_value&quot;: &quot;p.my-test&quot;
</del><ins>+        &quot;_value&quot;: &quot;&lt;p class=\&quot;my-test\&quot;&gt;&quot;
</ins><span class="cx">       }
</span><span class="cx">     ],
</span><span class="cx">     &quot;_entries&quot;: null
</span><span class="lines">@@ -2332,19 +2479,19 @@
</span><span class="cx">         &quot;_name&quot;: &quot;0&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;node&quot;,
</span><del>-        &quot;_value&quot;: &quot;p.my-test&quot;
</del><ins>+        &quot;_value&quot;: &quot;&lt;p class=\&quot;my-test\&quot;&gt;&quot;
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;1&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;node&quot;,
</span><del>-        &quot;_value&quot;: &quot;p.my-test&quot;
</del><ins>+        &quot;_value&quot;: &quot;&lt;p class=\&quot;my-test\&quot;&gt;&quot;
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;2&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;node&quot;,
</span><del>-        &quot;_value&quot;: &quot;p.my-test&quot;
</del><ins>+        &quot;_value&quot;: &quot;&lt;p class=\&quot;my-test\&quot;&gt;&quot;
</ins><span class="cx">       }
</span><span class="cx">     ],
</span><span class="cx">     &quot;_entries&quot;: null
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjecthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object.html (184634 => 184635)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object.html        2015-05-20 10:25:39 UTC (rev 184634)
+++ trunk/LayoutTests/inspector/model/remote-object.html        2015-05-20 15:46:04 UTC (rev 184635)
</span><span class="lines">@@ -109,7 +109,10 @@
</span><span class="cx">         {expression: &quot;document.body&quot;},
</span><span class="cx">         {expression: &quot;div = document.createElement('div'); div.className = 'foo bar'; div&quot;},
</span><span class="cx">         {expression: &quot;span = document.createElement('span'); span.id = 'foo'; span&quot;},
</span><del>-        {expression: &quot;document.createTextNode('text')&quot;},
</del><ins>+        {expression: &quot;input = document.createElement('input'); input.type = 'password'; input&quot;},
+        {expression: &quot;text = document.createTextNode('text content'); text&quot;},
+        {expression: &quot;comment = document.createComment('comment content'); comment&quot;},
+        {expression: &quot;[document.body, div, span, input, text, comment]&quot;},
</ins><span class="cx"> 
</span><span class="cx">         // Node Collections (NodeLists / Collections)
</span><span class="cx">         {expression: &quot;document.all&quot;, browserOnly: true}, // HTMLAllCollection
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (184634 => 184635)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-05-20 10:25:39 UTC (rev 184634)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-05-20 15:46:04 UTC (rev 184635)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-05-20  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Slightly better node previews in arrays
+        https://bugs.webkit.org/show_bug.cgi?id=145188
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/InjectedScriptSource.js:
+        (InjectedScript.prototype._nodeDescription):
+        (InjectedScript.prototype._nodePreview):
+        Different stringified representations for a basic object description or in a preview.
+
+        (InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
+        Use the node preview string representation inside previews.
+
</ins><span class="cx"> 2015-05-19  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r184613 and r184614.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js (184634 => 184635)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-05-20 10:25:39 UTC (rev 184634)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-05-20 15:46:04 UTC (rev 184635)
</span><span class="lines">@@ -755,6 +755,53 @@
</span><span class="cx">         return null;
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    _nodeDescription: function(node)
+    {
+        var isXMLDocument = node.ownerDocument &amp;&amp; !!node.ownerDocument.xmlVersion;
+        var description = isXMLDocument ? node.nodeName : node.nodeName.toLowerCase();
+
+        switch (node.nodeType) {
+        case 1: // Node.ELEMENT_NODE
+            if (node.id)
+                description += &quot;#&quot; + node.id;
+            if (node.className)
+                description += &quot;.&quot; + node.className.trim().replace(/\s+/g, &quot;.&quot;);
+            return description;
+
+        default:
+            return description;
+        }
+    },
+
+    _nodePreview: function(node)
+    {
+        var isXMLDocument = node.ownerDocument &amp;&amp; !!node.ownerDocument.xmlVersion;
+        var nodeName = isXMLDocument ? node.nodeName : node.nodeName.toLowerCase();
+
+        switch (node.nodeType) {
+        case 1: // Node.ELEMENT_NODE
+            if (node.id)
+                return &quot;&lt;&quot; + nodeName + &quot; id=\&quot;&quot; + node.id + &quot;\&quot;&gt;&quot;;
+            if (node.className)
+                return &quot;&lt;&quot; + nodeName + &quot; class=\&quot;&quot; + node.className + &quot;\&quot;&gt;&quot;;
+            if (nodeName === &quot;input&quot; &amp;&amp; node.type)
+                return &quot;&lt;&quot; + nodeName + &quot; type=\&quot;&quot; + node.type + &quot;\&quot;&gt;&quot;;
+            return &quot;&lt;&quot; + nodeName + &quot;&gt;&quot;;
+
+        case 3: // Node.TEXT_NODE
+            return nodeName + &quot; \&quot;&quot; + node.nodeValue + &quot;\&quot;&quot;;
+
+        case 8: // Node.COMMENT_NODE
+            return &quot;&lt;!--&quot; + node.nodeValue + &quot;--&gt;&quot;;
+
+        case 10: // Node.DOCUMENT_TYPE_NODE
+            return &quot;&lt;!DOCTYPE &quot; + nodeName + &quot;&gt;&quot;;
+
+        default:
+            return nodeName;
+        }
+    },
+
</ins><span class="cx">     _describe: function(obj)
</span><span class="cx">     {
</span><span class="cx">         if (this.isPrimitiveValue(obj))
</span><span class="lines">@@ -774,20 +821,8 @@
</span><span class="cx">         if (subtype === &quot;error&quot;)
</span><span class="cx">             return toString(obj);
</span><span class="cx"> 
</span><del>-        if (subtype === &quot;node&quot;) {
-            var description = obj.nodeName.toLowerCase();
-            switch (obj.nodeType) {
-            case 1 /* Node.ELEMENT_NODE */:
-                description += obj.id ? &quot;#&quot; + obj.id : &quot;&quot;;
-                var className = obj.className;
-                description += (className &amp;&amp; typeof className === &quot;string&quot;) ? &quot;.&quot; + className.trim().replace(/\s+/g, &quot;.&quot;) : &quot;&quot;;
-                break;
-            case 10 /*Node.DOCUMENT_TYPE_NODE */:
-                description = &quot;&lt;!DOCTYPE &quot; + description + &quot;&gt;&quot;;
-                break;
-            }
-            return description;
-        }
</del><ins>+        if (subtype === &quot;node&quot;)
+            return this._nodeDescription(obj);
</ins><span class="cx"> 
</span><span class="cx">         var className = InjectedScriptHost.internalConstructorName(obj);
</span><span class="cx">         if (subtype === &quot;array&quot;)
</span><span class="lines">@@ -1133,8 +1168,10 @@
</span><span class="cx">                     preview.overflow = true;
</span><span class="cx">             } else {
</span><span class="cx">                 var description = &quot;&quot;;
</span><del>-                if (type !== &quot;function&quot; || subtype === &quot;class&quot;)
-                    description = this._abbreviateString(injectedScript._describe(value), maxLength, subtype === &quot;regexp&quot;);
</del><ins>+                if (type !== &quot;function&quot; || subtype === &quot;class&quot;) {
+                    var fullDescription = subtype === &quot;node&quot; ? injectedScript._nodePreview(value) : injectedScript._describe(value);
+                    description = this._abbreviateString(fullDescription, maxLength, subtype === &quot;regexp&quot;);
+                }
</ins><span class="cx">                 property.value = description;
</span><span class="cx">                 preview.lossless = false;
</span><span class="cx">             }
</span></span></pre>
</div>
</div>

</body>
</html>