<!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>[182579] 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/182579">182579</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-08 18:37:58 -0700 (Wed, 08 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Split ConsoleMessageImpl into the View and the Model
https://bugs.webkit.org/show_bug.cgi?id=142599

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

* UserInterface/Models/ConsoleMessage.js: Added.
(WebInspector.ConsoleMessage):
(WebInspector.ConsoleMessage.prototype.get source):
(WebInspector.ConsoleMessage.prototype.get level):
(WebInspector.ConsoleMessage.prototype.get messageText):
(WebInspector.ConsoleMessage.prototype.get type):
(WebInspector.ConsoleMessage.prototype.get url):
(WebInspector.ConsoleMessage.prototype.get line):
(WebInspector.ConsoleMessage.prototype.get column):
(WebInspector.ConsoleMessage.prototype.get repeatCount):
(WebInspector.ConsoleMessage.prototype.get parameters):
(WebInspector.ConsoleMessage.prototype.get stackTrace):
(WebInspector.ConsoleMessage.prototype.get request):
New readonly model object for console messages.

* UserInterface/Main.html:
* UserInterface/Test.html:
* UserInterface/Base/Test.js:
(WebInspector.loaded):
Load the new files in the main / test page.

* UserInterface/Views/LegacyConsoleMessage.js: Removed.
* UserInterface/Views/LegacyConsoleMessageImpl.js: Removed.
Remove Legacy versions.

* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
* UserInterface/Controllers/JavaScriptLogViewController.js:
(WebInspector.JavaScriptLogViewController):
(WebInspector.JavaScriptLogViewController.prototype.startNewSession):
(WebInspector.JavaScriptLogViewController.prototype.appendImmediateExecutionWithResult.saveResultCallback):
(WebInspector.JavaScriptLogViewController.prototype.appendImmediateExecutionWithResult):
(WebInspector.JavaScriptLogViewController.prototype.appendConsoleMessage):
(WebInspector.JavaScriptLogViewController.prototype.updatePreviousMessageRepeatCount):
(WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted.printResult):
(WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted):
(WebInspector.JavaScriptLogViewController.prototype._appendConsoleMessageView):
(WebInspector.JavaScriptLogViewController.prototype._appendConsoleMessage): Deleted.
Update LogViewController to create ConsoleMessageViews from ConsoleMessages when applicable.
Also clarify when we have a view versus model object.

* UserInterface/Protocol/ConsoleObserver.js:
(WebInspector.ConsoleObserver.prototype.messageAdded):
* UserInterface/Controllers/LogManager.js:
(WebInspector.LogManager.prototype.messageWasAdded):
(WebInspector.LogManager.prototype.messagesCleared):
(WebInspector.LogManager.prototype._mainResourceDidChange):
Create model objects and issue events for the model objects.

* UserInterface/Models/DefaultDashboard.js:
(WebInspector.DefaultDashboard.prototype._consoleMessageAdded):
(WebInspector.DefaultDashboard.prototype._incrementConsoleMessageType):
Update now that the event gives us a model object.

* UserInterface/Views/ConsoleMessageView.js: Added.
(WebInspector.ConsoleMessageView):
(WebInspector.ConsoleMessageView.prototype.get element):
(WebInspector.ConsoleMessageView.prototype.get message):
(WebInspector.ConsoleMessageView.prototype.get repeatCount):
(WebInspector.ConsoleMessageView.prototype.set repeatCount):
(WebInspector.ConsoleMessageView.prototype.toClipboardString):
(WebInspector.ConsoleMessageView.prototype._appendMessageTextAndArguments):
(WebInspector.ConsoleMessageView.prototype._appendSavedResultIndex):
(WebInspector.ConsoleMessageView.prototype._appendLocationLink):
(WebInspector.ConsoleMessageView.prototype._appendParameters):
(WebInspector.ConsoleMessageView.prototype._appendStackTrace):
(WebInspector.ConsoleMessageView.prototype._appendFormattedArguments):
(WebInspector.ConsoleMessageView.prototype._formatParameter):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsValue):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsString):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsNode):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsObject):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsArray):
(WebInspector.ConsoleMessageView.prototype._rootPropertyPathForObject):
(WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.parameterFormatter):
(WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.stringFormatter):
(WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.floatFormatter):
(WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.integerFormatter):
(WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.styleFormatter):
(WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.isWhitelistedProperty):
(WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.append):
(WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString):
(WebInspector.ConsoleMessageView.prototype._shouldShowStackTrace):
(WebInspector.ConsoleMessageView.prototype._shouldHideURL):
(WebInspector.ConsoleMessageView.prototype._firstNonNativeCallFrame):
(WebInspector.ConsoleMessageView.prototype._linkifyLocation):
(WebInspector.ConsoleMessageView.prototype._linkifyCallFrame):
(WebInspector.ConsoleMessageView.prototype._userProvidedColumnNames):
(WebInspector.ConsoleMessageView.prototype._formatParameterAsTable):
(WebInspector.ConsoleMessageView.prototype._levelString):
(WebInspector.ConsoleMessageView.prototype._enforcesClipboardPrefixString):
(WebInspector.ConsoleMessageView.prototype._clipboardPrefixString):
New View class for a ConsoleMessage. This is a near direct port of the old code
to a view class that has a root element.

* UserInterface/Models/ConsoleCommandResultMessage.js: Renamed from Source/WebInspectorUI/UserInterface/Views/ConsoleCommandResult.js.
(WebInspector.ConsoleCommandResultMessage):
(WebInspector.ConsoleCommandResultMessage.clearMaximumSavedResultIndex):
(WebInspector.ConsoleCommandResultMessage.prototype.get savedResultIndex):
Rename, as this is a ConsoleMessage subclass with a specific type for console evaluation results.

* UserInterface/Views/ConsoleCommandView.js: Renamed from Source/WebInspectorUI/UserInterface/Views/ConsoleCommand.js.
(WebInspector.ConsoleCommandView):
(WebInspector.ConsoleCommandView.prototype.get element):
(WebInspector.ConsoleCommandView.prototype.get commandText):
(WebInspector.ConsoleCommandView.prototype.get message):
(WebInspector.ConsoleCommandView.prototype.toClipboardString):
* UserInterface/Views/ConsoleGroup.js:
(WebInspector.ConsoleGroup):
(WebInspector.ConsoleGroup.prototype.get parentGroup):
(WebInspector.ConsoleGroup.prototype.render):
(WebInspector.ConsoleGroup.prototype.addMessageView):
(WebInspector.ConsoleGroup.prototype.append):
(WebInspector.ConsoleGroup.prototype._titleMouseDown):
(WebInspector.ConsoleGroup.prototype.addMessage): Deleted.
(WebInspector.ConsoleGroup.prototype._titleClicked): Deleted.
* UserInterface/Views/ConsoleSession.js:
(WebInspector.ConsoleSession):
(WebInspector.ConsoleSession.prototype.addMessageView):
(WebInspector.ConsoleSession.prototype.append):
(WebInspector.ConsoleSession.prototype.addMessage): Deleted.
(WebInspector.ConsoleSession.prototype.hasMessages): Deleted.
Convert to classes, and clarify these deal with View objects.

* UserInterface/Views/LogContentView.css:
(.console-message .repeat-count):
(.console-message .bubble): Deleted.
Better class name for the repeat count element.

* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype.didAppendConsoleMessageView):
(WebInspector.LogContentView.prototype._formatMessagesAsData):
(WebInspector.LogContentView.prototype._messageAdded):
(WebInspector.LogContentView.prototype._updateMessagesSelection):
(WebInspector.LogContentView.prototype._selectAllMessages):
(WebInspector.LogContentView.prototype._allMessageElements):
(WebInspector.LogContentView.prototype._unfilteredMessageElements):
(WebInspector.LogContentView.prototype._visibleMessageElements):
(WebInspector.LogContentView.prototype._scopeBarSelectionDidChange):
(WebInspector.LogContentView.prototype._filterMessageElements):
(WebInspector.LogContentView.prototype._upArrowWasPressed):
(WebInspector.LogContentView.prototype._downArrowWasPressed):
(WebInspector.LogContentView.prototype._previousMessage):
(WebInspector.LogContentView.prototype._nextMessage):
(WebInspector.LogContentView.prototype._performSearch):
(WebInspector.LogContentView.prototype._highlightRanges):
(WebInspector.LogContentView.prototype._reappendProvisionalMessages):
(WebInspector.LogContentView.prototype.didAppendConsoleMessage): Deleted.
(WebInspector.LogContentView.prototype._allMessages): Deleted.
(WebInspector.LogContentView.prototype._unfilteredMessages): Deleted.
(WebInspector.LogContentView.prototype._visibleMessages): Deleted.
(WebInspector.LogContentView.prototype._filterMessages): Deleted.
Rename lots of things to make it clear when we are dealing with
elements, model objects, or view objects. This class is still heavily
dealing with elements, and needs to be cleaned up later.

LayoutTests:

