<!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>[181516] 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/181516">181516</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-15 17:16:30 -0700 (Sun, 15 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Better handle displaying -0
https://bugs.webkit.org/show_bug.cgi?id=142708

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

Source/JavaScriptCore:

Modeled after a blink change:

Patch by &lt;aandrey@chromium.org&gt;
DevTools: DevTools: Show -0 for negative zero in console
https://src.chromium.org/viewvc/blink?revision=162605&amp;view=revision

* inspector/InjectedScriptSource.js:
When creating a description string, or preview value string
for -0, be sure the string is &quot;-0&quot; and not &quot;0&quot;.

LayoutTests:

Add tests for -0 in different places.
I don't understand yet why the test says &quot;0&quot; for
the property previews of &quot;-0&quot;. Everything behaves
correctly, but I can't see to make the test show
the right value appear in the test. That is worth
investigating separately though.

* 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 (181515 => 181516)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-15 23:07:37 UTC (rev 181515)
+++ trunk/LayoutTests/ChangeLog        2015-03-16 00:16:30 UTC (rev 181516)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-03-15  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Better handle displaying -0
+        https://bugs.webkit.org/show_bug.cgi?id=142708
+
+        Reviewed by Timothy Hatcher.
+
+        Add tests for -0 in different places.
+        I don't understand yet why the test says &quot;0&quot; for
+        the property previews of &quot;-0&quot;. Everything behaves
+        correctly, but I can't see to make the test show
+        the right value appear in the test. That is worth
+        investigating separately though.
+
+        * inspector/model/remote-object-expected.txt:
+        * inspector/model/remote-object.html:
+
</ins><span class="cx"> 2015-03-15  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reduce the side-effects of animations turning off overlap testing
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjectexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object-expected.txt (181515 => 181516)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-03-15 23:07:37 UTC (rev 181515)
+++ trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-03-16 00:16:30 UTC (rev 181516)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> EXPRESSION: -0
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;number&quot;,
</span><del>-  &quot;_description&quot;: &quot;0&quot;,
</del><ins>+  &quot;_description&quot;: &quot;-0&quot;,
</ins><span class="cx">   &quot;_value&quot;: 0
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -136,6 +136,14 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><ins>+EXPRESSION: -Infinity
+{
+  &quot;_type&quot;: &quot;number&quot;,
+  &quot;_description&quot;: &quot;-Infinity&quot;,
+  &quot;_value&quot;: null
+}
+
+-----------------------------------------------------
</ins><span class="cx"> EXPRESSION: ''
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;string&quot;,
</span><span class="lines">@@ -532,29 +540,39 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><del>-EXPRESSION: [1, 2]
</del><ins>+EXPRESSION: [0, -0, 1, 2]
</ins><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">   &quot;_subtype&quot;: &quot;array&quot;,
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Array&quot;,
</span><del>-  &quot;_size&quot;: 2,
</del><ins>+  &quot;_size&quot;: 4,
</ins><span class="cx">   &quot;_preview&quot;: {
</span><span class="cx">     &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">     &quot;_subtype&quot;: &quot;array&quot;,
</span><span class="cx">     &quot;_description&quot;: &quot;Array&quot;,
</span><span class="cx">     &quot;_lossless&quot;: true,
</span><span class="cx">     &quot;_overflow&quot;: false,
</span><del>-    &quot;_size&quot;: 2,
</del><ins>+    &quot;_size&quot;: 4,
</ins><span class="cx">     &quot;_properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;0&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;number&quot;,
</span><del>-        &quot;_value&quot;: &quot;1&quot;
</del><ins>+        &quot;_value&quot;: &quot;0&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;number&quot;,
</span><ins>+        &quot;_value&quot;: &quot;0&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;2&quot;,
+        &quot;_type&quot;: &quot;number&quot;,
+        &quot;_value&quot;: &quot;1&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;3&quot;,
+        &quot;_type&quot;: &quot;number&quot;,
</ins><span class="cx">         &quot;_value&quot;: &quot;2&quot;
</span><span class="cx">       }
</span><span class="cx">     ],
</span><span class="lines">@@ -1466,6 +1484,38 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><ins>+EXPRESSION: ({a: 1, b: 0, c: -0})
+{
+  &quot;_type&quot;: &quot;object&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_description&quot;: &quot;Object&quot;,
+  &quot;_preview&quot;: {
+    &quot;_type&quot;: &quot;object&quot;,
+    &quot;_description&quot;: &quot;Object&quot;,
+    &quot;_lossless&quot;: true,
+    &quot;_overflow&quot;: false,
+    &quot;_properties&quot;: [
+      {
+        &quot;_name&quot;: &quot;a&quot;,
+        &quot;_type&quot;: &quot;number&quot;,
+        &quot;_value&quot;: &quot;1&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;b&quot;,
+        &quot;_type&quot;: &quot;number&quot;,
+        &quot;_value&quot;: &quot;0&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;c&quot;,
+        &quot;_type&quot;: &quot;number&quot;,
+        &quot;_value&quot;: &quot;0&quot;
+      }
+    ],
+    &quot;_entries&quot;: null
+  }
+}
+
+-----------------------------------------------------
</ins><span class="cx"> EXPRESSION: ({a: 1, b: &quot;string&quot;, c: /regex/, d: Symbol('sym')})
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjecthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object.html (181515 => 181516)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object.html        2015-03-15 23:07:37 UTC (rev 181515)
+++ trunk/LayoutTests/inspector/model/remote-object.html        2015-03-16 00:16:30 UTC (rev 181516)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx">         {expression: &quot;Number.MIN_VALUE&quot;},
</span><span class="cx">         {expression: &quot;NaN&quot;},
</span><span class="cx">         {expression: &quot;Infinity&quot;},
</span><ins>+        {expression: &quot;-Infinity&quot;},
</ins><span class="cx"> 
</span><span class="cx">         // Strings
</span><span class="cx">         {expression: &quot;''&quot;},
</span><span class="lines">@@ -71,7 +72,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Array
</span><span class="cx">         {expression: &quot;[]&quot;},
</span><del>-        {expression: &quot;[1, 2]&quot;},
</del><ins>+        {expression: &quot;[0, -0, 1, 2]&quot;},
</ins><span class="cx">         {expression: &quot;[[1],[2],[3]]&quot;},
</span><span class="cx">         {expression: &quot;[true, 1, 1.234, 'string', /regex/]&quot;},
</span><span class="cx">         {expression: &quot;[{a:1}, {b:2}, {c:2}]&quot;},
</span><span class="lines">@@ -88,6 +89,7 @@
</span><span class="cx">         // Object
</span><span class="cx">         {expression: &quot;({})&quot;},
</span><span class="cx">         {expression: &quot;({a: 1})&quot;},
</span><ins>+        {expression: &quot;({a: 1, b: 0, c: -0})&quot;},
</ins><span class="cx">         {expression: &quot;({a: 1, b: \&quot;string\&quot;, c: /regex/, d: Symbol('sym')})&quot;},
</span><span class="cx">         {expression: &quot;({a:function a(){}, b:function b(){}, get getter(){}, set setter(v){}})&quot;},
</span><span class="cx">         {expression: &quot;function Foo() {}; new Foo&quot;},
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (181515 => 181516)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-03-15 23:07:37 UTC (rev 181515)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-03-16 00:16:30 UTC (rev 181516)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-03-15  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Better handle displaying -0
+        https://bugs.webkit.org/show_bug.cgi?id=142708
+
+        Reviewed by Timothy Hatcher.
+
+        Modeled after a blink change:
+
+        Patch by &lt;aandrey@chromium.org&gt;
+        DevTools: DevTools: Show -0 for negative zero in console
+        https://src.chromium.org/viewvc/blink?revision=162605&amp;view=revision
+
+        * inspector/InjectedScriptSource.js:
+        When creating a description string, or preview value string
+        for -0, be sure the string is &quot;-0&quot; and not &quot;0&quot;.
+
</ins><span class="cx"> 2015-03-14  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         parseClass should popScope after pushScope
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js (181515 => 181516)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-03-15 23:07:37 UTC (rev 181515)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-03-16 00:16:30 UTC (rev 181516)
</span><span class="lines">@@ -39,6 +39,14 @@
</span><span class="cx">     return String(obj);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function toStringDescription(obj)
+{
+    if (obj === 0 &amp;&amp; 1 / obj &lt; 0)
+        return &quot;-0&quot;;
+
+    return toString(obj);
+}
+
</ins><span class="cx"> function isUInt32(obj)
</span><span class="cx"> {
</span><span class="cx">     if (typeof obj === &quot;number&quot;)
</span><span class="lines">@@ -424,7 +432,7 @@
</span><span class="cx">     {
</span><span class="cx">         var remoteObject = this._wrapObject(value, objectGroup);
</span><span class="cx">         try {
</span><del>-            remoteObject.description = toString(value);
</del><ins>+            remoteObject.description = toStringDescription(value);
</ins><span class="cx">         } catch (e) {}
</span><span class="cx">         return {
</span><span class="cx">             wasThrown: true,
</span><span class="lines">@@ -895,7 +903,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Provide user-friendly number values.
</span><span class="cx">         if (this.type === &quot;number&quot;)
</span><del>-            this.description = object + &quot;&quot;;
</del><ins>+            this.description = toStringDescription(object);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1056,7 +1064,7 @@
</span><span class="cx">                     value = this._abbreviateString(value, maxLength, true);
</span><span class="cx">                     preview.lossless = false;
</span><span class="cx">                 }
</span><del>-                this._appendPropertyPreview(preview, internal, {name, type, value: toString(value)}, propertiesThreshold);
</del><ins>+                this._appendPropertyPreview(preview, internal, {name, type, value: toStringDescription(value)}, propertiesThreshold);
</ins><span class="cx">                 continue;
</span><span class="cx">             }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>