<!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 <pecoraro@apple.com> on 2015-03-15
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
Modeled after a blink change:
Patch by <aandrey@chromium.org>
DevTools: DevTools: Show -0 for negative zero in console
https://src.chromium.org/viewvc/blink?revision=162605&view=revision
* inspector/InjectedScriptSource.js:
When creating a description string, or preview value string
for -0, be sure the string is "-0" and not "0".
LayoutTests:
Add tests for -0 in different places.
I don't understand yet why the test says "0" for
the property previews of "-0". 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 <pecoraro@apple.com>
+
+ 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 "0" for
+ the property previews of "-0". 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 <simon.fraser@apple.com>
</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"> "_type": "number",
</span><del>- "_description": "0",
</del><ins>+ "_description": "-0",
</ins><span class="cx"> "_value": 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
+{
+ "_type": "number",
+ "_description": "-Infinity",
+ "_value": null
+}
+
+-----------------------------------------------------
</ins><span class="cx"> EXPRESSION: ''
</span><span class="cx"> {
</span><span class="cx"> "_type": "string",
</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"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_objectId": "<filtered>",
</span><span class="cx"> "_description": "Array",
</span><del>- "_size": 2,
</del><ins>+ "_size": 4,
</ins><span class="cx"> "_preview": {
</span><span class="cx"> "_type": "object",
</span><span class="cx"> "_subtype": "array",
</span><span class="cx"> "_description": "Array",
</span><span class="cx"> "_lossless": true,
</span><span class="cx"> "_overflow": false,
</span><del>- "_size": 2,
</del><ins>+ "_size": 4,
</ins><span class="cx"> "_properties": [
</span><span class="cx"> {
</span><span class="cx"> "_name": "0",
</span><span class="cx"> "_type": "number",
</span><del>- "_value": "1"
</del><ins>+ "_value": "0"
</ins><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> "_name": "1",
</span><span class="cx"> "_type": "number",
</span><ins>+ "_value": "0"
+ },
+ {
+ "_name": "2",
+ "_type": "number",
+ "_value": "1"
+ },
+ {
+ "_name": "3",
+ "_type": "number",
</ins><span class="cx"> "_value": "2"
</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})
+{
+ "_type": "object",
+ "_objectId": "<filtered>",
+ "_description": "Object",
+ "_preview": {
+ "_type": "object",
+ "_description": "Object",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": [
+ {
+ "_name": "a",
+ "_type": "number",
+ "_value": "1"
+ },
+ {
+ "_name": "b",
+ "_type": "number",
+ "_value": "0"
+ },
+ {
+ "_name": "c",
+ "_type": "number",
+ "_value": "0"
+ }
+ ],
+ "_entries": null
+ }
+}
+
+-----------------------------------------------------
</ins><span class="cx"> EXPRESSION: ({a: 1, b: "string", c: /regex/, d: Symbol('sym')})
</span><span class="cx"> {
</span><span class="cx"> "_type": "object",
</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: "Number.MIN_VALUE"},
</span><span class="cx"> {expression: "NaN"},
</span><span class="cx"> {expression: "Infinity"},
</span><ins>+ {expression: "-Infinity"},
</ins><span class="cx">
</span><span class="cx"> // Strings
</span><span class="cx"> {expression: "''"},
</span><span class="lines">@@ -71,7 +72,7 @@
</span><span class="cx">
</span><span class="cx"> // Array
</span><span class="cx"> {expression: "[]"},
</span><del>- {expression: "[1, 2]"},
</del><ins>+ {expression: "[0, -0, 1, 2]"},
</ins><span class="cx"> {expression: "[[1],[2],[3]]"},
</span><span class="cx"> {expression: "[true, 1, 1.234, 'string', /regex/]"},
</span><span class="cx"> {expression: "[{a:1}, {b:2}, {c:2}]"},
</span><span class="lines">@@ -88,6 +89,7 @@
</span><span class="cx"> // Object
</span><span class="cx"> {expression: "({})"},
</span><span class="cx"> {expression: "({a: 1})"},
</span><ins>+ {expression: "({a: 1, b: 0, c: -0})"},
</ins><span class="cx"> {expression: "({a: 1, b: \"string\", c: /regex/, d: Symbol('sym')})"},
</span><span class="cx"> {expression: "({a:function a(){}, b:function b(){}, get getter(){}, set setter(v){}})"},
</span><span class="cx"> {expression: "function Foo() {}; new Foo"},
</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 <pecoraro@apple.com>
+
+ 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 <aandrey@chromium.org>
+ DevTools: DevTools: Show -0 for negative zero in console
+ https://src.chromium.org/viewvc/blink?revision=162605&view=revision
+
+ * inspector/InjectedScriptSource.js:
+ When creating a description string, or preview value string
+ for -0, be sure the string is "-0" and not "0".
+
</ins><span class="cx"> 2015-03-14 Ryosuke Niwa <rniwa@webkit.org>
</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 && 1 / obj < 0)
+ return "-0";
+
+ return toString(obj);
+}
+
</ins><span class="cx"> function isUInt32(obj)
</span><span class="cx"> {
</span><span class="cx"> if (typeof obj === "number")
</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 === "number")
</span><del>- this.description = object + "";
</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>