* inspector/console/console-api-expected.txt: Added.
* inspector/console/console-api.html: Added.
Add a basic test for console APIs creating the new ConsoleMessage model objects.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseTestjs">trunk/Source/WebInspectorUI/UserInterface/Base/Test.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersJavaScriptLogViewControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersJavaScriptRuntimeCompletionProviderjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersLogManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDefaultDashboardjs">trunk/Source/WebInspectorUI/UserInterface/Models/DefaultDashboard.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolConsoleObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/ConsoleObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTesthtml">trunk/Source/WebInspectorUI/UserInterface/Test.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleGroupjs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleGroup.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleSessionjs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleSession.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/inspector/console/</li>
<li><a href="#trunkLayoutTestsinspectorconsoleconsoleapiexpectedtxt">trunk/LayoutTests/inspector/console/console-api-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorconsoleconsoleapihtml">trunk/LayoutTests/inspector/console/console-api.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsConsoleCommandResultMessagejs">trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleCommandResultMessage.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsConsoleMessagejs">trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandjs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommand.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandResultjs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandResult.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyConsoleMessagejs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessage.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyConsoleMessageImpljs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessageImpl.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/LayoutTests/ChangeLog        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-04-08  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Split ConsoleMessageImpl into the View and the Model
+        https://bugs.webkit.org/show_bug.cgi?id=142599
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/console/console-api-expected.txt: Added.
+        * inspector/console/console-api.html: Added.
+        Add a basic test for console APIs creating the new ConsoleMessage model objects.
+
</ins><span class="cx"> 2015-04-08  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Document some test failures.
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorconsoleconsoleapiexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/console/console-api-expected.txt (0 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/console/console-api-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/console/console-api-expected.txt        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -0,0 +1,597 @@
</span><ins>+CONSOLE MESSAGE: line 1: console.log
+CONSOLE MESSAGE: line 1: console.warn
+CONSOLE MESSAGE: line 1: console.error
+CONSOLE MESSAGE: line 1: console.debug
+CONSOLE MESSAGE: line 1: console.info
+CONSOLE MESSAGE: line 1: assertion message
+CONSOLE MESSAGE: line 1: string message
+CONSOLE MESSAGE: line 1: message
+CONSOLE MESSAGE: line 1: message
+CONSOLE MESSAGE: line 1: message
+CONSOLE MESSAGE: line 1: message
+CONSOLE MESSAGE: line 1: message
+CONSOLE MESSAGE: line 1: [object Object]
+CONSOLE MESSAGE: line 1: [object Object]
+CONSOLE MESSAGE: line 1: groupName
+CONSOLE MESSAGE: groupName
+CONSOLE MESSAGE: line 1: collapsedGroupName
+CONSOLE MESSAGE: collapsedGroupName
+
+STEP: console.log('console.log')
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;console.log&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 12,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;console.log&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;console.log&quot;
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.warn('console.warn')
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;warning&quot;,
+  &quot;_messageText&quot;: &quot;console.warn&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 13,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;console.warn&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;console.warn&quot;
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.error('console.error')
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;error&quot;,
+  &quot;_messageText&quot;: &quot;console.error&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 14,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;console.error&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;console.error&quot;
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.debug('console.debug')
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;debug&quot;,
+  &quot;_messageText&quot;: &quot;console.debug&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 14,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;console.debug&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;console.debug&quot;
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.info('console.info')
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;console.info&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 13,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;console.info&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;console.info&quot;
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.assert(false, 'assertion message')
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;error&quot;,
+  &quot;_messageText&quot;: &quot;assertion message&quot;,
+  &quot;_type&quot;: &quot;assert&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 15,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;assertion message&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;assertion message&quot;
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.trace()
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;&quot;,
+  &quot;_type&quot;: &quot;trace&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 14,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.log('string message', string)
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;string message&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 12,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;string message&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;string message&quot;
+    },
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;string&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;string&quot;
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.log('message', object, object)
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;message&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 12,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;message&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;message&quot;
+    },
+    {
+      &quot;_type&quot;: &quot;object&quot;,
+      &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;_description&quot;: &quot;Object&quot;,
+      &quot;_hasChildren&quot;: true,
+      &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;_entries&quot;: null
+      }
+    },
+    {
+      &quot;_type&quot;: &quot;object&quot;,
+      &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;_description&quot;: &quot;Object&quot;,
+      &quot;_hasChildren&quot;: true,
+      &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;_entries&quot;: null
+      }
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.error('message', object)
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;error&quot;,
+  &quot;_messageText&quot;: &quot;message&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 14,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;message&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;message&quot;
+    },
+    {
+      &quot;_type&quot;: &quot;object&quot;,
+      &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;_description&quot;: &quot;Object&quot;,
+      &quot;_hasChildren&quot;: true,
+      &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;_entries&quot;: null
+      }
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.warn('message', object)
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;warning&quot;,
+  &quot;_messageText&quot;: &quot;message&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 13,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;message&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;message&quot;
+    },
+    {
+      &quot;_type&quot;: &quot;object&quot;,
+      &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;_description&quot;: &quot;Object&quot;,
+      &quot;_hasChildren&quot;: true,
+      &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;_entries&quot;: null
+      }
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.debug('message', object)
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;debug&quot;,
+  &quot;_messageText&quot;: &quot;message&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 14,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;message&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;message&quot;
+    },
+    {
+      &quot;_type&quot;: &quot;object&quot;,
+      &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;_description&quot;: &quot;Object&quot;,
+      &quot;_hasChildren&quot;: true,
+      &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;_entries&quot;: null
+      }
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.info('message', object)
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;message&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 13,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;message&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;message&quot;
+    },
+    {
+      &quot;_type&quot;: &quot;object&quot;,
+      &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;_description&quot;: &quot;Object&quot;,
+      &quot;_hasChildren&quot;: true,
+      &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;_entries&quot;: null
+      }
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.dir(object)
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;[object Object]&quot;,
+  &quot;_type&quot;: &quot;dir&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 12,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;object&quot;,
+      &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;_description&quot;: &quot;Object&quot;,
+      &quot;_hasChildren&quot;: true,
+      &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;_entries&quot;: null
+      }
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.dirxml(object)
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;[object Object]&quot;,
+  &quot;_type&quot;: &quot;dirxml&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 15,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;object&quot;,
+      &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;_description&quot;: &quot;Object&quot;,
+      &quot;_hasChildren&quot;: true,
+      &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;_entries&quot;: null
+      }
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.group('groupName')
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;groupName&quot;,
+  &quot;_type&quot;: &quot;startGroup&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 14,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;groupName&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;groupName&quot;
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.groupEnd('groupName')
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;groupName&quot;,
+  &quot;_type&quot;: &quot;endGroup&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 0,
+  &quot;_column&quot;: 0,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;groupName&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;groupName&quot;
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.groupCollapsed('collapsedGroupName')
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;collapsedGroupName&quot;,
+  &quot;_type&quot;: &quot;startGroupCollapsed&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 23,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;collapsedGroupName&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;collapsedGroupName&quot;
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.groupEnd('collapsedGroupName')
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;log&quot;,
+  &quot;_messageText&quot;: &quot;collapsedGroupName&quot;,
+  &quot;_type&quot;: &quot;endGroup&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 0,
+  &quot;_column&quot;: 0,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_parameters&quot;: [
+    {
+      &quot;_type&quot;: &quot;string&quot;,
+      &quot;_description&quot;: &quot;collapsedGroupName&quot;,
+      &quot;_hasChildren&quot;: false,
+      &quot;_value&quot;: &quot;collapsedGroupName&quot;
+    }
+  ],
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
+STEP: console.count()
+{
+  &quot;_source&quot;: &quot;console-api&quot;,
+  &quot;_level&quot;: &quot;debug&quot;,
+  &quot;_messageText&quot;: &quot;: 1&quot;,
+  &quot;_type&quot;: &quot;log&quot;,
+  &quot;_url&quot;: null,
+  &quot;_line&quot;: 1,
+  &quot;_column&quot;: 14,
+  &quot;_repeatCount&quot;: 1,
+  &quot;_stackTrace&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_request&quot;: null
+}
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorconsoleconsoleapihtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/console/console-api.html (0 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/console/console-api.html                                (rev 0)
+++ trunk/LayoutTests/inspector/console/console-api.html        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+var string = &quot;string&quot;;
+var object = {a:1};
+
+function test()
+{
+    var currentStepIndex = 0;
+    var steps = [
+        &quot;console.log('console.log')&quot;,
+        &quot;console.warn('console.warn')&quot;,
+        &quot;console.error('console.error')&quot;,
+        &quot;console.debug('console.debug')&quot;,
+        &quot;console.info('console.info')&quot;,
+        &quot;console.assert(false, 'assertion message')&quot;,
+        &quot;console.trace()&quot;,
+        &quot;console.log('string message', string)&quot;,
+        &quot;console.log('message', object, object)&quot;,
+        &quot;console.error('message', object)&quot;,
+        &quot;console.warn('message', object)&quot;,
+        &quot;console.debug('message', object)&quot;,
+        &quot;console.info('message', object)&quot;,
+        &quot;console.dir(object)&quot;,
+        &quot;console.dirxml(object)&quot;,
+        &quot;console.group('groupName')&quot;,
+        &quot;console.groupEnd('groupName')&quot;,
+        &quot;console.groupCollapsed('collapsedGroupName')&quot;,
+        &quot;console.groupEnd('collapsedGroupName')&quot;,
+        &quot;console.count()&quot;,
+    ];
+
+    function remoteObjectJSONFilter(key, value)
+    {
+        if (key === &quot;_objectId&quot; || key === &quot;_stackTrace&quot;)
+            return &quot;&lt;filtered&gt;&quot;;
+
+        return value;
+    }
+
+    WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+        var message = event.data.message;
+        InspectorTest.assert(message instanceof WebInspector.ConsoleMessage);
+        InspectorTest.log(&quot;\nSTEP: &quot; + steps[currentStepIndex]);
+        InspectorTest.log(JSON.stringify(message, remoteObjectJSONFilter, &quot;  &quot;));
+
+        if (++currentStepIndex &gt;= steps.length)
+            InspectorTest.completeTest();
+    });
+
+    for (var step of steps)
+        WebInspector.runtimeManager.evaluateInInspectedWindow(step, &quot;test&quot;, false, true, false, true, false, function(){});
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest();&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -1,5 +1,167 @@
</span><span class="cx"> 2015-04-08  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Web Inspector: Split ConsoleMessageImpl into the View and the Model
+        https://bugs.webkit.org/show_bug.cgi?id=142599
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Models/ConsoleMessage.js: Added.
+        (WebInspector.ConsoleMessage):
+        (WebInspector.ConsoleMessage.prototype.get source):
+        (WebInspector.ConsoleMessage.prototype.get level):
+        (WebInspector.ConsoleMessage.prototype.get messageText):
+        (WebInspector.ConsoleMessage.prototype.get type):
+        (WebInspector.ConsoleMessage.prototype.get url):
+        (WebInspector.ConsoleMessage.prototype.get line):
+        (WebInspector.ConsoleMessage.prototype.get column):
+        (WebInspector.ConsoleMessage.prototype.get repeatCount):
+        (WebInspector.ConsoleMessage.prototype.get parameters):
+        (WebInspector.ConsoleMessage.prototype.get stackTrace):
+        (WebInspector.ConsoleMessage.prototype.get request):
+        New readonly model object for console messages.
+
+        * UserInterface/Main.html:
+        * UserInterface/Test.html:
+        * UserInterface/Base/Test.js:
+        (WebInspector.loaded):
+        Load the new files in the main / test page.
+
+        * UserInterface/Views/LegacyConsoleMessage.js: Removed.
+        * UserInterface/Views/LegacyConsoleMessageImpl.js: Removed.
+        Remove Legacy versions.
+
+        * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
+        * UserInterface/Controllers/JavaScriptLogViewController.js:
+        (WebInspector.JavaScriptLogViewController):
+        (WebInspector.JavaScriptLogViewController.prototype.startNewSession):
+        (WebInspector.JavaScriptLogViewController.prototype.appendImmediateExecutionWithResult.saveResultCallback):
+        (WebInspector.JavaScriptLogViewController.prototype.appendImmediateExecutionWithResult):
+        (WebInspector.JavaScriptLogViewController.prototype.appendConsoleMessage):
+        (WebInspector.JavaScriptLogViewController.prototype.updatePreviousMessageRepeatCount):
+        (WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted.printResult):
+        (WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted):
+        (WebInspector.JavaScriptLogViewController.prototype._appendConsoleMessageView):
+        (WebInspector.JavaScriptLogViewController.prototype._appendConsoleMessage): Deleted.
+        Update LogViewController to create ConsoleMessageViews from ConsoleMessages when applicable.
+        Also clarify when we have a view versus model object.
+
+        * UserInterface/Protocol/ConsoleObserver.js:
+        (WebInspector.ConsoleObserver.prototype.messageAdded):
+        * UserInterface/Controllers/LogManager.js:
+        (WebInspector.LogManager.prototype.messageWasAdded):
+        (WebInspector.LogManager.prototype.messagesCleared):
+        (WebInspector.LogManager.prototype._mainResourceDidChange):
+        Create model objects and issue events for the model objects.
+
+        * UserInterface/Models/DefaultDashboard.js:
+        (WebInspector.DefaultDashboard.prototype._consoleMessageAdded):
+        (WebInspector.DefaultDashboard.prototype._incrementConsoleMessageType):
+        Update now that the event gives us a model object.
+
+        * UserInterface/Views/ConsoleMessageView.js: Added.
+        (WebInspector.ConsoleMessageView):
+        (WebInspector.ConsoleMessageView.prototype.get element):
+        (WebInspector.ConsoleMessageView.prototype.get message):
+        (WebInspector.ConsoleMessageView.prototype.get repeatCount):
+        (WebInspector.ConsoleMessageView.prototype.set repeatCount):
+        (WebInspector.ConsoleMessageView.prototype.toClipboardString):
+        (WebInspector.ConsoleMessageView.prototype._appendMessageTextAndArguments):
+        (WebInspector.ConsoleMessageView.prototype._appendSavedResultIndex):
+        (WebInspector.ConsoleMessageView.prototype._appendLocationLink):
+        (WebInspector.ConsoleMessageView.prototype._appendParameters):
+        (WebInspector.ConsoleMessageView.prototype._appendStackTrace):
+        (WebInspector.ConsoleMessageView.prototype._appendFormattedArguments):
+        (WebInspector.ConsoleMessageView.prototype._formatParameter):
+        (WebInspector.ConsoleMessageView.prototype._formatParameterAsValue):
+        (WebInspector.ConsoleMessageView.prototype._formatParameterAsString):
+        (WebInspector.ConsoleMessageView.prototype._formatParameterAsNode):
+        (WebInspector.ConsoleMessageView.prototype._formatParameterAsObject):
+        (WebInspector.ConsoleMessageView.prototype._formatParameterAsArray):
+        (WebInspector.ConsoleMessageView.prototype._rootPropertyPathForObject):
+        (WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.parameterFormatter):
+        (WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.stringFormatter):
+        (WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.floatFormatter):
+        (WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.integerFormatter):
+        (WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.styleFormatter):
+        (WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.isWhitelistedProperty):
+        (WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.append):
+        (WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString):
+        (WebInspector.ConsoleMessageView.prototype._shouldShowStackTrace):
+        (WebInspector.ConsoleMessageView.prototype._shouldHideURL):
+        (WebInspector.ConsoleMessageView.prototype._firstNonNativeCallFrame):
+        (WebInspector.ConsoleMessageView.prototype._linkifyLocation):
+        (WebInspector.ConsoleMessageView.prototype._linkifyCallFrame):
+        (WebInspector.ConsoleMessageView.prototype._userProvidedColumnNames):
+        (WebInspector.ConsoleMessageView.prototype._formatParameterAsTable):
+        (WebInspector.ConsoleMessageView.prototype._levelString):
+        (WebInspector.ConsoleMessageView.prototype._enforcesClipboardPrefixString):
+        (WebInspector.ConsoleMessageView.prototype._clipboardPrefixString):
+        New View class for a ConsoleMessage. This is a near direct port of the old code
+        to a view class that has a root element.
+
+        * UserInterface/Models/ConsoleCommandResultMessage.js: Renamed from Source/WebInspectorUI/UserInterface/Views/ConsoleCommandResult.js.
+        (WebInspector.ConsoleCommandResultMessage):
+        (WebInspector.ConsoleCommandResultMessage.clearMaximumSavedResultIndex):
+        (WebInspector.ConsoleCommandResultMessage.prototype.get savedResultIndex):
+        Rename, as this is a ConsoleMessage subclass with a specific type for console evaluation results.
+
+        * UserInterface/Views/ConsoleCommandView.js: Renamed from Source/WebInspectorUI/UserInterface/Views/ConsoleCommand.js.
+        (WebInspector.ConsoleCommandView):
+        (WebInspector.ConsoleCommandView.prototype.get element):
+        (WebInspector.ConsoleCommandView.prototype.get commandText):
+        (WebInspector.ConsoleCommandView.prototype.get message):
+        (WebInspector.ConsoleCommandView.prototype.toClipboardString):
+        * UserInterface/Views/ConsoleGroup.js:
+        (WebInspector.ConsoleGroup):
+        (WebInspector.ConsoleGroup.prototype.get parentGroup):
+        (WebInspector.ConsoleGroup.prototype.render):
+        (WebInspector.ConsoleGroup.prototype.addMessageView):
+        (WebInspector.ConsoleGroup.prototype.append):
+        (WebInspector.ConsoleGroup.prototype._titleMouseDown):
+        (WebInspector.ConsoleGroup.prototype.addMessage): Deleted.
+        (WebInspector.ConsoleGroup.prototype._titleClicked): Deleted.
+        * UserInterface/Views/ConsoleSession.js:
+        (WebInspector.ConsoleSession):
+        (WebInspector.ConsoleSession.prototype.addMessageView):
+        (WebInspector.ConsoleSession.prototype.append):
+        (WebInspector.ConsoleSession.prototype.addMessage): Deleted.
+        (WebInspector.ConsoleSession.prototype.hasMessages): Deleted.
+        Convert to classes, and clarify these deal with View objects.
+
+        * UserInterface/Views/LogContentView.css:
+        (.console-message .repeat-count):
+        (.console-message .bubble): Deleted.
+        Better class name for the repeat count element.
+
+        * UserInterface/Views/LogContentView.js:
+        (WebInspector.LogContentView.prototype.didAppendConsoleMessageView):
+        (WebInspector.LogContentView.prototype._formatMessagesAsData):
+        (WebInspector.LogContentView.prototype._messageAdded):
+        (WebInspector.LogContentView.prototype._updateMessagesSelection):
+        (WebInspector.LogContentView.prototype._selectAllMessages):
+        (WebInspector.LogContentView.prototype._allMessageElements):
+        (WebInspector.LogContentView.prototype._unfilteredMessageElements):
+        (WebInspector.LogContentView.prototype._visibleMessageElements):
+        (WebInspector.LogContentView.prototype._scopeBarSelectionDidChange):
+        (WebInspector.LogContentView.prototype._filterMessageElements):
+        (WebInspector.LogContentView.prototype._upArrowWasPressed):
+        (WebInspector.LogContentView.prototype._downArrowWasPressed):
+        (WebInspector.LogContentView.prototype._previousMessage):
+        (WebInspector.LogContentView.prototype._nextMessage):
+        (WebInspector.LogContentView.prototype._performSearch):
+        (WebInspector.LogContentView.prototype._highlightRanges):
+        (WebInspector.LogContentView.prototype._reappendProvisionalMessages):
+        (WebInspector.LogContentView.prototype.didAppendConsoleMessage): Deleted.
+        (WebInspector.LogContentView.prototype._allMessages): Deleted.
+        (WebInspector.LogContentView.prototype._unfilteredMessages): Deleted.
+        (WebInspector.LogContentView.prototype._visibleMessages): Deleted.
+        (WebInspector.LogContentView.prototype._filterMessages): Deleted.
+        Rename lots of things to make it clear when we are dealing with
+        elements, model objects, or view objects. This class is still heavily
+        dealing with elements, and needs to be cleaned up later.
+
+2015-04-08  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
</ins><span class="cx">         Fix uncaught exception seen in Inspector.
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Timothy Hatcher.
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseTestjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Test.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Test.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Test.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx">     // The initialization order should match the same in Main.js.
</span><span class="cx">     InspectorBackend.registerInspectorDispatcher(new WebInspector.InspectorObserver);
</span><span class="cx">     InspectorBackend.registerPageDispatcher(new WebInspector.PageObserver);
</span><ins>+    InspectorBackend.registerConsoleDispatcher(new WebInspector.ConsoleObserver);
</ins><span class="cx">     InspectorBackend.registerDOMDispatcher(new WebInspector.DOMObserver);
</span><span class="cx">     InspectorBackend.registerNetworkDispatcher(new WebInspector.NetworkObserver);
</span><span class="cx">     InspectorBackend.registerDebuggerDispatcher(new WebInspector.DebuggerObserver);
</span><span class="lines">@@ -50,6 +51,8 @@
</span><span class="cx">     this.frameResourceManager = new WebInspector.FrameResourceManager;
</span><span class="cx">     this.domTreeManager = new WebInspector.DOMTreeManager;
</span><span class="cx">     this.cssStyleManager = new WebInspector.CSSStyleManager;
</span><ins>+    this.logManager = new WebInspector.LogManager;
+    this.issueManager = new WebInspector.IssueManager;
</ins><span class="cx">     this.runtimeManager = new WebInspector.RuntimeManager;
</span><span class="cx">     this.timelineManager = new WebInspector.TimelineManager;
</span><span class="cx">     this.debuggerManager = new WebInspector.DebuggerManager;
</span><span class="lines">@@ -63,6 +66,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Enable agents.
</span><span class="cx">     InspectorAgent.enable();
</span><ins>+    ConsoleAgent.enable();
</ins><span class="cx"> 
</span><span class="cx">     // Perform one-time tasks.
</span><span class="cx">     WebInspector.CSSCompletions.requestCSSNameCompletions();
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersJavaScriptLogViewControllerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">         this.delegate = delegate;
</span><span class="cx"> 
</span><span class="cx">         this._cleared = true;
</span><del>-        this._previousMessage = null;
</del><ins>+        this._previousMessageView = null;
</ins><span class="cx">         this._repeatCountWasInterrupted = false;
</span><span class="cx"> 
</span><span class="cx">         this._sessions = [];
</span><span class="lines">@@ -106,9 +106,9 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        var consoleSession = new WebInspector.ConsoleSession();
</del><ins>+        var consoleSession = new WebInspector.ConsoleSession;
</ins><span class="cx"> 
</span><del>-        this._previousMessage = null;
</del><ins>+        this._previousMessageView = null;
</ins><span class="cx">         this._repeatCountWasInterrupted = false;
</span><span class="cx"> 
</span><span class="cx">         this._sessions.push(consoleSession);
</span><span class="lines">@@ -124,13 +124,14 @@
</span><span class="cx">     {
</span><span class="cx">         console.assert(result instanceof WebInspector.RemoteObject);
</span><span class="cx"> 
</span><del>-        var commandMessage = new WebInspector.ConsoleCommand(text);
-        this._appendConsoleMessage(commandMessage, true);
</del><ins>+        var commandMessageView = new WebInspector.ConsoleCommandView(text);
+        this._appendConsoleMessageView(commandMessageView, true);
</ins><span class="cx"> 
</span><span class="cx">         function saveResultCallback(savedResultIndex)
</span><span class="cx">         {
</span><del>-            var commandResultMessage = new WebInspector.ConsoleCommandResult(result, false, commandMessage, savedResultIndex);
-            this._appendConsoleMessage(commandResultMessage, true);
</del><ins>+            var commandResultMessage = new WebInspector.ConsoleCommandResultMessage(result, false, savedResultIndex);
+            var commandResultMessageView = new WebInspector.ConsoleMessageView(commandResultMessage);
+            this._appendConsoleMessageView(commandResultMessageView, true);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         WebInspector.runtimeManager.saveResult(result, saveResultCallback.bind(this));
</span><span class="lines">@@ -138,36 +139,30 @@
</span><span class="cx"> 
</span><span class="cx">     appendConsoleMessage(consoleMessage)
</span><span class="cx">     {
</span><del>-        // Clone the message since there might be multiple clients using the message,
-        // and since the message has a DOM element it can't be two places at once.
-        var messageClone = consoleMessage.clone();
-
-        this._appendConsoleMessage(messageClone);
-
-        return messageClone;
</del><ins>+        var consoleMessageView = new WebInspector.ConsoleMessageView(consoleMessage);
+        this._appendConsoleMessageView(consoleMessageView);
+        return consoleMessageView;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     updatePreviousMessageRepeatCount(count)
</span><span class="cx">     {
</span><del>-        console.assert(this._previousMessage);
-        if (!this._previousMessage)
</del><ins>+        console.assert(this._previousMessageView);
+        if (!this._previousMessageView)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        if (!this._repeatCountWasInterrupted) {
-            this._previousMessage.repeatCount = count - (this._previousMessage.ignoredCount || 0);
-            this._previousMessage.updateRepeatCount();
-        } else {
-            var newMessage = this._previousMessage.clone();
</del><ins>+        var previousIgnoredCount = this._previousMessageView[WebInspector.JavaScriptLogViewController.IgnoredRepeatCount] || 0;
+        var previousVisibleCount = this._previousMessageView.repeatCount;
</ins><span class="cx"> 
</span><del>-            // If this message is repeated after being cloned, messageRepeatCountUpdated will be called with a
-            // count that includes the count of this message before cloning. We should ignore instances of this
-            // log that occurred before we cloned, so set a property on the message with the number of previous
-            // instances of this log that we should ignore.
-            newMessage.ignoredCount = newMessage.repeatCount + (this._previousMessage.ignoredCount || 0);
-            newMessage.repeatCount = 1;
-
-            this._appendConsoleMessage(newMessage);
</del><ins>+        if (!this._repeatCountWasInterrupted) {
+            this._previousMessageView.repeatCount = count - previousIgnoredCount;
+            return;
</ins><span class="cx">         }
</span><ins>+
+        var consoleMessage = this._previousMessageView.message;
+        var duplicatedConsoleMessageView = new WebInspector.ConsoleMessageView(consoleMessage);
+        duplicatedConsoleMessageView[WebInspector.JavaScriptLogViewController.IgnoredRepeatCount] = previousIgnoredCount + previousVisibleCount;
+        duplicatedConsoleMessageView.repeatCount = 1;
+        this._appendConsoleMessageView(duplicatedConsoleMessageView);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     isScrolledToBottom()
</span><span class="lines">@@ -225,15 +220,17 @@
</span><span class="cx">     {
</span><span class="cx">         console.assert(text);
</span><span class="cx"> 
</span><del>-        var commandMessage = new WebInspector.ConsoleCommand(text);
-        this._appendConsoleMessage(commandMessage, true);
</del><ins>+        var commandMessageView = new WebInspector.ConsoleCommandView(text);
+        this._appendConsoleMessageView(commandMessageView, true);
</ins><span class="cx"> 
</span><span class="cx">         function printResult(result, wasThrown, savedResultIndex)
</span><span class="cx">         {
</span><span class="cx">             if (!result || this._cleared)
</span><span class="cx">                 return;
</span><span class="cx"> 
</span><del>-            this._appendConsoleMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, commandMessage, savedResultIndex), true);
</del><ins>+            var commandResultMessage = new WebInspector.ConsoleCommandResultMessage(result, wasThrown, savedResultIndex);
+            var commandResultMessageView = new WebInspector.ConsoleMessageView(commandResultMessage);
+            this._appendConsoleMessageView(commandResultMessageView, true);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         text += &quot;\n//# sourceURL=__WebInspectorConsole__\n&quot;;
</span><span class="lines">@@ -263,7 +260,7 @@
</span><span class="cx">         this.delegate.highlightPreviousSearchMatch();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    _appendConsoleMessage(msg, repeatCountWasInterrupted)
</del><ins>+    _appendConsoleMessageView(messageView, repeatCountWasInterrupted)
</ins><span class="cx">     {
</span><span class="cx">         var wasScrolledToBottom = this.isScrolledToBottom();
</span><span class="cx"> 
</span><span class="lines">@@ -271,28 +268,30 @@
</span><span class="cx">         this._repeatCountWasInterrupted = repeatCountWasInterrupted || false;
</span><span class="cx"> 
</span><span class="cx">         if (!repeatCountWasInterrupted)
</span><del>-            this._previousMessage = msg;
</del><ins>+            this._previousMessageView = messageView;
</ins><span class="cx"> 
</span><del>-        if (msg.type === WebInspector.LegacyConsoleMessage.MessageType.EndGroup) {
</del><ins>+        var type = messageView instanceof WebInspector.ConsoleCommandView ? null : messageView.message.type;
+        if (type === WebInspector.ConsoleMessage.MessageType.EndGroup) {
</ins><span class="cx">             var parentGroup = this._currentConsoleGroup.parentGroup;
</span><span class="cx">             if (parentGroup)
</span><span class="cx">                 this._currentConsoleGroup = parentGroup;
</span><span class="cx">         } else {
</span><del>-            if (msg.type === WebInspector.LegacyConsoleMessage.MessageType.StartGroup || msg.type === WebInspector.LegacyConsoleMessage.MessageType.StartGroupCollapsed) {
</del><ins>+            if (type === WebInspector.ConsoleMessage.MessageType.StartGroup || type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) {
</ins><span class="cx">                 var group = new WebInspector.ConsoleGroup(this._currentConsoleGroup);
</span><del>-                var groupElement = group.render(msg);
</del><ins>+                var groupElement = group.render(messageView);
</ins><span class="cx">                 this._currentConsoleGroup.append(groupElement);
</span><span class="cx">                 this._currentConsoleGroup = group;
</span><span class="cx">             } else
</span><del>-                this._currentConsoleGroup.addMessage(msg);
</del><ins>+                this._currentConsoleGroup.addMessageView(messageView);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (msg.type === WebInspector.LegacyConsoleMessage.MessageType.Result || wasScrolledToBottom)
</del><ins>+        if (type === WebInspector.ConsoleMessage.MessageType.Result || wasScrolledToBottom)
</ins><span class="cx">             this.scrollToBottom();
</span><span class="cx"> 
</span><del>-        if (this.delegate &amp;&amp; typeof this.delegate.didAppendConsoleMessage === &quot;function&quot;)
-            this.delegate.didAppendConsoleMessage(msg);
</del><ins>+        if (this.delegate &amp;&amp; typeof this.delegate.didAppendConsoleMessageView === &quot;function&quot;)
+            this.delegate.didAppendConsoleMessageView(messageView);
</ins><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.JavaScriptLogViewController.CachedPropertiesDuration = 30000;
</span><ins>+WebInspector.JavaScriptLogViewController.IgnoredRepeatCount = Symbol(&quot;ignored-repeat-count&quot;);
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersJavaScriptRuntimeCompletionProviderjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -180,7 +180,7 @@
</span><span class="cx">                     propertyNames[commandLineAPI[i]] = true;
</span><span class="cx"> 
</span><span class="cx">                 // FIXME: Due to caching, sometimes old $n values show up as completion results even though they are not available. We should clear that proactively.
</span><del>-                for (var i = 1; i &lt;= WebInspector.ConsoleCommandResult.maximumSavedResultIndex; ++i)
</del><ins>+                for (var i = 1; i &lt;= WebInspector.ConsoleCommandResultMessage.maximumSavedResultIndex; ++i)
</ins><span class="cx">                     propertyNames[&quot;$&quot; + i] = true;
</span><span class="cx">             }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersLogManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -38,19 +38,21 @@
</span><span class="cx">     {
</span><span class="cx">         // Called from WebInspector.ConsoleObserver.
</span><span class="cx"> 
</span><del>-        // FIXME: Pass a request. We need a way to get it from the request ID.
-        var consoleMessage = WebInspector.LegacyConsoleMessage.create(source, level, text, type, url, line, column, repeatCount, parameters, stackTrace, null);
</del><ins>+        // FIXME: stackTrace should be converted to a model object.
+        // FIXME: Get a request from request ID.
</ins><span class="cx"> 
</span><del>-        this.dispatchEventToListeners(WebInspector.LogManager.Event.MessageAdded, {message: consoleMessage});
</del><ins>+        if (parameters)
+            parameters = parameters.map(function(x) { return WebInspector.RemoteObject.fromPayload(x); });
</ins><span class="cx"> 
</span><del>-        console.assert(!consoleMessage._element || !consoleMessage._element.parentNode, &quot;This console message shouldn't be added to a view. To add it you need to use clone().&quot;);
</del><ins>+        var message = new WebInspector.ConsoleMessage(source, level, text, type, url, line, column, repeatCount, parameters, stackTrace, null);
+        this.dispatchEventToListeners(WebInspector.LogManager.Event.MessageAdded, {message});
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     messagesCleared()
</span><span class="cx">     {
</span><span class="cx">         // Called from WebInspector.ConsoleObserver.
</span><span class="cx"> 
</span><del>-        WebInspector.ConsoleCommandResult.clearMaximumSavedResultIndex();
</del><ins>+        WebInspector.ConsoleCommandResultMessage.clearMaximumSavedResultIndex();
</ins><span class="cx"> 
</span><span class="cx">         // We don't want to clear messages on reloads. We can't determine that easily right now.
</span><span class="cx">         // FIXME: &lt;rdar://problem/13767079&gt; Console.messagesCleared should include a reason
</span><span class="lines">@@ -90,7 +92,7 @@
</span><span class="cx">         else
</span><span class="cx">             this.dispatchEventToListeners(WebInspector.LogManager.Event.SessionStarted);
</span><span class="cx"> 
</span><del>-        WebInspector.ConsoleCommandResult.clearMaximumSavedResultIndex();
</del><ins>+        WebInspector.ConsoleCommandResultMessage.clearMaximumSavedResultIndex();
</ins><span class="cx"> 
</span><span class="cx">         delete this._shouldClearMessages;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -207,6 +207,7 @@
</span><span class="cx">     &lt;script src=&quot;Protocol/TimelineObserver.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Models/BreakpointAction.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/ConsoleMessage.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/SourceCode.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/SourceCodeLocation.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/Timeline.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -230,6 +231,7 @@
</span><span class="cx">     &lt;script src=&quot;Models/CollectionEntry.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/CollectionEntryPreview.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/Color.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/ConsoleCommandResultMessage.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/ContentFlow.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/CookieStorageObject.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/DOMNode.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -295,7 +297,8 @@
</span><span class="cx">     &lt;script src=&quot;Models/TypeSet.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/UnitBezier.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> 
</span><del>-    &lt;script src=&quot;Views/LegacyConsoleMessage.js&quot;&gt;&lt;/script&gt;
</del><ins>+    &lt;script src=&quot;Views/ConsoleCommandView.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;Views/ConsoleMessageView.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Views/ContentView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/DataGrid.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/DetailsSectionRow.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -310,7 +313,6 @@
</span><span class="cx">     &lt;script src=&quot;Views/TreeOutline.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Views/ButtonNavigationItem.js&quot;&gt;&lt;/script&gt;
</span><del>-    &lt;script src=&quot;Views/LegacyConsoleMessageImpl.js&quot;&gt;&lt;/script&gt;
</del><span class="cx">     &lt;script src=&quot;Views/DOMTreeContentView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/DetailsSidebarPanel.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/GeneralTreeElement.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -351,8 +353,6 @@
</span><span class="cx">     &lt;script src=&quot;Views/ColorWheel.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/CompletionSuggestionsView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/ComputedStyleDetailsPanel.js&quot;&gt;&lt;/script&gt;
</span><del>-    &lt;script src=&quot;Views/ConsoleCommand.js&quot;&gt;&lt;/script&gt;
-    &lt;script src=&quot;Views/ConsoleCommandResult.js&quot;&gt;&lt;/script&gt;
</del><span class="cx">     &lt;script src=&quot;Views/ConsoleGroup.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/ConsolePrompt.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/ConsoleSession.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsConsoleCommandResultMessagejsfromrev182578trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandResultjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleCommandResultMessage.js (from rev 182578, trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandResult.js) (0 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleCommandResultMessage.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleCommandResultMessage.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008, 2013 Apple Inc.  All rights reserved.
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 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.ConsoleCommandResultMessage = class ConsoleCommandResult extends WebInspector.ConsoleMessage
+{
+    constructor(result, wasThrown, savedResultIndex)
+    {
+        var source = WebInspector.ConsoleMessage.MessageSource.JS;
+        var level = (wasThrown ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
+        var type = WebInspector.ConsoleMessage.MessageType.Result;
+
+        super(source, level, &quot;&quot;, type, undefined, undefined, undefined, 0, [result], undefined, undefined);
+
+        this._savedResultIndex = savedResultIndex;
+
+        if (this._savedResultIndex &amp;&amp; this._savedResultIndex &gt; WebInspector.ConsoleCommandResultMessage.maximumSavedResultIndex)
+            WebInspector.ConsoleCommandResultMessage.maximumSavedResultIndex = this._savedResultIndex;
+    }
+
+    // Static
+
+    static clearMaximumSavedResultIndex()
+    {
+        WebInspector.ConsoleCommandResultMessage.maximumSavedResultIndex = 0;
+    }
+
+    // Public
+
+    get savedResultIndex()
+    {
+        return this._savedResultIndex;
+    }
+};
+
+WebInspector.ConsoleCommandResultMessage.maximumSavedResultIndex = 0;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsConsoleMessagejs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js (0 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -0,0 +1,145 @@
</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.ConsoleMessage = class ConsoleMessage extends WebInspector.Object
+{
+    constructor(source, level, message, type, url, line, column, repeatCount, parameters, stackTrace, request)
+    {
+        super();
+
+        console.assert(typeof source === &quot;string&quot;);
+        console.assert(typeof level === &quot;string&quot;);
+        console.assert(typeof message === &quot;string&quot;);
+        console.assert(!parameters || parameters.every(function(x) { return x instanceof WebInspector.RemoteObject; }));
+
+        this._source = source;
+        this._level = level;
+        this._messageText = message;
+        this._type = type || WebInspector.ConsoleMessage.MessageType.Log;
+        this._url = url || null;
+        this._line = line || 0;
+        this._column = column || 0;
+
+        this._repeatCount = repeatCount || 0;
+        this._parameters = parameters;
+        this._stackTrace = stackTrace;
+        this._request = request;
+    }
+
+    // Public
+
+    get source()
+    {
+        return this._source;
+    }
+
+    get level()
+    {
+        return this._level;
+    }
+
+    get messageText()
+    {
+        return this._messageText;
+    }
+
+    get type()
+    {
+        return this._type;
+    }
+
+    get url()
+    {
+        return this._url;
+    }
+
+    get line()
+    {
+        return this._line;
+    }
+
+    get column()
+    {
+        return this._column;
+    }
+
+    get repeatCount()
+    {
+        return this._repeatCount;
+    }
+
+    get parameters()
+    {
+        return this._parameters;
+    }
+
+    get stackTrace()
+    {
+        return this._stackTrace;
+    }
+
+    get request()
+    {
+        return this._request;
+    }
+};
+
+WebInspector.ConsoleMessage.MessageSource = {
+    HTML: &quot;html&quot;,
+    XML: &quot;xml&quot;,
+    JS: &quot;javascript&quot;,
+    Network: &quot;network&quot;,
+    ConsoleAPI: &quot;console-api&quot;,
+    Storage: &quot;storage&quot;,
+    Appcache: &quot;appcache&quot;,
+    Rendering: &quot;rendering&quot;,
+    CSS: &quot;css&quot;,
+    Security: &quot;security&quot;,
+    Other: &quot;other&quot;,
+};
+
+WebInspector.ConsoleMessage.MessageType = {
+    Log: &quot;log&quot;,
+    Dir: &quot;dir&quot;,
+    DirXML: &quot;dirxml&quot;,
+    Table: &quot;table&quot;,
+    Trace: &quot;trace&quot;,
+    StartGroup: &quot;startGroup&quot;,
+    StartGroupCollapsed: &quot;startGroupCollapsed&quot;,
+    EndGroup: &quot;endGroup&quot;,
+    Assert: &quot;assert&quot;,
+    Timing: &quot;timing&quot;,
+    Profile: &quot;profile&quot;,
+    ProfileEnd: &quot;profileEnd&quot;,
+    Result: &quot;result&quot;, // Frontend Only.
+};
+
+WebInspector.ConsoleMessage.MessageLevel = {
+    Tip: &quot;tip&quot;, // COMPATIBILITY (iOS 6)
+    Log: &quot;log&quot;,
+    Warning: &quot;warning&quot;,
+    Error: &quot;error&quot;,
+    Debug: &quot;debug&quot;,
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDefaultDashboardjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DefaultDashboard.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DefaultDashboard.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DefaultDashboard.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -233,7 +233,7 @@
</span><span class="cx">     {
</span><span class="cx">         var message = event.data.message;
</span><span class="cx">         this._lastConsoleMessageType = message.level;
</span><del>-        this._incrementConsoleMessageType(message.level, message.totalRepeatCount);
</del><ins>+        this._incrementConsoleMessageType(message.level, message.repeatCount);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     _consoleMessageWasRepeated(event)
</span><span class="lines">@@ -244,13 +244,13 @@
</span><span class="cx">     _incrementConsoleMessageType(type, increment)
</span><span class="cx">     {
</span><span class="cx">         switch (type) {
</span><del>-        case WebInspector.LegacyConsoleMessage.MessageLevel.Log:
</del><ins>+        case WebInspector.ConsoleMessage.MessageLevel.Log:
</ins><span class="cx">             this.logs += increment;
</span><span class="cx">             break;
</span><del>-        case WebInspector.LegacyConsoleMessage.MessageLevel.Warning:
</del><ins>+        case WebInspector.ConsoleMessage.MessageLevel.Warning:
</ins><span class="cx">             this.issues += increment;
</span><span class="cx">             break;
</span><del>-        case WebInspector.LegacyConsoleMessage.MessageLevel.Error:
</del><ins>+        case WebInspector.ConsoleMessage.MessageLevel.Error:
</ins><span class="cx">             this.errors += increment;
</span><span class="cx">             break;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolConsoleObserverjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/ConsoleObserver.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/ConsoleObserver.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/ConsoleObserver.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -29,6 +29,8 @@
</span><span class="cx"> 
</span><span class="cx">     messageAdded(message)
</span><span class="cx">     {
</span><ins>+        // FIXME: We should convert &quot;Tip&quot; to &quot;Log&quot; here immediately.
+
</ins><span class="cx">         if (message.type === &quot;assert&quot; &amp;&amp; !message.text)
</span><span class="cx">             message.text = WebInspector.UIString(&quot;Assertion&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTesthtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Test.html (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Test.html        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Test.html        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Protocol/InspectorObserver.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Protocol/CSSObserver.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Protocol/ConsoleObserver.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Protocol/DOMObserver.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Protocol/DOMStorageObserver.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Protocol/DebuggerObserver.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -61,6 +62,7 @@
</span><span class="cx">     &lt;script src=&quot;Protocol/TimelineObserver.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Models/BreakpointAction.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/ConsoleMessage.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/SourceCode.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/SourceCodeLocation.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/Timeline.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -90,6 +92,7 @@
</span><span class="cx">     &lt;script src=&quot;Models/IndexedDatabase.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/IndexedDatabaseObjectStore.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/IndexedDatabaseObjectStoreIndex.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/IssueMessage.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/LayoutTimelineRecord.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/LazySourceCodeLocation.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/NetworkTimeline.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -127,6 +130,8 @@
</span><span class="cx">     &lt;script src=&quot;Controllers/DOMTreeManager.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Controllers/DebuggerManager.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Controllers/FrameResourceManager.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Controllers/IssueManager.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;Controllers/LogManager.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Controllers/ProbeManager.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Controllers/ReplayManager.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Controllers/RuntimeManager.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommand.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommand.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommand.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -1,82 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2013 Apple Inc.  All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 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.ConsoleCommand = function(command)
-{
-    // FIXME: Convert this to a WebInspector.Object subclass, and call super().
-    // WebInspector.Object.call(this);
-
-    this.command = command;
-};
-
-WebInspector.ConsoleCommand.prototype = {
-    constructor: WebInspector.ConsoleCommand,
-
-    // Public
-
-    decorateMessageElement: function(element) {
-        if (this._element)
-            return this._element;
-
-        this._element = element;
-        this._element.command = this;
-        this._element.classList.add(&quot;console-user-command&quot;);
-        this._element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Input: &quot;));
-
-        this._formatCommand();
-        this._element.appendChild(this._formattedCommand);
-
-        return this._element;
-    },
-
-    toMessageElement: function()
-    {
-        if (this._element)
-            return this._element;
-
-        var element = document.createElement(&quot;div&quot;);
-        return this.decorateMessageElement(element);
-    },
-
-    // Private
-
-    _formatCommand: function()
-    {
-        this._formattedCommand = document.createElement(&quot;span&quot;);
-        this._formattedCommand.className = &quot;console-message-text source-code&quot;;
-        this._formattedCommand.textContent = this.command;
-    },
-
-    toClipboardString: function(isPrefixOptional)
-    {
-        return (isPrefixOptional ? &quot;&quot; : &quot;&gt; &quot;) + this.command;
-    }
-};
-
-WebInspector.ConsoleCommand.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandResultjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandResult.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandResult.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandResult.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -1,71 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2013 Apple Inc.  All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 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.ConsoleCommandResult = function(result, wasThrown, originatingCommand, savedResultIndex)
-{
-    var level = (wasThrown ? WebInspector.LegacyConsoleMessage.MessageLevel.Error : WebInspector.LegacyConsoleMessage.MessageLevel.Log);
-    this.originatingCommand = originatingCommand;
-    this.savedResultIndex = savedResultIndex;
-
-    if (this.savedResultIndex &amp;&amp; this.savedResultIndex &gt; WebInspector.ConsoleCommandResult.maximumSavedResultIndex)
-        WebInspector.ConsoleCommandResult.maximumSavedResultIndex = this.savedResultIndex;
-
-    WebInspector.LegacyConsoleMessageImpl.call(this, WebInspector.LegacyConsoleMessage.MessageSource.JS, level, &quot;&quot;, null, WebInspector.LegacyConsoleMessage.MessageType.Result, undefined, undefined, undefined, undefined, [result]);
-};
-
-WebInspector.ConsoleCommandResult.maximumSavedResultIndex = 0;
-
-WebInspector.ConsoleCommandResult.clearMaximumSavedResultIndex = function()
-{
-    WebInspector.ConsoleCommandResult.maximumSavedResultIndex = 0;
-}
-
-WebInspector.ConsoleCommandResult.prototype = {
-    constructor: WebInspector.ConsoleCommandResult,
-
-    // Public
-
-    enforcesClipboardPrefixString: false,
-
-    toMessageElement: function()
-    {
-        var element = WebInspector.LegacyConsoleMessageImpl.prototype.toMessageElement.call(this);
-        element.classList.add(&quot;console-user-command-result&quot;);
-        if (!element.getAttribute(&quot;data-labelprefix&quot;))
-            element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Output: &quot;));
-        return element;
-    },
-
-    get clipboardPrefixString()
-    {
-        return &quot;&lt; &quot;;
-    }
-};
-
-WebInspector.ConsoleCommandResult.prototype.__proto__ = WebInspector.LegacyConsoleMessageImpl.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandViewjsfromrev182578trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js (from rev 182578, trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommand.js) (0 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008, 2013 Apple Inc.  All rights reserved.
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 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.ConsoleCommandView = class ConsoleCommandView extends WebInspector.Object
+{
+    constructor(commandText)
+    {
+        super();
+
+        this._commandText = commandText;
+
+        this._element = document.createElement(&quot;div&quot;);
+        this._element.classList.add(&quot;console-user-command&quot;);
+        this._element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Input: &quot;));
+
+        this._formattedCommandElement = this._element.appendChild(document.createElement(&quot;span&quot;));
+        this._formattedCommandElement.classList.add(&quot;console-message-text&quot;);
+        this._formattedCommandElement.textContent = this._commandText;
+
+        // FIXME: &lt;https://webkit.org/b/143545&gt; Web Inspector: LogContentView should use higher level objects
+        this._element.__commandView = this;
+    }
+
+    // Public
+
+    get element()
+    {
+        return this._element;
+    }
+
+    get commandText()
+    {
+        return this._commandText;
+    }
+
+    toClipboardString(isPrefixOptional)
+    {
+        return (isPrefixOptional ? &quot;&quot; : &quot;&gt; &quot;) + this._commandText;
+    }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleGroupjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleGroup.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleGroup.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleGroup.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -27,31 +27,35 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-WebInspector.ConsoleGroup = function(parentGroup)
</del><ins>+WebInspector.ConsoleGroup = class ConsoleGroup extends WebInspector.Object
</ins><span class="cx"> {
</span><del>-    // FIXME: Convert this to a WebInspector.Object subclass, and call super().
-    // WebInspector.Object.call(this);
</del><ins>+    constructor(parentGroup)
+    {
+        super();
</ins><span class="cx"> 
</span><del>-    this.parentGroup = parentGroup;
-};
</del><ins>+        this._parentGroup = parentGroup;
+    }
</ins><span class="cx"> 
</span><del>-WebInspector.ConsoleGroup.prototype = {
-    constructor: WebInspector.ConsoleGroup,
-
</del><span class="cx">     // Public
</span><span class="cx"> 
</span><del>-    render: function(message)
</del><ins>+    get parentGroup()
</ins><span class="cx">     {
</span><ins>+        return this._parentGroup;
+    }
+
+    render(messageView)
+    {
</ins><span class="cx">         var groupElement = document.createElement(&quot;div&quot;);
</span><span class="cx">         groupElement.className = &quot;console-group&quot;;
</span><span class="cx">         groupElement.group = this;
</span><span class="cx">         this.element = groupElement;
</span><span class="cx"> 
</span><del>-        var titleElement = message.toMessageElement();
</del><ins>+        var titleElement = messageView.element;
</ins><span class="cx">         titleElement.classList.add(WebInspector.LogContentView.ItemWrapperStyleClassName);
</span><span class="cx">         titleElement.addEventListener(&quot;click&quot;, this._titleClicked.bind(this));
</span><span class="cx">         titleElement.addEventListener(&quot;mousedown&quot;, this._titleMouseDown.bind(this));
</span><del>-        if (groupElement &amp;&amp; message.type === WebInspector.LegacyConsoleMessage.MessageType.StartGroupCollapsed)
</del><ins>+
+        if (groupElement &amp;&amp; messageView.message.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)
</ins><span class="cx">             groupElement.classList.add(&quot;collapsed&quot;);
</span><span class="cx"> 
</span><span class="cx">         groupElement.appendChild(titleElement);
</span><span class="lines">@@ -62,28 +66,28 @@
</span><span class="cx">         groupElement.appendChild(messagesElement);
</span><span class="cx"> 
</span><span class="cx">         return groupElement;
</span><del>-    },
</del><ins>+    }
</ins><span class="cx"> 
</span><del>-    addMessage: function(message)
</del><ins>+    addMessageView(messageView)
</ins><span class="cx">     {
</span><del>-        var element = message.toMessageElement();
</del><ins>+        var element = messageView.element;
</ins><span class="cx">         element.classList.add(WebInspector.LogContentView.ItemWrapperStyleClassName);
</span><span class="cx">         this.append(element);
</span><del>-    },
</del><ins>+    }
</ins><span class="cx"> 
</span><del>-    append: function(messageElement)
</del><ins>+    append(messageOrGroupElement)
</ins><span class="cx">     {
</span><del>-        this._messagesElement.appendChild(messageElement);
-    },
</del><ins>+        this._messagesElement.appendChild(messageOrGroupElement);
+    }
</ins><span class="cx"> 
</span><span class="cx">     // Private
</span><span class="cx"> 
</span><del>-    _titleMouseDown: function(event)
</del><ins>+    _titleMouseDown(event)
</ins><span class="cx">     {
</span><span class="cx">         event.preventDefault();
</span><del>-    },
</del><ins>+    }
</ins><span class="cx"> 
</span><del>-    _titleClicked: function(event)
</del><ins>+    _titleClicked(event)
</ins><span class="cx">     {
</span><span class="cx">         var groupTitleElement = event.target.enclosingNodeOrSelfWithClass(&quot;console-group-title&quot;);
</span><span class="cx">         if (groupTitleElement) {
</span><span class="lines">@@ -97,5 +101,3 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> };
</span><del>-
-WebInspector.ConsoleGroup.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageViewjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js (0 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -0,0 +1,675 @@
</span><ins>+/*
+ * Copyright (C) 2011 Google Inc.  All rights reserved.
+ * Copyright (C) 2007, 2008, 2013-2015 Apple Inc.  All rights reserved.
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 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.ConsoleMessageView = class ConsoleMessageView extends WebInspector.Object
+{
+    constructor(message)
+    {
+        super();
+
+        console.assert(message instanceof WebInspector.ConsoleMessage);
+
+        this._message = message;
+
+        this._element = document.createElement(&quot;div&quot;);
+        this._element.classList.add(&quot;console-message&quot;);
+
+        // FIXME: &lt;https://webkit.org/b/143545&gt; Web Inspector: LogContentView should use higher level objects
+        this._element.__message = this._message;
+        this._element.__messageView = this;
+
+        switch (this._message.level) {
+        case WebInspector.ConsoleMessage.MessageLevel.Tip: // COMPATIBILITY (iOS 6).
+        case WebInspector.ConsoleMessage.MessageLevel.Log:
+            this._element.classList.add(&quot;console-log-level&quot;);
+            this._element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Log: &quot;));
+            break;
+        case WebInspector.ConsoleMessage.MessageLevel.Debug:
+            this._element.classList.add(&quot;console-debug-level&quot;);
+            this._element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Debug: &quot;));
+            break;
+        case WebInspector.ConsoleMessage.MessageLevel.Warning:
+            this._element.classList.add(&quot;console-warning-level&quot;);
+            this._element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Warning: &quot;));
+            break;
+        case WebInspector.ConsoleMessage.MessageLevel.Error:
+            this._element.classList.add(&quot;console-error-level&quot;);
+            this._element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Error: &quot;));
+            break;
+        }
+
+        if (this._message.type === WebInspector.ConsoleMessage.MessageType.Result) {
+            this._element.classList.add(&quot;console-user-command-result&quot;);
+            if (!this._element.getAttribute(&quot;data-labelprefix&quot;))
+                this._element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Output: &quot;));
+        }
+
+        if (this._message.type === WebInspector.ConsoleMessage.MessageType.StartGroup || this._message.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)
+            this._element.classList.add(&quot;console-group-title&quot;);
+
+        this._appendLocationLink();
+
+        this._messageTextElement = this._element.appendChild(document.createElement(&quot;span&quot;));
+        this._messageTextElement.classList.add(&quot;console-message-text&quot;);
+        this._appendMessageTextAndArguments(this._messageTextElement);
+        this._appendSavedResultIndex();
+
+        this._appendParameters();
+        this._appendStackTrace();
+
+        this.repeatCount = this._message.repeatCount;
+    }
+
+    // Public
+
+    get element()
+    {
+        return this._element;
+    }
+
+    get message()
+    {
+        return this._message;
+    }
+    
+    get repeatCount()
+    {
+        return this._repeatCount;
+    }
+
+    set repeatCount(count)
+    {
+        console.assert(typeof count === &quot;number&quot;);
+
+        if (this._repeatCount === count)
+            return;
+
+        this._repeatCount = count;
+
+        if (count &lt;= 1) {
+            if (this._repeatCountElement) {
+                this._repeatCountElement.remove();
+                this._repeatCountElement = null;
+            }
+            return;
+        }
+
+        if (!this._repeatCountElement) {
+            this._repeatCountElement = document.createElement(&quot;span&quot;);
+            this._repeatCountElement.classList.add(&quot;repeat-count&quot;);
+            this._element.insertBefore(this._repeatCountElement, this._element.firstChild);
+        }
+
+        this._repeatCountElement.textContent = count;
+    }
+
+    toClipboardString(isPrefixOptional)
+    {
+        var clipboardString = this._messageTextElement.innerText;
+
+        if (this._message.type === WebInspector.ConsoleMessage.MessageType.Trace)
+            clipboardString = &quot;console.trace()&quot;;
+
+        var hasStackTrace = this._shouldShowStackTrace();
+        if (hasStackTrace) {
+            this._message.stackTrace.forEach(function(frame) {
+                clipboardString += &quot;\n\t&quot; + (frame.functionName || WebInspector.UIString(&quot;(anonymous function)&quot;));
+                if (frame.url)
+                    clipboardString += &quot; (&quot; + WebInspector.displayNameForURL(frame.url) + &quot;, line &quot; + frame.lineNumber + &quot;)&quot;;
+            });
+        } else {
+            var repeatString = this.repeatCount &gt; 1 ? &quot;x&quot; + this.repeatCount : &quot;&quot;;
+            var urlLine = &quot;&quot;;
+            if (this._message.url) {
+                var components = [WebInspector.displayNameForURL(this._message.url), &quot;line &quot; + this._message.line];
+                if (repeatString)
+                    components.push(repeatString);
+                urlLine = &quot; (&quot; + components.join(&quot;, &quot;) + &quot;)&quot;;
+            } else if (repeatString)
+                urlLine = &quot; (&quot; + repeatString + &quot;)&quot;;
+
+            if (urlLine) {
+                var lines = clipboardString.split(&quot;\n&quot;);
+                lines[0] += urlLine;
+                clipboardString = lines.join(&quot;\n&quot;);
+            }
+        }
+
+        if (!isPrefixOptional || this._enforcesClipboardPrefixString())
+            return this._clipboardPrefixString() + clipboardString;
+        return clipboardString;
+    }
+
+    // Private
+
+    _appendMessageTextAndArguments(element)
+    {
+        if (this._message.source === WebInspector.ConsoleMessage.MessageSource.ConsoleAPI) {
+            switch (this._message.type) {
+            case WebInspector.ConsoleMessage.MessageType.Trace:
+                element.appendChild(document.createTextNode(&quot;console.trace()&quot;));
+                break;
+
+            case WebInspector.ConsoleMessage.MessageType.Assert:
+                var args = [WebInspector.UIString(&quot;Assertion failed:&quot;)];
+                if (this._message.parameters)
+                    args.concat(this._message.parameters);
+                this._appendFormattedArguments(element, args);
+                break;
+
+            case WebInspector.ConsoleMessage.MessageType.Dir:
+                var obj = this._message.parameters ? this._message.parameters[0] : undefined;
+                this._appendFormattedArguments(element, [&quot;%O&quot;, obj]);
+                break;
+
+            case WebInspector.ConsoleMessage.MessageType.Table:
+                // FIXME: Remove messageText?
+                var args = this._message.parameters || [this._message.messageText];
+                element.appendChild(this._formatParameterAsTable(args));
+                break;
+
+            default:
+                var args = this._message.parameters || [this._message.messageText];
+                this._appendFormattedArguments(element, args);
+                break;
+            }
+            return;
+        }
+
+        // FIXME: Better handle WebInspector.ConsoleMessage.MessageSource.Network.
+
+        var args = this._message.parameters || [this._message.messageText];
+        this._appendFormattedArguments(element, args);
+    }
+
+    _appendSavedResultIndex(element)
+    {
+        if (!this._message.savedResultIndex)
+            return;
+
+        console.assert(this._message instanceof WebInspector.ConsoleCommandResultMessage);
+        console.assert(this._message.type === WebInspector.ConsoleMessage.MessageType.Result);
+
+        var savedVariableElement = document.createElement(&quot;span&quot;);
+        savedVariableElement.classList.add(&quot;console-saved-variable&quot;);
+        savedVariableElement.textContent = &quot; = $&quot; + this._message.savedResultIndex;
+
+        if (this._objectTree)
+            this._objectTree.appendTitleSuffix(savedVariableElement);
+        else
+            this._messageTextElement.appendChild(savedVariableElement);
+    }    
+
+    _appendLocationLink()
+    {
+        // FIXME: Better handle WebInspector.ConsoleMessage.MessageSource.Network.
+        if (this._message.source === WebInspector.ConsoleMessage.MessageSource.Network || this._message.request)
+            return;
+
+        var firstNonNativeCallFrame = this._firstNonNativeCallFrame();
+        if (firstNonNativeCallFrame) {
+            var urlElement = this._linkifyCallFrame(firstNonNativeCallFrame);
+            this._element.appendChild(urlElement);
+        } else if (this._message.url &amp;&amp; !this._shouldHideURL(this._message.url)) {
+            var urlElement = this._linkifyLocation(this._message.url, this._message.line, this._message.column);
+            this._element.appendChild(urlElement);
+        }
+    }
+
+    _appendParameters()
+    {
+        // FIXME: To be implemented for the new Console design.
+    }
+
+    _appendStackTrace()
+    {
+        // FIXME: To be re-written in the new Console design.
+
+        if (!this._shouldShowStackTrace())
+            return;
+
+        var ol = document.createElement(&quot;ol&quot;);
+        ol.className = &quot;outline-disclosure&quot;;
+        var treeOutline = new WebInspector.TreeOutline(ol);
+        var root = new WebInspector.TreeElement(this._messageTextElement, null, true);
+        treeOutline.appendChild(root);
+
+        if (this._message.type === WebInspector.ConsoleMessage.MessageType.Trace)
+            root.expand();
+
+        for (var i = 0; i &lt; this._message.stackTrace.length; i++) {
+            var frame = this._message.stackTrace[i];
+
+            var content = document.createElement(&quot;div&quot;);
+            var messageTextElement = document.createElement(&quot;span&quot;);
+            messageTextElement.className = &quot;console-message-text&quot;;
+            var functionName = frame.functionName || WebInspector.UIString(&quot;(anonymous function)&quot;);
+            messageTextElement.appendChild(document.createTextNode(functionName));
+            content.appendChild(messageTextElement);
+
+            if (frame.url &amp;&amp; !this._shouldHideURL(frame.url)) {
+                var urlElement = this._linkifyCallFrame(frame);
+                content.appendChild(urlElement);
+            }
+
+            var treeElement = new WebInspector.TreeElement(content);
+            root.appendChild(treeElement);
+        }
+
+        this._messageTextElement = ol;
+        this._element.appendChild(this._messageTextElement);
+    }
+
+    _appendFormattedArguments(element, parameters)
+    {
+        if (!parameters.length)
+            return;
+
+        // FIXME: Only pass RemoteObjects here so we can avoid this work.
+        for (var i = 0; i &lt; parameters.length; ++i) {
+            if (parameters[i] instanceof WebInspector.RemoteObject)
+                continue;
+
+            if (typeof parameters[i] === &quot;object&quot;)
+                parameters[i] = WebInspector.RemoteObject.fromPayload(parameters[i]);
+            else
+                parameters[i] = WebInspector.RemoteObject.fromPrimitiveValue(parameters[i]);
+        }
+
+        var builderElement = element.appendChild(document.createElement(&quot;span&quot;));
+
+        // Format string.
+        var shouldFormatWithStringSubstitution = WebInspector.RemoteObject.type(parameters[0]) === &quot;string&quot; &amp;&amp; this._message.type !== WebInspector.ConsoleMessage.MessageType.Result;
+        if (shouldFormatWithStringSubstitution) {
+            var result = this._formatWithSubstitutionString(parameters, builderElement);
+            parameters = result.unusedSubstitutions;
+            if (parameters.length)
+                builderElement.appendChild(document.createTextNode(&quot; &quot;));
+        }
+
+        // Individual objects.
+        for (var i = 0; i &lt; parameters.length; ++i) {
+            builderElement.appendChild(this._formatParameter(parameters[i], false));
+            if (i &lt; parameters.length - 1)
+                builderElement.appendChild(document.createTextNode(&quot; &quot;));
+        }
+    }
+
+    _formatParameter(parameter, forceObjectFormat)
+    {
+        var type;
+        if (forceObjectFormat)
+            type = &quot;object&quot;;
+        else if (parameter instanceof WebInspector.RemoteObject)
+            type = parameter.subtype || parameter.type;
+        else {
+            console.assert(false, &quot;no longer reachable&quot;);
+            type = typeof parameter;
+        }
+
+        var formatters = {
+            &quot;object&quot;: this._formatParameterAsObject,
+            &quot;error&quot;: this._formatParameterAsObject,
+            &quot;map&quot;: this._formatParameterAsObject,
+            &quot;set&quot;: this._formatParameterAsObject,
+            &quot;weakmap&quot;: this._formatParameterAsObject,
+            &quot;iterator&quot;: this._formatParameterAsObject,
+            &quot;class&quot;: this._formatParameterAsObject,
+            &quot;array&quot;: this._formatParameterAsArray,
+            &quot;node&quot;: this._formatParameterAsNode,
+            &quot;string&quot;: this._formatParameterAsString,
+        };
+
+        var formatter = formatters[type] || this._formatParameterAsValue;
+
+        var span = document.createElement(&quot;span&quot;);
+        formatter.call(this, parameter, span, forceObjectFormat);
+        return span;
+    }
+
+    _formatParameterAsValue(value, element)
+    {
+        element.appendChild(WebInspector.FormattedValue.createElementForRemoteObject(value));
+    }
+
+    _formatParameterAsString(object, element)
+    {
+        element.appendChild(WebInspector.FormattedValue.createLinkifiedElementString(object.description));
+    }
+
+    _formatParameterAsNode(object, element)
+    {
+        element.appendChild(WebInspector.FormattedValue.createElementForNode(object));
+    }
+
+    _formatParameterAsObject(object, element, forceExpansion)
+    {
+        // FIXME: Should have a better ObjectTreeView mode for classes (static methods and methods).
+        // FIXME: Only need to assign to objectTree if this is a ConsoleMessageResult. We should assert that.
+        this._objectTree = new WebInspector.ObjectTreeView(object, null, this._rootPropertyPathForObject(object), forceExpansion);
+        element.appendChild(this._objectTree.element);
+    }
+
+    _formatParameterAsArray(array, element)
+    {
+        this._objectTree = new WebInspector.ObjectTreeView(array, WebInspector.ObjectTreeView.Mode.Properties, this._rootPropertyPathForObject(array));
+        element.appendChild(this._objectTree.element);
+    }
+
+    _rootPropertyPathForObject(object)
+    {
+        if (!this._message.savedResultIndex)
+            return null;
+
+        return new WebInspector.PropertyPath(object, &quot;$&quot; + this.savedResultIndex);
+    }
+
+    _formatWithSubstitutionString(parameters, formattedResult)
+    {
+        function parameterFormatter(force, obj)
+        {
+            return this._formatParameter(obj, force);
+        }
+
+        function stringFormatter(obj)
+        {
+            return obj.description;
+        }
+
+        function floatFormatter(obj)
+        {
+            if (typeof obj.value !== &quot;number&quot;)
+                return parseFloat(obj.description);
+            return obj.value;
+        }
+
+        function integerFormatter(obj)
+        {
+            if (typeof obj.value !== &quot;number&quot;)
+                return parseInt(obj.description);
+            return Math.floor(obj.value);
+        }
+
+        var currentStyle = null;
+        function styleFormatter(obj)
+        {
+            currentStyle = {};
+            var buffer = document.createElement(&quot;span&quot;);
+            buffer.setAttribute(&quot;style&quot;, obj.description);
+            for (var i = 0; i &lt; buffer.style.length; i++) {
+                var property = buffer.style[i];
+                if (isWhitelistedProperty(property))
+                    currentStyle[property] = buffer.style[property];
+            }
+        }
+
+        function isWhitelistedProperty(property)
+        {
+            for (var prefix of [&quot;background&quot;, &quot;border&quot;, &quot;color&quot;, &quot;font&quot;, &quot;line&quot;, &quot;margin&quot;, &quot;padding&quot;, &quot;text&quot;]) {
+                if (property.startsWith(prefix) || property.startsWith(&quot;-webkit-&quot; + prefix))
+                    return true;
+            }
+            return false;
+        }
+
+        // Firebug uses %o for formatting objects.
+        var formatters = {};
+        formatters.o = parameterFormatter.bind(this, false);
+        formatters.s = stringFormatter;
+        formatters.f = floatFormatter;
+
+        // Firebug allows both %i and %d for formatting integers.
+        formatters.i = integerFormatter;
+        formatters.d = integerFormatter;
+
+        // Firebug uses %c for styling the message.
+        formatters.c = styleFormatter;
+
+        // Support %O to force object formatting, instead of the type-based %o formatting.
+        formatters.O = parameterFormatter.bind(this, true);
+
+        function append(a, b)
+        {
+            if (b instanceof Node)
+                a.appendChild(b);
+            else if (b) {
+                var toAppend = WebInspector.linkifyStringAsFragment(b.toString());
+                if (currentStyle) {
+                    var wrapper = document.createElement(&quot;span&quot;);
+                    for (var key in currentStyle)
+                        wrapper.style[key] = currentStyle[key];
+                    wrapper.appendChild(toAppend);
+                    toAppend = wrapper;
+                }
+
+                var span = document.createElement(&quot;span&quot;);
+                span.className = &quot;type-string&quot;;
+                span.appendChild(toAppend);
+                a.appendChild(span);
+            }
+            return a;
+        }
+
+        // String.format does treat formattedResult like a Builder, result is an object.
+        return String.format(parameters[0].description, parameters.slice(1), formatters, formattedResult, append);
+    }
+
+    _shouldShowStackTrace()
+    {
+        if (!this._message.stackTrace || !this._message.stackTrace.length)
+            return false;
+
+        return this._message.source === WebInspector.ConsoleMessage.MessageSource.Network
+            || this._message.level === WebInspector.ConsoleMessage.MessageLevel.Error
+            || this._message.type === WebInspector.ConsoleMessage.MessageType.Trace;
+    }
+
+    _shouldHideURL(url)
+    {
+        return url === &quot;undefined&quot; || url === &quot;[native code]&quot;;
+    }
+
+    _firstNonNativeCallFrame()
+    {
+        if (!this._message.stackTrace)
+            return null;
+
+        for (var i = 0; i &lt; this._message.stackTrace.length; i++) {
+            var frame = this._message.stackTrace[i];
+            if (!frame.url || frame.url === &quot;[native code]&quot;)
+                continue;
+            return frame;
+        }
+
+        return null;
+    }
+
+    _linkifyLocation(url, lineNumber, columnNumber)
+    {
+        // ConsoleMessage stack trace line numbers are one-based.
+        lineNumber = lineNumber ? lineNumber - 1 : 0;
+        columnNumber = columnNumber ? columnNumber - 1 : 0;
+        return WebInspector.linkifyLocation(url, lineNumber, columnNumber, &quot;console-message-url&quot;);
+    }
+
+    _linkifyCallFrame(callFrame)
+    {
+        return this._linkifyLocation(callFrame.url, callFrame.lineNumber, callFrame.columnNumber);
+    }
+
+    _userProvidedColumnNames(columnNamesArgument)
+    {
+        if (!columnNamesArgument)
+            return null;
+
+        var remoteObject = WebInspector.RemoteObject.fromPayload(columnNamesArgument);
+
+        // Single primitive argument.
+        if (remoteObject.type === &quot;string&quot; || remoteObject.type === &quot;number&quot;)
+            return [String(columnNamesArgument.value)];
+
+        // Ignore everything that is not an array with property previews.
+        if (remoteObject.type !== &quot;object&quot; || remoteObject.subtype !== &quot;array&quot; || !remoteObject.preview || !remoteObject.preview.propertyPreviews)
+            return null;
+
+        // Array. Look into the preview and get string values.
+        var extractedColumnNames = [];
+        for (var propertyPreview of remoteObject.preview.propertyPreviews) {
+            if (propertyPreview.type === &quot;string&quot; || propertyPreview.type === &quot;number&quot;)
+                extractedColumnNames.push(String(propertyPreview.value));
+        }
+
+        return extractedColumnNames.length ? extractedColumnNames : null;
+    }
+
+    _formatParameterAsTable(parameters)
+    {
+        var element = document.createElement(&quot;span&quot;);
+        var table = parameters[0];
+        if (!table || !table.preview)
+            return element;
+
+        var rows = [];
+        var columnNames = [];
+        var flatValues = [];
+        var preview = table.preview;
+        var userProvidedColumnNames = false;
+
+        // User provided columnNames.
+        var extractedColumnNames = this._userProvidedColumnNames(parameters[1]);
+        if (extractedColumnNames) {
+            userProvidedColumnNames = true;
+            columnNames = extractedColumnNames;
+        }
+
+        // Check first for valuePreviews in the properties meaning this was an array of objects.
+        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;
+
+                var rowValue = {};
+                var maxColumnsToRender = 10;
+                for (var j = 0; j &lt; rowPreview.propertyPreviews.length; ++j) {
+                    var cellProperty = rowPreview.propertyPreviews[j];
+                    var columnRendered = columnNames.includes(cellProperty.name);
+                    if (!columnRendered) {
+                        if (userProvidedColumnNames || columnNames.length === maxColumnsToRender)
+                            continue;
+                        columnRendered = true;
+                        columnNames.push(cellProperty.name);
+                    }
+
+                    rowValue[cellProperty.name] = WebInspector.FormattedValue.createElementForPropertyPreview(cellProperty);
+                }
+                rows.push([rowProperty.name, rowValue]);
+            }
+        }
+
+        // If there were valuePreviews, convert to a flat list.
+        if (rows.length) {
+            var emDash = &quot;\u2014&quot;;
+            columnNames.unshift(WebInspector.UIString(&quot;(Index)&quot;));
+            for (var i = 0; i &lt; rows.length; ++i) {
+                var rowName = rows[i][0];
+                var rowValue = rows[i][1];
+                flatValues.push(rowName);
+                for (var j = 1; j &lt; columnNames.length; ++j) {
+                    var columnName = columnNames[j];
+                    if (!(columnName in rowValue))
+                        flatValues.push(emDash);
+                    else
+                        flatValues.push(rowValue[columnName]);
+                }
+            }
+        }
+
+        // If there were no value Previews, then check for an array of values.
+        if (!flatValues.length &amp;&amp; preview.propertyPreviews) {
+            for (var i = 0; i &lt; preview.propertyPreviews.length; ++i) {
+                var rowProperty = preview.propertyPreviews[i];
+                if (!(&quot;value&quot; in rowProperty))
+                    continue;
+
+                if (!columnNames.length) {
+                    columnNames.push(WebInspector.UIString(&quot;Index&quot;));
+                    columnNames.push(WebInspector.UIString(&quot;Value&quot;));
+                }
+
+                flatValues.push(rowProperty.name);
+                flatValues.push(WebInspector.FormattedValue.createElementForPropertyPreview(rowProperty));
+            }
+        }
+
+        // If lossless or not table data, output the object so full data can be gotten.
+        if (!preview.lossless || !flatValues.length) {
+            element.appendChild(this._formatParameter(table));
+            if (!flatValues.length)
+                return element;
+        }
+
+        var dataGrid = WebInspector.DataGrid.createSortableDataGrid(columnNames, flatValues);
+        dataGrid.element.classList.add(&quot;inline&quot;);
+        element.appendChild(dataGrid.element);
+
+        return element;
+    }
+
+    _levelString()
+    {
+        switch (this._message.level) {
+        case WebInspector.ConsoleMessage.MessageLevel.Tip:
+            return &quot;Tip&quot;;
+        case WebInspector.ConsoleMessage.MessageLevel.Log:
+            return &quot;Log&quot;;
+        case WebInspector.ConsoleMessage.MessageLevel.Warning:
+            return &quot;Warning&quot;;
+        case WebInspector.ConsoleMessage.MessageLevel.Debug:
+            return &quot;Debug&quot;;
+        case WebInspector.ConsoleMessage.MessageLevel.Error:
+            return &quot;Error&quot;;
+        }
+    }
+
+    _enforcesClipboardPrefixString()
+    {
+        return this._message.type !== WebInspector.ConsoleMessage.MessageType.Result;
+    }
+
+    _clipboardPrefixString()
+    {
+        if (this._message.type === WebInspector.ConsoleMessage.MessageType.Result)
+            return &quot;&lt; &quot;;
+
+        return &quot;[&quot; + this._levelString() + &quot;] &quot;;
+    }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleSessionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleSession.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleSession.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleSession.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -26,36 +26,34 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-WebInspector.ConsoleSession = function()
</del><ins>+WebInspector.ConsoleSession = class ConsoleSession extends WebInspector.Object
</ins><span class="cx"> {
</span><del>-    // FIXME: Convert this to a WebInspector.Object subclass, and call super().
-    // WebInspector.Object.call(this);
</del><ins>+    constructor()
+    {
+        super();
</ins><span class="cx"> 
</span><del>-    var element = document.createElement(&quot;div&quot;);
-    element.className = &quot;console-session&quot;;
-    this.element = element;
-    this._messagesElement = element;
-};
</del><ins>+        var element = document.createElement(&quot;div&quot;);
+        element.className = &quot;console-session&quot;;
+        this.element = element;
+        this._messagesElement = element;
+    }
</ins><span class="cx"> 
</span><del>-WebInspector.ConsoleSession.prototype = {
-    constructor: WebInspector.ConsoleSession,
</del><ins>+    // Public
</ins><span class="cx"> 
</span><del>-    addMessage: function(message)
</del><ins>+    addMessageView(messageView)
</ins><span class="cx">     {
</span><del>-        var messageElement = message.toMessageElement();
</del><ins>+        var messageElement = messageView.element;
</ins><span class="cx">         messageElement.classList.add(WebInspector.LogContentView.ItemWrapperStyleClassName);
</span><span class="cx">         this._messagesElement.appendChild(messageElement);
</span><del>-    },
</del><ins>+    }
</ins><span class="cx"> 
</span><del>-    append: function(messageElement)
</del><ins>+    append(messageOrGroupElement)
</ins><span class="cx">     {
</span><del>-        this._messagesElement.appendChild(messageElement);
-    },
</del><ins>+        this._messagesElement.appendChild(messageOrGroupElement);
+    }
</ins><span class="cx"> 
</span><del>-    hasMessages: function()
</del><ins>+    hasMessages()
</ins><span class="cx">     {
</span><span class="cx">         return !!this._messagesElement.childNodes.length;
</span><span class="cx">     }
</span><span class="cx"> };
</span><del>-
-WebInspector.ConsoleSession.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyConsoleMessagejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessage.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessage.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessage.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -1,98 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc.  All rights reserved.
- * Copyright (C) 2007, 2008, 2013 Apple Inc.  All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 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.LegacyConsoleMessage = function(source, level, url, line, column, repeatCount)
-{
-    this.source = source;
-    this.level = level;
-    this.url = url || null;
-    this.line = line || 0;
-    this.column = column || 0;
-
-    repeatCount = repeatCount || 1;
-    this.repeatCount = repeatCount;
-    this.repeatDelta = repeatCount;
-    this.totalRepeatCount = repeatCount;
-};
-
-WebInspector.LegacyConsoleMessage.prototype = {
-    isErrorOrWarning: function()
-    {
-        return (this.level === WebInspector.LegacyConsoleMessage.MessageLevel.Warning || this.level === WebInspector.LegacyConsoleMessage.MessageLevel.Error);
-    },
-
-    updateRepeatCount: function()
-    {
-        // Implemented by concrete instances
-    },
-
-    clone: function()
-    {
-        // Implemented by concrete instances
-    }
-};
-
-WebInspector.LegacyConsoleMessage.create = function(source, level, message, type, url, line, column, repeatCount, parameters, stackTrace, request)
-{
-    return new WebInspector.LegacyConsoleMessageImpl(source, level, message, null, type, url, line, column, repeatCount, parameters, stackTrace, request);
-};
-
-// FIXME: Switch to ConsoleAgent.ConsoleMessageSource.
-WebInspector.LegacyConsoleMessage.MessageSource = {
-    HTML: &quot;html&quot;,
-    XML: &quot;xml&quot;,
-    JS: &quot;javascript&quot;,
-    Network: &quot;network&quot;,
-    ConsoleAPI: &quot;console-api&quot;,
-    Other: &quot;other&quot;
-};
-
-// FIXME: Switch to ConsoleAgent.ConsoleMessageType.
-WebInspector.LegacyConsoleMessage.MessageType = {
-    Log: &quot;log&quot;,
-    Dir: &quot;dir&quot;,
-    DirXML: &quot;dirxml&quot;,
-    Table: &quot;table&quot;,
-    Trace: &quot;trace&quot;,
-    StartGroup: &quot;startGroup&quot;,
-    StartGroupCollapsed: &quot;startGroupCollapsed&quot;,
-    EndGroup: &quot;endGroup&quot;,
-    Assert: &quot;assert&quot;,
-    Result: &quot;result&quot;
-};
-
-// FIXME: Switch to ConsoleAgent.ConsoleMessageLevel.
-WebInspector.LegacyConsoleMessage.MessageLevel = {
-    Tip: &quot;tip&quot;,
-    Log: &quot;log&quot;,
-    Warning: &quot;warning&quot;,
-    Error: &quot;error&quot;,
-    Debug: &quot;debug&quot;
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyConsoleMessageImpljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessageImpl.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessageImpl.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessageImpl.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -1,801 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc.  All rights reserved.
- * Copyright (C) 2007, 2008, 2013 Apple Inc.  All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 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.LegacyConsoleMessageImpl = function(source, level, message, linkifier, type, url, line, column, repeatCount, parameters, stackTrace, request)
-{
-    WebInspector.LegacyConsoleMessage.call(this, source, level, url, line, column, repeatCount);
-
-    this._linkifier = linkifier;
-    this.type = type || WebInspector.LegacyConsoleMessage.MessageType.Log;
-    this._messageText = message;
-    this._parameters = parameters;
-    this._stackTrace = stackTrace;
-    this._request = request;
-
-    this._customFormatters = {
-        &quot;object&quot;: this._formatParameterAsObject,
-        &quot;error&quot;: this._formatParameterAsObject,
-        &quot;map&quot;: this._formatParameterAsObject,
-        &quot;set&quot;: this._formatParameterAsObject,
-        &quot;weakmap&quot;: this._formatParameterAsObject,
-        &quot;iterator&quot;: this._formatParameterAsObject,
-        &quot;class&quot;: this._formatParameterAsObject,
-        &quot;array&quot;:  this._formatParameterAsArray,
-        &quot;node&quot;:   this._formatParameterAsNode,
-        &quot;string&quot;: this._formatParameterAsString
-    };
-};
-
-WebInspector.LegacyConsoleMessageImpl.prototype = {
-
-    enforcesClipboardPrefixString: true,
-
-    _formatMessage: function()
-    {
-        this._formattedMessage = document.createElement(&quot;span&quot;);
-        this._formattedMessage.className = &quot;console-message-text&quot;;
-
-        var messageText;
-        if (this.source === WebInspector.LegacyConsoleMessage.MessageSource.ConsoleAPI) {
-            switch (this.type) {
-                case WebInspector.LegacyConsoleMessage.MessageType.Trace:
-                    messageText = document.createTextNode(&quot;console.trace()&quot;);
-                    break;
-                case WebInspector.LegacyConsoleMessage.MessageType.Assert:
-                    var args = [WebInspector.UIString(&quot;Assertion failed:&quot;)];
-                    if (this._parameters)
-                        args = args.concat(this._parameters);
-                    messageText = this._format(args);
-                    break;
-                case WebInspector.LegacyConsoleMessage.MessageType.Dir:
-                    var obj = this._parameters ? this._parameters[0] : undefined;
-                    var args = [&quot;%O&quot;, obj];
-                    messageText = this._format(args);
-                    break;
-                default:
-                    var args = this._parameters || [this._messageText];
-                    messageText = this._format(args);
-            }
-        } else if (this.source === WebInspector.LegacyConsoleMessage.MessageSource.Network) {
-            if (this._request) {
-                this._stackTrace = this._request.stackTrace;
-                if (this._request.initiator &amp;&amp; this._request.initiator.url) {
-                    this.url = this._request.initiator.url;
-                    this.line = this._request.initiator.lineNumber;
-                }
-                messageText = document.createElement(&quot;span&quot;);
-                if (this.level === WebInspector.LegacyConsoleMessage.MessageLevel.Error) {
-                    messageText.appendChild(document.createTextNode(this._request.requestMethod + &quot; &quot;));
-                    messageText.appendChild(WebInspector.linkifyRequestAsNode(this._request));
-                    if (this._request.failed)
-                        messageText.appendChild(document.createTextNode(&quot; &quot; + this._request.localizedFailDescription));
-                    else
-                        messageText.appendChild(document.createTextNode(&quot; &quot; + this._request.statusCode + &quot; (&quot; + this._request.statusText + &quot;)&quot;));
-                } else {
-                    var fragment = WebInspector.linkifyStringAsFragmentWithCustomLinkifier(this._messageText, WebInspector.linkifyRequestAsNode.bind(null, this._request, &quot;&quot;));
-                    messageText.appendChild(fragment);
-                }
-            } else {
-                if (this.url) {
-                    var anchor = WebInspector.linkifyURLAsNode(this.url, this.url, &quot;console-message-url&quot;);
-                    this._formattedMessage.appendChild(anchor);
-                }
-                messageText = this._format([this._messageText]);
-            }
-        } else {
-            var args = this._parameters || [this._messageText];
-            messageText = this._format(args);
-        }
-
-        if (this.source !== WebInspector.LegacyConsoleMessage.MessageSource.Network || this._request) {
-            var firstNonNativeCallFrame = this._firstNonNativeCallFrame();
-            if (firstNonNativeCallFrame) {
-                var urlElement = this._linkifyCallFrame(firstNonNativeCallFrame);
-                this._formattedMessage.appendChild(urlElement);
-            } else if (this.url &amp;&amp; !this._shouldHideURL(this.url)) {
-                var urlElement = this._linkifyLocation(this.url, this.line, this.column);
-                this._formattedMessage.appendChild(urlElement);
-            }
-        }
-
-        this._formattedMessage.appendChild(messageText);
-
-        if (this.savedResultIndex) {
-            var savedVariableElement = document.createElement(&quot;span&quot;);
-            savedVariableElement.className = &quot;console-saved-variable&quot;;
-            savedVariableElement.textContent = &quot; = $&quot; + this.savedResultIndex;
-            if (this._objectTree)
-                this._objectTree.appendTitleSuffix(savedVariableElement);
-            else
-                this._formattedMessage.appendChild(savedVariableElement);
-        }
-
-        if (this._shouldDumpStackTrace()) {
-            var ol = document.createElement(&quot;ol&quot;);
-            ol.className = &quot;outline-disclosure&quot;;
-            var treeOutline = new WebInspector.TreeOutline(ol);
-
-            var content = this._formattedMessage;
-            var root = new WebInspector.TreeElement(content, null, true);
-            treeOutline.appendChild(root);
-            if (this.type === WebInspector.LegacyConsoleMessage.MessageType.Trace)
-                root.expand();
-
-            this._populateStackTraceTreeElement(root);
-            this._formattedMessage = ol;
-        }
-
-        // This is used for inline message bubbles in SourceFrames, or other plain-text representations.
-        this._message = messageText.textContent;
-    },
-
-    _shouldDumpStackTrace: function()
-    {
-        return !!this._stackTrace &amp;&amp; this._stackTrace.length &amp;&amp; (this.source === WebInspector.LegacyConsoleMessage.MessageSource.Network || this.level === WebInspector.LegacyConsoleMessage.MessageLevel.Error || this.type === WebInspector.LegacyConsoleMessage.MessageType.Trace);
-    },
-
-    _shouldHideURL: function(url)
-    {
-        return url === &quot;undefined&quot; || url === &quot;[native code]&quot;;
-    },
-
-    _firstNonNativeCallFrame: function()
-    {
-        if (!this._stackTrace)
-            return null;
-
-        for (var i = 0; i &lt; this._stackTrace.length; i++) {
-            var frame = this._stackTrace[i];
-            if (!frame.url || frame.url === &quot;[native code]&quot;)
-                continue;
-            return frame;
-        }
-
-        return null;
-    },
-
-    get message()
-    {
-        // force message formatting
-        var formattedMessage = this.formattedMessage;
-        return this._message;
-    },
-
-    get formattedMessage()
-    {
-        if (!this._formattedMessage)
-            this._formatMessage();
-        return this._formattedMessage;
-    },
-
-    _linkifyLocation: function(url, lineNumber, columnNumber)
-    {
-        // ConsoleMessage stack trace line numbers are one-based.
-        lineNumber = lineNumber ? lineNumber - 1 : 0;
-        columnNumber = columnNumber ? columnNumber - 1 : 0;
-
-        return WebInspector.linkifyLocation(url, lineNumber, columnNumber, &quot;console-message-url&quot;);
-    },
-
-    _linkifyCallFrame: function(callFrame)
-    {
-        return this._linkifyLocation(callFrame.url, callFrame.lineNumber, callFrame.columnNumber);
-    },
-
-    isErrorOrWarning: function()
-    {
-        return (this.level === WebInspector.LegacyConsoleMessage.MessageLevel.Warning || this.level === WebInspector.LegacyConsoleMessage.MessageLevel.Error);
-    },
-
-    _format: function(parameters)
-    {
-        // This node is used like a Builder. Values are continually appended onto it.
-        var formattedResult = document.createElement(&quot;span&quot;);
-        if (!parameters.length)
-            return formattedResult;
-
-        // Formatting code below assumes that parameters are all wrappers whereas frontend console
-        // API allows passing arbitrary values as messages (strings, numbers, etc.). Wrap them here.
-        for (var i = 0; i &lt; parameters.length; ++i) {
-            // FIXME: Only pass runtime wrappers here.
-            if (parameters[i] instanceof WebInspector.RemoteObject)
-                continue;
-
-            if (typeof parameters[i] === &quot;object&quot;)
-                parameters[i] = WebInspector.RemoteObject.fromPayload(parameters[i]);
-            else
-                parameters[i] = WebInspector.RemoteObject.fromPrimitiveValue(parameters[i]);
-        }
-
-        // There can be string log and string eval result. We distinguish between them based on message type.
-        var shouldFormatMessage = WebInspector.RemoteObject.type(parameters[0]) === &quot;string&quot; &amp;&amp; this.type !== WebInspector.LegacyConsoleMessage.MessageType.Result;
-
-        if (shouldFormatMessage) {
-            // Multiple parameters with the first being a format string. Save unused substitutions.
-            var result = this._formatWithSubstitutionString(parameters, formattedResult);
-            parameters = result.unusedSubstitutions;
-            if (parameters.length)
-                formattedResult.appendChild(document.createTextNode(&quot; &quot;));
-        }
-
-        if (this.type === WebInspector.LegacyConsoleMessage.MessageType.Table) {
-            formattedResult.appendChild(this._formatParameterAsTable(parameters));
-            return formattedResult;
-        }
-
-        // Single parameter, or unused substitutions from above.
-        for (var i = 0; i &lt; parameters.length; ++i) {
-            // Inline strings when formatting.
-            if (shouldFormatMessage &amp;&amp; parameters[i].type === &quot;string&quot;) {
-                var span = document.createElement(&quot;span&quot;);
-                span.classList.add(&quot;type-string&quot;);
-                span.textContent = parameters[i].description;
-                formattedResult.appendChild(span);
-            } else
-                formattedResult.appendChild(this._formatParameter(parameters[i], false));
-
-            if (i &lt; parameters.length - 1 &amp;&amp; !this._isExpandable(parameters[i]))
-                formattedResult.appendChild(document.createTextNode(&quot; &quot;));
-
-        }
-        return formattedResult;
-    },
-
-    _isExpandable: function(remoteObject) {
-        if (!remoteObject)
-            return false;
-
-        if (remoteObject.hasChildren &amp;&amp; remoteObject.preview &amp;&amp; remoteObject.preview.lossless)
-            return false;
-
-        return remoteObject.hasChildren;
-    },
-
-    _formatParameter: function(output, forceObjectFormat)
-    {
-        var type;
-        if (forceObjectFormat)
-            type = &quot;object&quot;;
-        else if (output instanceof WebInspector.RemoteObject)
-            type = output.subtype || output.type;
-        else
-            type = typeof output;
-
-        var formatter = this._customFormatters[type];
-        if (!formatter)
-            formatter = this._formatParameterAsValue;
-
-        var span = document.createElement(&quot;span&quot;);
-
-        if (this._isExpandable(output))
-            span.classList.add(&quot;expandable&quot;);
-
-        formatter.call(this, output, span, forceObjectFormat);
-        return span;
-    },
-
-    _formatParameterAsValue: function(value, elem)
-    {
-        elem.appendChild(WebInspector.FormattedValue.createElementForRemoteObject(value));
-    },
-
-    _formatParameterAsObject: function(obj, elem, forceExpansion)
-    {
-        // FIXME: Should have a better ObjectTreeView mode for classes (static methods and methods).
-        this._objectTree = new WebInspector.ObjectTreeView(obj, null, this._rootPropertyPathForObject(obj), forceExpansion);
-        elem.appendChild(this._objectTree.element);
-    },
-
-    _formatParameterAsString: function(output, elem)
-    {
-        var span = WebInspector.FormattedValue.createLinkifiedElementString(output.description);
-        elem.appendChild(span);
-    },
-
-    _formatParameterAsNode: function(object, elem)
-    {
-        var span = WebInspector.FormattedValue.createElementForNode(object);
-        elem.appendChild(span);
-    },
-
-    _formatParameterAsArray: function(arr, elem)
-    {
-        this._objectTree = new WebInspector.ObjectTreeView(arr, WebInspector.ObjectTreeView.Mode.Properties, this._rootPropertyPathForObject(arr));
-        elem.appendChild(this._objectTree.element);
-    },
-
-    _rootPropertyPathForObject: function(object)
-    {
-        if (!this.savedResultIndex)
-            return null;
-
-        return new WebInspector.PropertyPath(object, &quot;$&quot; + this.savedResultIndex);
-    },
-
-    _userProvidedColumnNames: function(columnNamesArgument)
-    {
-        if (!columnNamesArgument)
-            return null;
-
-        var remoteObject = WebInspector.RemoteObject.fromPayload(columnNamesArgument);
-
-        // Single primitive argument.
-        if (remoteObject.type === &quot;string&quot; || remoteObject.type === &quot;number&quot;)
-            return [String(columnNamesArgument.value)];
-
-        // Ignore everything that is not an array with property previews.
-        if (remoteObject.type !== &quot;object&quot; || remoteObject.subtype !== &quot;array&quot; || !remoteObject.preview || !remoteObject.preview.propertyPreviews)
-            return null;
-
-        // Array. Look into the preview and get string values.
-        var extractedColumnNames = [];
-        for (var propertyPreview of remoteObject.preview.propertyPreviews) {
-            if (propertyPreview.type === &quot;string&quot; || propertyPreview.type === &quot;number&quot;)
-                extractedColumnNames.push(String(propertyPreview.value));
-        }
-
-        return extractedColumnNames.length ? extractedColumnNames : null;
-    },
-
-    _formatParameterAsTable: function(parameters)
-    {
-        var element = document.createElement(&quot;span&quot;);
-        var table = parameters[0];
-        if (!table || !table.preview)
-            return element;
-
-        var rows = [];
-        var columnNames = [];
-        var flatValues = [];
-        var preview = table.preview;
-        var userProvidedColumnNames = false;
-
-        // User provided columnNames.
-        var extractedColumnNames = this._userProvidedColumnNames(parameters[1]);
-        if (extractedColumnNames) {
-            userProvidedColumnNames = true;
-            columnNames = extractedColumnNames;
-        }
-
-        // Check first for valuePreviews in the properties meaning this was an array of objects.
-        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;
-
-                var rowValue = {};
-                const maxColumnsToRender = 10;
-                for (var j = 0; j &lt; rowPreview.propertyPreviews.length; ++j) {
-                    var cellProperty = rowPreview.propertyPreviews[j];
-                    var columnRendered = columnNames.includes(cellProperty.name);
-                    if (!columnRendered) {
-                        if (userProvidedColumnNames || columnNames.length === maxColumnsToRender)
-                            continue;
-                        columnRendered = true;
-                        columnNames.push(cellProperty.name);
-                    }
-
-                    rowValue[cellProperty.name] = WebInspector.FormattedValue.createElementForPropertyPreview(cellProperty);
-                }
-                rows.push([rowProperty.name, rowValue]);
-            }
-        }
-
-        // If there were valuePreviews, convert to a flat list.
-        if (rows.length) {
-            const emDash = &quot;\u2014&quot;;
-            columnNames.unshift(WebInspector.UIString(&quot;(Index)&quot;));
-            for (var i = 0; i &lt; rows.length; ++i) {
-                var rowName = rows[i][0];
-                var rowValue = rows[i][1];
-                flatValues.push(rowName);
-                for (var j = 1; j &lt; columnNames.length; ++j) {
-                    var columnName = columnNames[j];
-                    if (!(columnName in rowValue))
-                        flatValues.push(emDash);
-                    else
-                        flatValues.push(rowValue[columnName]);
-                }
-            }
-        }
-
-        // If there were no value Previews, then check for an array of values.
-        if (!flatValues.length &amp;&amp; preview.propertyPreviews) {
-            for (var i = 0; i &lt; preview.propertyPreviews.length; ++i) {
-                var rowProperty = preview.propertyPreviews[i];
-                if (!(&quot;value&quot; in rowProperty))
-                    continue;
-
-                if (!columnNames.length) {
-                    columnNames.push(WebInspector.UIString(&quot;Index&quot;));
-                    columnNames.push(WebInspector.UIString(&quot;Value&quot;));
-                }
-
-                flatValues.push(rowProperty.name);
-                flatValues.push(WebInspector.FormattedValue.createElementForPropertyPreview(rowProperty));
-            }
-        }
-
-        // If lossless or not table data, output the object so full data can be gotten.
-        if (!preview.lossless || !flatValues.length) {
-            element.appendChild(this._formatParameter(table));
-            if (!flatValues.length)
-                return element;
-        }
-
-        var dataGrid = WebInspector.DataGrid.createSortableDataGrid(columnNames, flatValues);
-        dataGrid.element.classList.add(&quot;inline&quot;);
-        element.appendChild(dataGrid.element);
-
-        return element;
-    },
-
-    _formatWithSubstitutionString: function(parameters, formattedResult)
-    {
-        var formatters = {};
-
-        function parameterFormatter(force, obj)
-        {
-            return this._formatParameter(obj, force);
-        }
-
-        function stringFormatter(obj)
-        {
-            return obj.description;
-        }
-
-        function floatFormatter(obj)
-        {
-            if (typeof obj.value !== &quot;number&quot;)
-                return parseFloat(obj.description);
-            return obj.value;
-        }
-
-        function integerFormatter(obj)
-        {
-            if (typeof obj.value !== &quot;number&quot;)
-                return parseInt(obj.description);
-            return Math.floor(obj.value);
-        }
-
-        var currentStyle = null;
-        function styleFormatter(obj)
-        {
-            currentStyle = {};
-            var buffer = document.createElement(&quot;span&quot;);
-            buffer.setAttribute(&quot;style&quot;, obj.description);
-            for (var i = 0; i &lt; buffer.style.length; i++) {
-                var property = buffer.style[i];
-                if (isWhitelistedProperty(property))
-                    currentStyle[property] = buffer.style[property];
-            }
-        }
-
-        function isWhitelistedProperty(property)
-        {
-            var prefixes = [&quot;background&quot;, &quot;border&quot;, &quot;color&quot;, &quot;font&quot;, &quot;line&quot;, &quot;margin&quot;, &quot;padding&quot;, &quot;text&quot;, &quot;-webkit-background&quot;, &quot;-webkit-border&quot;, &quot;-webkit-font&quot;, &quot;-webkit-margin&quot;, &quot;-webkit-padding&quot;, &quot;-webkit-text&quot;];
-            for (var i = 0; i &lt; prefixes.length; i++) {
-                if (property.startsWith(prefixes[i]))
-                    return true;
-            }
-            return false;
-        }
-
-        // Firebug uses %o for formatting objects.
-        formatters.o = parameterFormatter.bind(this, false);
-        formatters.s = stringFormatter;
-        formatters.f = floatFormatter;
-
-        // Firebug allows both %i and %d for formatting integers.
-        formatters.i = integerFormatter;
-        formatters.d = integerFormatter;
-
-        // Firebug uses %c for styling the message.
-        formatters.c = styleFormatter;
-
-        // Support %O to force object formatting, instead of the type-based %o formatting.
-        formatters.O = parameterFormatter.bind(this, true);
-
-        function append(a, b)
-        {
-            if (b instanceof Node)
-                a.appendChild(b);
-            else if (b) {
-                var toAppend = WebInspector.linkifyStringAsFragment(b.toString());
-                if (currentStyle) {
-                    var wrapper = document.createElement(&quot;span&quot;);
-                    for (var key in currentStyle)
-                        wrapper.style[key] = currentStyle[key];
-                    wrapper.appendChild(toAppend);
-                    toAppend = wrapper;
-                }
-                var span = document.createElement(&quot;span&quot;);
-                span.className = &quot;type-string&quot;;
-                span.appendChild(toAppend);
-                a.appendChild(span);
-            }
-            return a;
-        }
-
-        // String.format does treat formattedResult like a Builder, result is an object.
-        return String.format(parameters[0].description, parameters.slice(1), formatters, formattedResult, append);
-    },
-
-    decorateMessageElement: function(element)
-    {
-        if (this._element)
-            return this._element;
-
-        element.message = this;
-        element.classList.add(&quot;console-message&quot;);
-
-        this._element = element;
-
-        switch (this.level) {
-            case WebInspector.LegacyConsoleMessage.MessageLevel.Tip:
-                element.classList.add(&quot;console-tip-level&quot;);
-                element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Tip: &quot;));
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageLevel.Log:
-                element.classList.add(&quot;console-log-level&quot;);
-                element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Log: &quot;));
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageLevel.Debug:
-                element.classList.add(&quot;console-debug-level&quot;);
-                element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Debug: &quot;));
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageLevel.Warning:
-                element.classList.add(&quot;console-warning-level&quot;);
-                element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Warning: &quot;));
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageLevel.Error:
-                element.classList.add(&quot;console-error-level&quot;);
-                element.setAttribute(&quot;data-labelprefix&quot;, WebInspector.UIString(&quot;Error: &quot;));
-                break;
-        }
-
-        if (this.type === WebInspector.LegacyConsoleMessage.MessageType.StartGroup || this.type === WebInspector.LegacyConsoleMessage.MessageType.StartGroupCollapsed)
-            element.classList.add(&quot;console-group-title&quot;);
-
-        element.appendChild(this.formattedMessage);
-
-        if (this.repeatCount &gt; 1)
-            this.updateRepeatCount();
-
-        return element;
-    },
-
-    toMessageElement: function()
-    {
-        if (this._element)
-            return this._element;
-
-        var element = document.createElement(&quot;div&quot;);
-
-        return this.decorateMessageElement(element);
-    },
-
-    _populateStackTraceTreeElement: function(parentTreeElement)
-    {
-        for (var i = 0; i &lt; this._stackTrace.length; i++) {
-            var frame = this._stackTrace[i];
-
-            var content = document.createElement(&quot;div&quot;);
-            var messageTextElement = document.createElement(&quot;span&quot;);
-            messageTextElement.className = &quot;console-message-text&quot;;
-            var functionName = frame.functionName || WebInspector.UIString(&quot;(anonymous function)&quot;);
-            messageTextElement.appendChild(document.createTextNode(functionName));
-            content.appendChild(messageTextElement);
-
-            if (frame.url &amp;&amp; !this._shouldHideURL(frame.url)) {
-                var urlElement = this._linkifyCallFrame(frame);
-                content.appendChild(urlElement);
-            }
-
-            var treeElement = new WebInspector.TreeElement(content);
-            parentTreeElement.appendChild(treeElement);
-        }
-    },
-
-    updateRepeatCount: function() {
-        if (!this.repeatCountElement) {
-            this.repeatCountElement = document.createElement(&quot;span&quot;);
-            this.repeatCountElement.className = &quot;bubble&quot;;
-
-            this._element.insertBefore(this.repeatCountElement, this._element.firstChild);
-        }
-        this.repeatCountElement.textContent = this.repeatCount;
-    },
-
-    toString: function()
-    {
-        var sourceString;
-        switch (this.source) {
-            case WebInspector.LegacyConsoleMessage.MessageSource.HTML:
-                sourceString = &quot;HTML&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageSource.XML:
-                sourceString = &quot;XML&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageSource.JS:
-                sourceString = &quot;JS&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageSource.Network:
-                sourceString = &quot;Network&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageSource.ConsoleAPI:
-                sourceString = &quot;ConsoleAPI&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageSource.Other:
-                sourceString = &quot;Other&quot;;
-                break;
-        }
-
-        var typeString;
-        switch (this.type) {
-            case WebInspector.LegacyConsoleMessage.MessageType.Log:
-                typeString = &quot;Log&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageType.Dir:
-                typeString = &quot;Dir&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageType.DirXML:
-                typeString = &quot;Dir XML&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageType.Trace:
-                typeString = &quot;Trace&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageType.StartGroupCollapsed:
-            case WebInspector.LegacyConsoleMessage.MessageType.StartGroup:
-                typeString = &quot;Start Group&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageType.EndGroup:
-                typeString = &quot;End Group&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageType.Assert:
-                typeString = &quot;Assert&quot;;
-                break;
-            case WebInspector.LegacyConsoleMessage.MessageType.Result:
-                typeString = &quot;Result&quot;;
-                break;
-        }
-
-        return sourceString + &quot; &quot; + typeString + &quot; &quot; + this.levelString + &quot;: &quot; + this.formattedMessage.textContent + &quot;\n&quot; + this.url + &quot; line &quot; + this.line;
-    },
-
-    get text()
-    {
-        return this._messageText;
-    },
-
-    isEqual: function(msg)
-    {
-        if (!msg)
-            return false;
-
-        if (this._stackTrace) {
-            if (!msg._stackTrace)
-                return false;
-            var l = this._stackTrace;
-            var r = msg._stackTrace;
-            for (var i = 0; i &lt; l.length; i++) {
-                if (l[i].url !== r[i].url ||
-                    l[i].functionName !== r[i].functionName ||
-                    l[i].lineNumber !== r[i].lineNumber ||
-                    l[i].columnNumber !== r[i].columnNumber)
-                    return false;
-            }
-        }
-
-        return (this.source === msg.source)
-            &amp;&amp; (this.type === msg.type)
-            &amp;&amp; (this.level === msg.level)
-            &amp;&amp; (this.line === msg.line)
-            &amp;&amp; (this.url === msg.url)
-            &amp;&amp; (this.message === msg.message)
-            &amp;&amp; (this._request === msg._request);
-    },
-
-    get stackTrace()
-    {
-        return this._stackTrace;
-    },
-
-    clone: function()
-    {
-        return WebInspector.LegacyConsoleMessage.create(this.source, this.level, this._messageText, this.type, this.url, this.line, this.column, this.repeatCount, this._parameters, this._stackTrace, this._request);
-    },
-
-    get levelString()
-    {
-        switch (this.level) {
-            case WebInspector.LegacyConsoleMessage.MessageLevel.Tip:
-                return &quot;Tip&quot;;
-            case WebInspector.LegacyConsoleMessage.MessageLevel.Log:
-                return &quot;Log&quot;;
-            case WebInspector.LegacyConsoleMessage.MessageLevel.Warning:
-                return &quot;Warning&quot;;
-            case WebInspector.LegacyConsoleMessage.MessageLevel.Debug:
-                return &quot;Debug&quot;;
-            case WebInspector.LegacyConsoleMessage.MessageLevel.Error:
-                return &quot;Error&quot;;
-        }
-    },
-
-    get clipboardPrefixString()
-    {
-        return &quot;[&quot; + this.levelString + &quot;] &quot;;
-    },
-
-    toClipboardString: function(isPrefixOptional)
-    {
-        var isTrace = this._shouldDumpStackTrace();
-
-        var clipboardString = &quot;&quot;;
-        if (this._formattedMessage &amp;&amp; !isTrace)
-            clipboardString = this._formattedMessage.querySelector(&quot;span&quot;).innerText;
-        else
-            clipboardString = this.type === WebInspector.LegacyConsoleMessage.MessageType.Trace ? &quot;console.trace()&quot; : this._message || this._messageText;
-
-        if (!isPrefixOptional || this.enforcesClipboardPrefixString)
-            clipboardString = this.clipboardPrefixString + clipboardString;
-
-        if (isTrace) {
-            this._stackTrace.forEach(function(frame) {
-                clipboardString += &quot;\n\t&quot; + (frame.functionName || WebInspector.UIString(&quot;(anonymous function)&quot;));
-                if (frame.url)
-                    clipboardString += &quot; (&quot; + WebInspector.displayNameForURL(frame.url) + &quot;, line &quot; + frame.lineNumber + &quot;)&quot;;
-            });
-        } else {
-            var repeatString = this.repeatCount &gt; 1 ? &quot;x&quot; + this.repeatCount : &quot;&quot;;
-
-            var urlLine = &quot;&quot;;
-            if (this.url) {
-                var components = [WebInspector.displayNameForURL(this.url), &quot;line &quot; + this.line];
-                if (repeatString)
-                    components.push(repeatString);
-                urlLine = &quot; (&quot; + components.join(&quot;, &quot;) + &quot;)&quot;;
-            } else if (repeatString)
-                urlLine = &quot; (&quot; + repeatString + &quot;)&quot;;
-
-            if (urlLine) {
-                var lines = clipboardString.split(&quot;\n&quot;);
-                lines[0] += urlLine;
-                clipboardString = lines.join(&quot;\n&quot;);
-            }
-        }
-
-        return clipboardString;
-    }
-};
-
-WebInspector.LegacyConsoleMessageImpl.prototype.__proto__ = WebInspector.LegacyConsoleMessage.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">     width: 12px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.console-message .bubble {
</del><ins>+.console-message .repeat-count {
</ins><span class="cx">     display: inline-block;
</span><span class="cx">     height: 15px;
</span><span class="cx">     background-color: rgb(128, 151, 189);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js (182578 => 182579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js        2015-04-09 01:37:52 UTC (rev 182578)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js        2015-04-09 01:37:58 UTC (rev 182579)
</span><span class="lines">@@ -23,6 +23,8 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+// FIXME: &lt;https://webkit.org/b/143545&gt; Web Inspector: LogContentView should use higher level objects
+
</ins><span class="cx"> WebInspector.LogContentView = function(representedObject)
</span><span class="cx"> {
</span><span class="cx">     WebInspector.ContentView.call(this, representedObject);
</span><span class="lines">@@ -171,25 +173,28 @@
</span><span class="cx">         WebInspector.logManager.requestClearMessages();
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    didAppendConsoleMessage: function(message)
</del><ins>+    didAppendConsoleMessageView: function(messageView)
</ins><span class="cx">     {
</span><ins>+        console.assert(messageView instanceof WebInspector.ConsoleMessageView || messageView instanceof WebInspector.ConsoleCommandView);
+
</ins><span class="cx">         WebInspector.quickConsole.updateLayout();
</span><span class="cx"> 
</span><span class="cx">         // Nest the message.
</span><del>-        if (message.type !== WebInspector.LegacyConsoleMessage.MessageType.EndGroup) {
</del><ins>+        var type = messageView instanceof WebInspector.ConsoleCommandView ? null : messageView.message.type;
+        if (type !== WebInspector.ConsoleMessage.MessageType.EndGroup) {
</ins><span class="cx">             var x = 16 * this._nestingLevel;
</span><del>-            var messageElement = message.toMessageElement();
</del><ins>+            var messageElement = messageView.element;
</ins><span class="cx">             messageElement.style.left = x + &quot;px&quot;;
</span><span class="cx">             messageElement.style.width = &quot;calc(100% - &quot; + x + &quot;px)&quot;;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Update the nesting level.
</span><del>-        switch (message.type) {
-        case WebInspector.LegacyConsoleMessage.MessageType.StartGroup:
-        case WebInspector.LegacyConsoleMessage.MessageType.StartGroupCollapsed:
</del><ins>+        switch (type) {
+        case WebInspector.ConsoleMessage.MessageType.StartGroup:
+        case WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed:
</ins><span class="cx">             ++this._nestingLevel;
</span><span class="cx">             break;
</span><del>-        case WebInspector.LegacyConsoleMessage.MessageType.EndGroup:
</del><ins>+        case WebInspector.ConsoleMessage.MessageType.EndGroup:
</ins><span class="cx">             --this._nestingLevel;
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="lines">@@ -202,7 +207,7 @@
</span><span class="cx"> 
</span><span class="cx">         // We only auto show the console if the message is a result.
</span><span class="cx">         // This is when the user evaluated something directly in the prompt.
</span><del>-        if (message.type !== WebInspector.LegacyConsoleMessage.MessageType.Result)
</del><ins>+        if (type !== WebInspector.ConsoleMessage.MessageType.Result)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         if (!WebInspector.isShowingConsoleView())
</span><span class="lines">@@ -278,10 +283,10 @@
</span><span class="cx"> 
</span><span class="cx">     _formatMessagesAsData: function(onlySelected)
</span><span class="cx">     {
</span><del>-        var messages = this._allMessages();
</del><ins>+        var messages = this._allMessageElements();
</ins><span class="cx"> 
</span><span class="cx">         if (onlySelected) {
</span><del>-            messages = this._allMessages().filter(function(message) {
</del><ins>+            messages = messages.filter(function(message) {
</ins><span class="cx">                 return message.classList.contains(WebInspector.LogContentView.SelectedStyleClassName);
</span><span class="cx">             });
</span><span class="cx">         }
</span><span class="lines">@@ -289,16 +294,14 @@
</span><span class="cx">         var data = &quot;&quot;;
</span><span class="cx"> 
</span><span class="cx">         var isPrefixOptional = messages.length &lt;= 1 &amp;&amp; onlySelected;
</span><del>-        messages.forEach(function (messageElement, index) {
-            var messageObject = messageElement.message;
-            if (!messageObject)
-                messageObject = messageElement.command;
-            if (!messageObject)
</del><ins>+        messages.forEach(function(messageElement, index) {
+            var messageView = messageElement.__messageView || messageElement.__commandView;
+            if (!messageView)
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">             if (index &gt; 0)
</span><span class="cx">                 data += &quot;\n&quot;;
</span><del>-            data += messageObject.toClipboardString(isPrefixOptional);
</del><ins>+            data += messageView.toClipboardString(isPrefixOptional);
</ins><span class="cx">         });
</span><span class="cx"> 
</span><span class="cx">         return data;
</span><span class="lines">@@ -329,9 +332,9 @@
</span><span class="cx">         if (this._startedProvisionalLoad)
</span><span class="cx">             this._provisionalMessages.push(event.data.message);
</span><span class="cx"> 
</span><del>-        var message = this._logViewController.appendConsoleMessage(event.data.message);
-        if (message.type !== WebInspector.LegacyConsoleMessage.MessageType.EndGroup)
-            this._filterMessages([message.toMessageElement()]);
</del><ins>+        var messageView = this._logViewController.appendConsoleMessage(event.data.message);
+        if (messageView.message.type !== WebInspector.ConsoleMessage.MessageType.EndGroup)
+            this._filterMessageElements([messageView.element]);
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     _previousMessageRepeatCountUpdated: function(event)
</span><span class="lines">@@ -493,7 +496,7 @@
</span><span class="cx">             this._clearMessagesSelection();
</span><span class="cx"> 
</span><span class="cx">         if (rangeSelection) {
</span><del>-            var messages = this._visibleMessages();
</del><ins>+            var messages = this._visibleMessageElements();
</ins><span class="cx"> 
</span><span class="cx">             var refIndex = this._referenceMessageForRangeSelection ? messages.indexOf(this._referenceMessageForRangeSelection) : 0;
</span><span class="cx">             var targetIndex = messages.indexOf(message);
</span><span class="lines">@@ -599,7 +602,7 @@
</span><span class="cx">     {
</span><span class="cx">         this._clearMessagesSelection();
</span><span class="cx"> 
</span><del>-        var messages = this._visibleMessages();
</del><ins>+        var messages = this._visibleMessageElements();
</ins><span class="cx">         for (var i = 0; i &lt; messages.length; ++i) {
</span><span class="cx">             var message = messages[i];
</span><span class="cx">             message.classList.add(WebInspector.LogContentView.SelectedStyleClassName);
</span><span class="lines">@@ -607,21 +610,21 @@
</span><span class="cx">         }
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _allMessages: function()
</del><ins>+    _allMessageElements: function()
</ins><span class="cx">     {
</span><span class="cx">         return Array.from(this.messagesElement.querySelectorAll(&quot;.console-message, .console-user-command&quot;));
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _unfilteredMessages: function()
</del><ins>+    _unfilteredMessageElements: function()
</ins><span class="cx">     {
</span><del>-        return this._allMessages().filter(function(message) {
</del><ins>+        return this._allMessageElements().filter(function(message) {
</ins><span class="cx">             return !message.classList.contains(WebInspector.LogContentView.FilteredOutStyleClassName);
</span><span class="cx">         });
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _visibleMessages: function()
</del><ins>+    _visibleMessageElements: function()
</ins><span class="cx">     {
</span><del>-        var unfilteredMessages = this._unfilteredMessages();
</del><ins>+        var unfilteredMessages = this._unfilteredMessageElements();
</ins><span class="cx"> 
</span><span class="cx">         if (!this.searchInProgress)
</span><span class="cx">             return unfilteredMessages;
</span><span class="lines">@@ -660,38 +663,39 @@
</span><span class="cx"> 
</span><span class="cx">     _scopeBarSelectionDidChange: function(event)
</span><span class="cx">     {
</span><del>-        this._filterMessages(this._allMessages());
</del><ins>+        this._filterMessageElements(this._allMessageElements());
</ins><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _filterMessages: function(messages)
</del><ins>+    _filterMessageElements: function(messageElements)
</ins><span class="cx">     {
</span><span class="cx">         var showsAll = this._scopeBar.item(WebInspector.LogContentView.Scopes.All).selected;
</span><span class="cx">         var showsErrors = this._scopeBar.item(WebInspector.LogContentView.Scopes.Errors).selected;
</span><span class="cx">         var showsWarnings = this._scopeBar.item(WebInspector.LogContentView.Scopes.Warnings).selected;
</span><span class="cx">         var showsLogs = this._scopeBar.item(WebInspector.LogContentView.Scopes.Logs).selected;
</span><span class="cx"> 
</span><del>-        messages.forEach(function(message) {
-            var visible = showsAll || message.command instanceof WebInspector.ConsoleCommand || message.message instanceof WebInspector.ConsoleCommandResult;
</del><ins>+        messageElements.forEach(function(messageElement) {
+            var visible = showsAll || messageElement.__commandView instanceof WebInspector.ConsoleCommandView || messageElement.__message instanceof WebInspector.ConsoleCommandResultMessage;
</ins><span class="cx">             if (!visible) {
</span><del>-                switch(message.message.level) {
-                    case WebInspector.LegacyConsoleMessage.MessageLevel.Warning:
-                        visible = showsWarnings;
-                        break;
-                    case WebInspector.LegacyConsoleMessage.MessageLevel.Error:
-                        visible = showsErrors;
-                        break;
-                    case WebInspector.LegacyConsoleMessage.MessageLevel.Log:
-                    case WebInspector.LegacyConsoleMessage.MessageLevel.Debug:
-                        visible = showsLogs;
-                        break;
</del><ins>+                switch(messageElement.__message.level) {
+                case WebInspector.ConsoleMessage.MessageLevel.Warning:
+                    visible = showsWarnings;
+                    break;
+                case WebInspector.ConsoleMessage.MessageLevel.Error:
+                    visible = showsErrors;
+                    break;
+                case WebInspector.ConsoleMessage.MessageLevel.Tip: // COMPATIBILITY (iOS 6): Treat Tips like Logs.
+                case WebInspector.ConsoleMessage.MessageLevel.Log:
+                case WebInspector.ConsoleMessage.MessageLevel.Debug:
+                    visible = showsLogs;
+                    break;
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            var classList = message.classList;
</del><ins>+            var classList = messageElement.classList;
</ins><span class="cx">             if (visible)
</span><span class="cx">                 classList.remove(WebInspector.LogContentView.FilteredOutStyleClassName);
</span><span class="cx">             else {
</span><del>-                this._selectedMessages.remove(message);
</del><ins>+                this._selectedMessages.remove(messageElement);
</ins><span class="cx">                 classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
</span><span class="cx">                 classList.add(WebInspector.LogContentView.FilteredOutStyleClassName);
</span><span class="cx">             }
</span><span class="lines">@@ -744,7 +748,7 @@
</span><span class="cx"> 
</span><span class="cx">     _upArrowWasPressed: function(event)
</span><span class="cx">     {
</span><del>-        var messages = this._visibleMessages();
</del><ins>+        var messages = this._visibleMessageElements();
</ins><span class="cx"> 
</span><span class="cx">         if (!this._selectedMessages.length) {
</span><span class="cx">             if (messages.length)
</span><span class="lines">@@ -766,7 +770,7 @@
</span><span class="cx"> 
</span><span class="cx">     _downArrowWasPressed: function(event)
</span><span class="cx">     {
</span><del>-        var messages = this._visibleMessages();
</del><ins>+        var messages = this._visibleMessageElements();
</ins><span class="cx"> 
</span><span class="cx">         if (!this._selectedMessages.length) {
</span><span class="cx">             if (messages.length)
</span><span class="lines">@@ -861,7 +865,7 @@
</span><span class="cx"> 
</span><span class="cx">     _previousMessage: function(message)
</span><span class="cx">     {
</span><del>-        var messages = this._visibleMessages();
</del><ins>+        var messages = this._visibleMessageElements();
</ins><span class="cx">         for (var i = messages.indexOf(message) - 1; i &gt;= 0; --i) {
</span><span class="cx">             if (this._isMessageVisible(messages[i]))
</span><span class="cx">                 return messages[i];
</span><span class="lines">@@ -870,7 +874,7 @@
</span><span class="cx"> 
</span><span class="cx">     _nextMessage: function(message)
</span><span class="cx">     {
</span><del>-        var messages = this._visibleMessages();
</del><ins>+        var messages = this._visibleMessageElements();
</ins><span class="cx">         for (var i = messages.indexOf(message) + 1; i &lt; messages.length; ++i) {
</span><span class="cx">             if (this._isMessageVisible(messages[i]))
</span><span class="cx">                 return messages[i];
</span><span class="lines">@@ -910,7 +914,7 @@
</span><span class="cx">         this._selectedSearchMathIsValid = false;
</span><span class="cx"> 
</span><span class="cx">         var searchRegex = new RegExp(searchTerms.escapeForRegExp(), &quot;gi&quot;);
</span><del>-        this._unfilteredMessages().forEach(function(message) {
</del><ins>+        this._unfilteredMessageElements().forEach(function(message) {
</ins><span class="cx">             var matchRanges = [];
</span><span class="cx">             var text = message.textContent;
</span><span class="cx">             var match = searchRegex.exec(text);
</span><span class="lines">@@ -923,7 +927,7 @@
</span><span class="cx">                 this._highlightRanges(message, matchRanges);
</span><span class="cx"> 
</span><span class="cx">             var classList = message.classList;
</span><del>-            if (!isEmptyObject(matchRanges) || message.command instanceof WebInspector.ConsoleCommand || message.message instanceof WebInspector.ConsoleCommandResult)
</del><ins>+            if (!isEmptyObject(matchRanges) || message.command instanceof WebInspector.ConsoleCommand || message.message instanceof WebInspector.ConsoleCommandResultMessage)
</ins><span class="cx">                 classList.remove(WebInspector.LogContentView.FilteredOutBySearchStyleClassName);
</span><span class="cx">             else
</span><span class="cx">                 classList.add(WebInspector.LogContentView.FilteredOutBySearchStyleClassName);
</span><span class="lines">@@ -941,12 +945,8 @@
</span><span class="cx"> 
</span><span class="cx">         console.assert(highlightedElements.length === matchRanges.length);
</span><span class="cx"> 
</span><del>-        matchRanges.forEach(function (range, index) {
-            this._searchMatches.push({
-                message,
-                range,
-                highlight: highlightedElements[index]
-            });
</del><ins>+        matchRanges.forEach(function(range, index) {
+            this._searchMatches.push({message, range, highlight: highlightedElements[index]});
</ins><span class="cx"> 
</span><span class="cx">             if (this._selectedSearchMatch &amp;&amp; !this._selectedSearchMathIsValid &amp;&amp; this._selectedSearchMatch.message === message) {
</span><span class="cx">                 this._selectedSearchMathIsValid = this._rangesOverlap(this._selectedSearchMatch.range, range);
</span><span class="lines">@@ -992,9 +992,9 @@
</span><span class="cx">         this._startedProvisionalLoad = false;
</span><span class="cx"> 
</span><span class="cx">         for (var provisionalMessage of this._provisionalMessages) {
</span><del>-            var message = this._logViewController.appendConsoleMessage(provisionalMessage);
-            if (message.type !== WebInspector.LegacyConsoleMessage.MessageType.EndGroup)
-                this._filterMessages([message.toMessageElement()]);
</del><ins>+            var messageView = this._logViewController.appendConsoleMessage(provisionalMessage);
+            if (message.type !== WebInspector.ConsoleMessage.MessageType.EndGroup)
+                this._filterMessageElements([messageView.element]);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         this._provisionalMessages = [];
</span></span></pre>
</div>
</div>

</body>
</html>