<!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>[194123] 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/194123">194123</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2015-12-15 16:23:49 -0800 (Tue, 15 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Localize &quot;global code&quot; and &quot;eval code&quot; strings
https://bugs.webkit.org/show_bug.cgi?id=152313

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/CallFrame.js:
(WebInspector.CallFrame.fromPayload):
Localize the strings given to use from the backend.

LayoutTests:

* inspector/debugger/js-stacktrace-expected.txt:
* inspector/debugger/js-stacktrace.html:
* inspector/model/stack-trace-expected.txt: Added.
* inspector/model/stack-trace.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerjsstacktraceexpectedtxt">trunk/LayoutTests/inspector/debugger/js-stacktrace-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerjsstacktracehtml">trunk/LayoutTests/inspector/debugger/js-stacktrace.html</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCallFramejs">trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectormodelstacktraceexpectedtxt">trunk/LayoutTests/inspector/model/stack-trace-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectormodelstacktracehtml">trunk/LayoutTests/inspector/model/stack-trace.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (194122 => 194123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-12-16 00:06:02 UTC (rev 194122)
+++ trunk/LayoutTests/ChangeLog        2015-12-16 00:23:49 UTC (rev 194123)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-12-15  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Localize &quot;global code&quot; and &quot;eval code&quot; strings
+        https://bugs.webkit.org/show_bug.cgi?id=152313
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/debugger/js-stacktrace-expected.txt:
+        * inspector/debugger/js-stacktrace.html:
+        * inspector/model/stack-trace-expected.txt: Added.
+        * inspector/model/stack-trace.html: Added.
+
</ins><span class="cx"> 2015-12-15  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r191849): There's no yellow bouncy highlight when using Find on Page on iOS
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerjsstacktraceexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/debugger/js-stacktrace-expected.txt (194122 => 194123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/js-stacktrace-expected.txt        2015-12-16 00:06:02 UTC (rev 194122)
+++ trunk/LayoutTests/inspector/debugger/js-stacktrace-expected.txt        2015-12-16 00:23:49 UTC (rev 194123)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx">     {
</span><span class="cx">         &quot;lineNumber&quot;: null,
</span><span class="cx">         &quot;columnNumber&quot;: null,
</span><del>-        &quot;functionName&quot;: &quot;eval code&quot;,
</del><ins>+        &quot;functionName&quot;: &quot;Eval Code&quot;,
</ins><span class="cx">         &quot;nativeCode&quot;: true,
</span><span class="cx">         &quot;programCode&quot;: true
</span><span class="cx">     }
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">     {
</span><span class="cx">         &quot;lineNumber&quot;: null,
</span><span class="cx">         &quot;columnNumber&quot;: null,
</span><del>-        &quot;functionName&quot;: &quot;eval code&quot;,
</del><ins>+        &quot;functionName&quot;: &quot;Eval Code&quot;,
</ins><span class="cx">         &quot;nativeCode&quot;: true,
</span><span class="cx">         &quot;programCode&quot;: true
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerjsstacktracehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/debugger/js-stacktrace.html (194122 => 194123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/js-stacktrace.html        2015-12-16 00:06:02 UTC (rev 194122)
+++ trunk/LayoutTests/inspector/debugger/js-stacktrace.html        2015-12-16 00:23:49 UTC (rev 194123)
</span><span class="lines">@@ -114,7 +114,7 @@
</span><span class="cx">         var index = 0;
</span><span class="cx">         for (var frame of stackTrace) {
</span><span class="cx">             index++;
</span><del>-            if (frame.nativeCode &amp;&amp; frame.functionName === &quot;eval code&quot;)
</del><ins>+            if (frame.programCode)
</ins><span class="cx">                 break;
</span><span class="cx">         }
</span><span class="cx">         return stackTrace.slice(0, index);
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelstacktraceexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/model/stack-trace-expected.txt (0 => 194123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/stack-trace-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/model/stack-trace-expected.txt        2015-12-16 00:23:49 UTC (rev 194123)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Tests for the WebInspector.StackTrace model object.
+
+
+== Running test suite: WebInspector.StackTrace
+-- Running test case: WebInspector.ConsoleMessage.StackTrace
+PASS: ConsoleMessage type should be Trace.
+PASS: ConsoleMessage should have StackTrace.
+PASS: CallFrame in StackTrace has no identifier.
+PASS: CallFrame in StackTrace has no thisObject.
+PASS: CallFrame in StackTrace has no scopeChain.
+StackTrace: 11
+  1: foo - nativeCode (true) programCode (false)
+  2: Eval Code - nativeCode (true) programCode (true)
+  3: eval - nativeCode (true) programCode (false)
+  4: Global Code (stack-trace.html:2) - nativeCode (false) programCode (true)
+  5: appendChild - nativeCode (true) programCode (false)
+  6: triggerConsoleMessage (stack-trace.html:9) - nativeCode (false) programCode (false)
+  7: Eval Code - nativeCode (true) programCode (true)
+  8: eval - nativeCode (true) programCode (false)
+  9: _evaluateOn - nativeCode (true) programCode (false)
+  10: _evaluateAndWrap - nativeCode (true) programCode (false)
+  11: evaluate - nativeCode (true) programCode (false)
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectormodelstacktracehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/model/stack-trace.html (0 => 194123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/stack-trace.html                                (rev 0)
+++ trunk/LayoutTests/inspector/model/stack-trace.html        2015-12-16 00:23:49 UTC (rev 194123)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function triggerConsoleMessage() {
+    let script = document.createElement(&quot;script&quot;);
+    script.textContent = &quot;//# sourceURL=inline-script.js\neval('function foo() { console.trace(); }; foo();')&quot;;
+    document.body.appendChild(script);
+}
+
+function test()
+{
+    function logStackTrace(stackTrace) {
+        InspectorTest.log(`StackTrace: ${stackTrace.callFrames.length}`);
+        for (let i = 0; i &lt; stackTrace.callFrames.length; ++i) {
+            let callFrame = stackTrace.callFrames[i];
+            let string = `  ${i + 1}: ${callFrame.functionName}`;
+            if (callFrame.sourceCodeLocation)
+                string += ` (${callFrame.sourceCodeLocation.originalLocationString()})`;
+            string += &quot; -&quot;;
+            string += ` nativeCode (${callFrame.nativeCode})`;
+            string += ` programCode (${callFrame.programCode})`;
+            InspectorTest.log(string);
+        }
+    }
+
+    let suite = InspectorTest.createAsyncSuite(&quot;WebInspector.StackTrace&quot;);
+
+    suite.addTestCase({
+        name: &quot;WebInspector.ConsoleMessage.StackTrace&quot;,
+        description: &quot;Test we can create a StackTrace from console messages (Console.StackTrace).&quot;,
+        test: (resolve, reject) =&gt; {
+            InspectorTest.evaluateInPage(&quot;triggerConsoleMessage()&quot;);
+            WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, function addListener(event) {
+                // Trace message should always have a stack trace.
+                let consoleMessage = event.data.message;
+                let stackTrace = consoleMessage.stackTrace;
+                InspectorTest.expectThat(consoleMessage.type === WebInspector.ConsoleMessage.MessageType.Trace, &quot;ConsoleMessage type should be Trace.&quot;);
+                InspectorTest.expectThat(stackTrace instanceof WebInspector.StackTrace, &quot;ConsoleMessage should have StackTrace.&quot;);
+
+                // Console message stack trace call frame's do not have debugging information.
+                InspectorTest.expectThat(stackTrace.callFrames[0].id === null, &quot;CallFrame in StackTrace has no identifier.&quot;);
+                InspectorTest.expectThat(stackTrace.callFrames[0].thisObject === null, &quot;CallFrame in StackTrace has no thisObject.&quot;);
+                InspectorTest.expectThat(!stackTrace.callFrames[0].scopeChain.length, &quot;CallFrame in StackTrace has no scopeChain.&quot;);
+
+                logStackTrace(consoleMessage.stackTrace);
+                resolve();
+            });
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+&lt;p&gt;Tests for the WebInspector.StackTrace model object.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (194122 => 194123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-12-16 00:06:02 UTC (rev 194122)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-12-16 00:23:49 UTC (rev 194123)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-12-15  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Localize &quot;global code&quot; and &quot;eval code&quot; strings
+        https://bugs.webkit.org/show_bug.cgi?id=152313
+
+        Reviewed by Timothy Hatcher.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Models/CallFrame.js:
+        (WebInspector.CallFrame.fromPayload):
+        Localize the strings given to use from the backend.
+
</ins><span class="cx"> 2015-12-15  Matt Baker  &lt;mattbaker@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Convert Sidebar classes to use View
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (194122 => 194123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-12-16 00:06:02 UTC (rev 194122)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-12-16 00:23:49 UTC (rev 194123)
</span><span class="lines">@@ -266,6 +266,7 @@
</span><span class="cx"> localizedStrings[&quot;Enter a name.&quot;] = &quot;Enter a name.&quot;;
</span><span class="cx"> localizedStrings[&quot;Error: &quot;] = &quot;Error: &quot;;
</span><span class="cx"> localizedStrings[&quot;Errors&quot;] = &quot;Errors&quot;;
</span><ins>+localizedStrings[&quot;Eval Code&quot;] = &quot;Eval Code&quot;;
</ins><span class="cx"> localizedStrings[&quot;Evaluate JavaScript&quot;] = &quot;Evaluate JavaScript&quot;;
</span><span class="cx"> localizedStrings[&quot;Event Dispatched&quot;] = &quot;Event Dispatched&quot;;
</span><span class="cx"> localizedStrings[&quot;Event Listeners&quot;] = &quot;Event Listeners&quot;;
</span><span class="lines">@@ -309,6 +310,7 @@
</span><span class="cx"> localizedStrings[&quot;Garbage Collection&quot;] = &quot;Garbage Collection&quot;;
</span><span class="cx"> localizedStrings[&quot;Getter&quot;] = &quot;Getter&quot;;
</span><span class="cx"> localizedStrings[&quot;Global Breakpoints&quot;] = &quot;Global Breakpoints&quot;;
</span><ins>+localizedStrings[&quot;Global Code&quot;] = &quot;Global Code&quot;;
</ins><span class="cx"> localizedStrings[&quot;Global Lexical Environment&quot;] = &quot;Global Lexical Environment&quot;;
</span><span class="cx"> localizedStrings[&quot;Global Variables&quot;] = &quot;Global Variables&quot;;
</span><span class="cx"> localizedStrings[&quot;Grammar&quot;] = &quot;Grammar&quot;;
</span><span class="lines">@@ -391,6 +393,7 @@
</span><span class="cx"> localizedStrings[&quot;Method&quot;] = &quot;Method&quot;;
</span><span class="cx"> localizedStrings[&quot;Min&quot;] = &quot;Min&quot;;
</span><span class="cx"> localizedStrings[&quot;Mixed&quot;] = &quot;Mixed&quot;;
</span><ins>+localizedStrings[&quot;Module Code&quot;] = &quot;Module Code&quot;;
</ins><span class="cx"> localizedStrings[&quot;Name&quot;] = &quot;Name&quot;;
</span><span class="cx"> localizedStrings[&quot;Network&quot;] = &quot;Network&quot;;
</span><span class="cx"> localizedStrings[&quot;Network Issue&quot;] = &quot;Network Issue&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCallFramejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js (194122 => 194123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js        2015-12-16 00:06:02 UTC (rev 194122)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js        2015-12-16 00:23:49 UTC (rev 194123)
</span><span class="lines">@@ -112,31 +112,37 @@
</span><span class="cx">     {
</span><span class="cx">         console.assert(payload);
</span><span class="cx"> 
</span><del>-        var url = payload.url;
-        var nativeCode = false;
-        var programCode = false;
-        var sourceCodeLocation = null;
</del><ins>+        let url = payload.url;
+        let nativeCode = false;
+        let programCode = false;
+        let sourceCodeLocation = null;
</ins><span class="cx"> 
</span><span class="cx">         if (!url || url === &quot;[native code]&quot;) {
</span><span class="cx">             nativeCode = true;
</span><span class="cx">             url = null;
</span><span class="cx">         } else {
</span><del>-            var sourceCode = WebInspector.frameResourceManager.resourceForURL(url);
</del><ins>+            let sourceCode = WebInspector.frameResourceManager.resourceForURL(url);
</ins><span class="cx">             if (!sourceCode)
</span><span class="cx">                 sourceCode = WebInspector.debuggerManager.scriptsForURL(url)[0];
</span><span class="cx"> 
</span><span class="cx">             if (sourceCode) {
</span><span class="cx">                 // The lineNumber is 1-based, but we expect 0-based.
</span><del>-                var lineNumber = payload.lineNumber - 1;
</del><ins>+                let lineNumber = payload.lineNumber - 1;
</ins><span class="cx">                 sourceCodeLocation = sourceCode.createLazySourceCodeLocation(lineNumber, payload.columnNumber);
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        var functionName = payload.functionName;
-        if (payload.functionName === &quot;global code&quot;
-            || payload.functionName === &quot;eval code&quot;
-            || payload.functionName === &quot;module code&quot;)
</del><ins>+        let functionName = payload.functionName;
+        if (payload.functionName === &quot;global code&quot;) {
+            functionName = WebInspector.UIString(&quot;Global Code&quot;);
</ins><span class="cx">             programCode = true;
</span><ins>+        } else if (payload.functionName === &quot;eval code&quot;) {
+            functionName = WebInspector.UIString(&quot;Eval Code&quot;);
+            programCode = true;
+        } else if (payload.functionName === &quot;module code&quot;) {
+            functionName = WebInspector.UIString(&quot;Module Code&quot;);
+            programCode = true;
+        }
</ins><span class="cx"> 
</span><span class="cx">         return new WebInspector.CallFrame(null, sourceCodeLocation, functionName, null, null, nativeCode, programCode);
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>