<!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>[194932] trunk/Source/WebInspectorUI</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/194932">194932</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2016-01-12 16:04:25 -0800 (Tue, 12 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Move helper methods for getting icons/text to TimelineTabContentView
https://bugs.webkit.org/show_bug.cgi?id=152996

Reviewed by Brian Burg.

In preparation for the Timelines UI redesign, helper methods which existed
in the sidebar panel and timeline tree elements need to be relocated,
since the sidebar won't exist in the new UI.

* UserInterface/Views/TimelineRecordTreeElement.js:
(WebInspector.TimelineRecordTreeElement):
Removed icon/title code, replaced with calls to new helper methods.
Code to create the alternate subtitle was broken out form the rest
of the icon/title code, and kept in the constructor.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._instrumentAdded):
Updated calls to helper methods.

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype._instrumentAdded):
(WebInspector.TimelineSidebarPanel.displayNameForTimeline): Deleted.
(WebInspector.TimelineSidebarPanel.iconClassNameForTimeline): Deleted.
Moved to TimelineTabContentView.

* UserInterface/Views/TimelineTabContentView.js:
(WebInspector.TimelineTabContentView.displayNameForTimeline):
(WebInspector.TimelineTabContentView.iconClassNameForTimeline):
Relocated from TimelineSidebarPanel.
(WebInspector.TimelineTabContentView.iconClassNameForRecord):
(WebInspector.TimelineTabContentView.displayNameForRecord):
New helper methods. Previously part of TimelineRecordTreeElement.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineTabContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (194931 => 194932)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-01-13 00:02:04 UTC (rev 194931)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-01-13 00:04:25 UTC (rev 194932)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2016-01-12  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+        Web Inspector: Move helper methods for getting icons/text to TimelineTabContentView
+        https://bugs.webkit.org/show_bug.cgi?id=152996
+
+        Reviewed by Brian Burg.
+
+        In preparation for the Timelines UI redesign, helper methods which existed
+        in the sidebar panel and timeline tree elements need to be relocated,
+        since the sidebar won't exist in the new UI.
+
+        * UserInterface/Views/TimelineRecordTreeElement.js:
+        (WebInspector.TimelineRecordTreeElement):
+        Removed icon/title code, replaced with calls to new helper methods.
+        Code to create the alternate subtitle was broken out form the rest
+        of the icon/title code, and kept in the constructor.
+
+        * UserInterface/Views/TimelineRecordingContentView.js:
+        (WebInspector.TimelineRecordingContentView.prototype._instrumentAdded):
+        Updated calls to helper methods.
+
+        * UserInterface/Views/TimelineSidebarPanel.js:
+        (WebInspector.TimelineSidebarPanel.prototype._instrumentAdded):
+        (WebInspector.TimelineSidebarPanel.displayNameForTimeline): Deleted.
+        (WebInspector.TimelineSidebarPanel.iconClassNameForTimeline): Deleted.
+        Moved to TimelineTabContentView.
+
+        * UserInterface/Views/TimelineTabContentView.js:
+        (WebInspector.TimelineTabContentView.displayNameForTimeline):
+        (WebInspector.TimelineTabContentView.iconClassNameForTimeline):
+        Relocated from TimelineSidebarPanel.
+        (WebInspector.TimelineTabContentView.iconClassNameForRecord):
+        (WebInspector.TimelineTabContentView.displayNameForRecord):
+        New helper methods. Previously part of TimelineRecordTreeElement.
+
</ins><span class="cx"> 2016-01-12  Brian Burg  &lt;bburg@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: fix some common misspellings in localized strings
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js (194931 => 194932)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js        2016-01-13 00:02:04 UTC (rev 194931)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js        2016-01-13 00:04:25 UTC (rev 194932)
</span><span class="lines">@@ -31,10 +31,18 @@
</span><span class="cx"> 
</span><span class="cx">         sourceCodeLocation = sourceCodeLocation || timelineRecord.sourceCodeLocation || null;
</span><span class="cx"> 
</span><del>-        var title = &quot;&quot;;
-        var subtitle = null;
-        var alternateSubtitle = null;
</del><ins>+        let alternateSubtitle = null;
+        if (includeDetailsInMainTitle &amp;&amp; timelineRecord.type === WebInspector.TimelineRecord.Type.Script &amp;&amp; timelineRecord.eventType === WebInspector.ScriptTimelineRecord.EventType.TimerInstalled) {
+            let timeoutString = Number.secondsToString(timelineRecord.details.timeout / 1000);
+            alternateSubtitle = document.createElement(&quot;span&quot;);
+            alternateSubtitle.classList.add(&quot;alternate-subtitle&quot;);
+            if (timelineRecord.details.repeating)
+                alternateSubtitle.textContent = WebInspector.UIString(&quot;%s interval&quot;).format(timeoutString);
+            else
+                alternateSubtitle.textContent = WebInspector.UIString(&quot;%s delay&quot;).format(timeoutString);
+        }
</ins><span class="cx"> 
</span><ins>+        let subtitle = null;
</ins><span class="cx">         if (sourceCodeLocation) {
</span><span class="cx">             subtitle = document.createElement(&quot;span&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -44,94 +52,9 @@
</span><span class="cx">                 sourceCodeLocation.populateLiveDisplayLocationString(subtitle, &quot;textContent&quot;, null, WebInspector.SourceCodeLocation.NameStyle.None, WebInspector.UIString(&quot;line &quot;));
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        var iconStyleClass = null;
</del><ins>+        let iconStyleClass = WebInspector.TimelineTabContentView.iconClassNameForRecord(timelineRecord);
+        let title = WebInspector.TimelineTabContentView.displayNameForRecord(timelineRecord);
</ins><span class="cx"> 
</span><del>-        switch (timelineRecord.type) {
-        case WebInspector.TimelineRecord.Type.Layout:
-            title = WebInspector.LayoutTimelineRecord.displayNameForEventType(timelineRecord.eventType);
-
-            switch (timelineRecord.eventType) {
-            case WebInspector.LayoutTimelineRecord.EventType.InvalidateStyles:
-            case WebInspector.LayoutTimelineRecord.EventType.RecalculateStyles:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.StyleRecordIconStyleClass;
-                break;
-            case WebInspector.LayoutTimelineRecord.EventType.InvalidateLayout:
-            case WebInspector.LayoutTimelineRecord.EventType.ForcedLayout:
-            case WebInspector.LayoutTimelineRecord.EventType.Layout:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.LayoutRecordIconStyleClass;
-                break;
-            case WebInspector.LayoutTimelineRecord.EventType.Paint:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass;
-                break;
-            case WebInspector.LayoutTimelineRecord.EventType.Composite:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.CompositeRecordIconStyleClass;
-                break;
-            default:
-                console.error(&quot;Unknown LayoutTimelineRecord eventType: &quot; + timelineRecord.eventType, timelineRecord);
-            }
-
-            break;
-
-        case WebInspector.TimelineRecord.Type.Script:
-            title = WebInspector.ScriptTimelineRecord.EventType.displayName(timelineRecord.eventType, timelineRecord.details, includeDetailsInMainTitle);
-
-            switch (timelineRecord.eventType) {
-            case WebInspector.ScriptTimelineRecord.EventType.APIScriptEvaluated:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.APIRecordIconStyleClass;
-                break;
-            case WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass;
-                break;
-            case WebInspector.ScriptTimelineRecord.EventType.MicrotaskDispatched:
-            case WebInspector.ScriptTimelineRecord.EventType.EventDispatched:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass;
-                break;
-            case WebInspector.ScriptTimelineRecord.EventType.ProbeSampleRecorded:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.ProbeRecordIconStyleClass;
-                break;
-            case WebInspector.ScriptTimelineRecord.EventType.ConsoleProfileRecorded:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.ConsoleProfileIconStyleClass;
-                break;
-            case WebInspector.ScriptTimelineRecord.EventType.GarbageCollected:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.GarbageCollectionIconStyleClass;
-                break;
-            case WebInspector.ScriptTimelineRecord.EventType.TimerInstalled:
-                if (includeDetailsInMainTitle) {
-                    let timeoutString =  Number.secondsToString(timelineRecord.details.timeout / 1000);
-                    alternateSubtitle = document.createElement(&quot;span&quot;);
-                    alternateSubtitle.classList.add(&quot;alternate-subtitle&quot;);
-                    if (timelineRecord.details.repeating)
-                        alternateSubtitle.textContent = WebInspector.UIString(&quot;%s interval&quot;).format(timeoutString);
-                    else
-                        alternateSubtitle.textContent = WebInspector.UIString(&quot;%s delay&quot;).format(timeoutString);
-                }
-
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass;
-                break;
-            case WebInspector.ScriptTimelineRecord.EventType.TimerFired:
-            case WebInspector.ScriptTimelineRecord.EventType.TimerRemoved:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass;
-                break;
-            case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired:
-            case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameRequested:
-            case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameCanceled:
-                iconStyleClass = WebInspector.TimelineRecordTreeElement.AnimationRecordIconStyleClass;
-                break;
-            default:
-                console.error(&quot;Unknown ScriptTimelineRecord eventType: &quot; + timelineRecord.eventType, timelineRecord);
-            }
-
-            break;
-
-        case WebInspector.TimelineRecord.Type.RenderingFrame:
-            title = WebInspector.UIString(&quot;Frame %d&quot;).format(timelineRecord.frameNumber);
-            iconStyleClass = WebInspector.TimelineRecordTreeElement.RenderingFrameRecordIconStyleClass;
-            break;
-
-        default:
-            console.error(&quot;Unknown TimelineRecord type: &quot; + timelineRecord.type, timelineRecord);
-        }
-
</del><span class="cx">         super([iconStyleClass], title, subtitle, representedObject || timelineRecord, false);
</span><span class="cx"> 
</span><span class="cx">         this._record = timelineRecord;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (194931 => 194932)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2016-01-13 00:02:04 UTC (rev 194931)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2016-01-13 00:04:25 UTC (rev 194932)
</span><span class="lines">@@ -586,8 +586,8 @@
</span><span class="cx">         if (timeline.type === WebInspector.TimelineRecord.Type.RenderingFrame)
</span><span class="cx">             this._renderingFrameTimeline = timeline;
</span><span class="cx"> 
</span><del>-        let displayName = WebInspector.TimelineSidebarPanel.displayNameForTimeline(timeline);
-        let iconClassName = WebInspector.TimelineSidebarPanel.iconClassNameForTimeline(timeline);
</del><ins>+        let displayName = WebInspector.TimelineTabContentView.displayNameForTimeline(timeline);
+        let iconClassName = WebInspector.TimelineTabContentView.iconClassNameForTimeline(timeline);
</ins><span class="cx">         let pathComponent = new WebInspector.HierarchicalPathComponent(displayName, iconClassName, timeline);
</span><span class="cx">         pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
</span><span class="cx">         this._pathComponentMap.set(timeline, pathComponent);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js (194931 => 194932)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js        2016-01-13 00:02:04 UTC (rev 194931)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js        2016-01-13 00:04:25 UTC (rev 194932)
</span><span class="lines">@@ -182,40 +182,6 @@
</span><span class="cx">         this._toggleNewRecordingShortcut.disabled = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // Static
-
-    static displayNameForTimeline(timeline)
-    {
-        switch (timeline.type) {
-        case WebInspector.TimelineRecord.Type.Network:
-            return WebInspector.UIString(&quot;Network Requests&quot;);
-        case WebInspector.TimelineRecord.Type.Layout:
-            return WebInspector.UIString(&quot;Layout &amp; Rendering&quot;);
-        case WebInspector.TimelineRecord.Type.Script:
-            return WebInspector.UIString(&quot;JavaScript &amp; Events&quot;);
-        case WebInspector.TimelineRecord.Type.RenderingFrame:
-            return WebInspector.UIString(&quot;Rendering Frames&quot;);
-        }
-
-        console.error(&quot;Unknown Timeline type:&quot;, timeline.type);
-    }
-
-    static iconClassNameForTimeline(timeline)
-    {
-        switch (timeline.type) {
-        case WebInspector.TimelineRecord.Type.Network:
-            return &quot;network-icon&quot;;
-        case WebInspector.TimelineRecord.Type.Layout:
-            return &quot;colors-icon&quot;;
-        case WebInspector.TimelineRecord.Type.Script:
-            return &quot;script-icon&quot;;
-        case WebInspector.TimelineRecord.Type.RenderingFrame:
-            return &quot;rendering-frame-icon&quot;;
-        }
-
-        console.error(&quot;Unknown Timeline type:&quot;, timeline.type);
-    }
-
</del><span class="cx">     // Public
</span><span class="cx"> 
</span><span class="cx">     get minimumWidth()
</span><span class="lines">@@ -788,8 +754,8 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        let displayName = WebInspector.TimelineSidebarPanel.displayNameForTimeline(timeline);
-        let iconClassName = WebInspector.TimelineSidebarPanel.iconClassNameForTimeline(timeline);
</del><ins>+        let displayName = WebInspector.TimelineTabContentView.displayNameForTimeline(timeline);
+        let iconClassName = WebInspector.TimelineTabContentView.iconClassNameForTimeline(timeline);
</ins><span class="cx">         let timelineTreeElement = new WebInspector.GeneralTreeElement([iconClassName, WebInspector.TimelineSidebarPanel.LargeIconStyleClass], displayName, null, timeline);
</span><span class="cx">         let tooltip = WebInspector.UIString(&quot;Close %s timeline view&quot;).format(displayName);
</span><span class="cx">         let button = new WebInspector.TreeElementStatusButton(useSVGSymbol(&quot;Images/CloseLarge.svg&quot;, &quot;close-button&quot;, tooltip));
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineTabContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js (194931 => 194932)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js        2016-01-13 00:02:04 UTC (rev 194931)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js        2016-01-13 00:04:25 UTC (rev 194932)
</span><span class="lines">@@ -34,6 +34,8 @@
</span><span class="cx">         super(identifier || &quot;timeline&quot;, &quot;timeline&quot;, tabBarItem, WebInspector.TimelineSidebarPanel, detailsSidebarPanels);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // Static
+
</ins><span class="cx">     static tabInfo()
</span><span class="cx">     {
</span><span class="cx">         return {
</span><span class="lines">@@ -47,6 +49,122 @@
</span><span class="cx">         return !!window.TimelineAgent || !!window.ScriptProfilerAgent;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    static displayNameForTimeline(timeline)
+    {
+        switch (timeline.type) {
+        case WebInspector.TimelineRecord.Type.Network:
+            return WebInspector.UIString(&quot;Network Requests&quot;);
+        case WebInspector.TimelineRecord.Type.Layout:
+            return WebInspector.UIString(&quot;Layout &amp; Rendering&quot;);
+        case WebInspector.TimelineRecord.Type.Script:
+            return WebInspector.UIString(&quot;JavaScript &amp; Events&quot;);
+        case WebInspector.TimelineRecord.Type.RenderingFrame:
+            return WebInspector.UIString(&quot;Rendering Frames&quot;);
+        default:
+            console.error(&quot;Unknown Timeline type:&quot;, timeline.type);
+        }
+
+        return null;
+    }
+
+    static iconClassNameForTimeline(timeline)
+    {
+        switch (timeline.type) {
+        case WebInspector.TimelineRecord.Type.Network:
+            return &quot;network-icon&quot;;
+        case WebInspector.TimelineRecord.Type.Layout:
+            return &quot;colors-icon&quot;;
+        case WebInspector.TimelineRecord.Type.Script:
+            return &quot;script-icon&quot;;
+        case WebInspector.TimelineRecord.Type.RenderingFrame:
+            return &quot;rendering-frame-icon&quot;;
+        default:
+            console.error(&quot;Unknown Timeline type:&quot;, timeline.type);
+        }
+
+        return null;
+    }
+
+    static iconClassNameForRecord(timelineRecord)
+    {
+        switch (timelineRecord.type) {
+        case WebInspector.TimelineRecord.Type.Layout:
+            switch (timelineRecord.eventType) {
+            case WebInspector.LayoutTimelineRecord.EventType.InvalidateStyles:
+            case WebInspector.LayoutTimelineRecord.EventType.RecalculateStyles:
+                return WebInspector.TimelineRecordTreeElement.StyleRecordIconStyleClass;
+            case WebInspector.LayoutTimelineRecord.EventType.InvalidateLayout:
+            case WebInspector.LayoutTimelineRecord.EventType.ForcedLayout:
+            case WebInspector.LayoutTimelineRecord.EventType.Layout:
+                return WebInspector.TimelineRecordTreeElement.LayoutRecordIconStyleClass;
+            case WebInspector.LayoutTimelineRecord.EventType.Paint:
+                return WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass;
+            case WebInspector.LayoutTimelineRecord.EventType.Composite:
+                return WebInspector.TimelineRecordTreeElement.CompositeRecordIconStyleClass;
+            default:
+                console.error(&quot;Unknown LayoutTimelineRecord eventType: &quot; + timelineRecord.eventType, timelineRecord);
+            }
+
+            break;
+
+        case WebInspector.TimelineRecord.Type.Script:
+            switch (timelineRecord.eventType) {
+            case WebInspector.ScriptTimelineRecord.EventType.APIScriptEvaluated:
+                return WebInspector.TimelineRecordTreeElement.APIRecordIconStyleClass;
+            case WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated:
+                return WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass;
+            case WebInspector.ScriptTimelineRecord.EventType.MicrotaskDispatched:
+            case WebInspector.ScriptTimelineRecord.EventType.EventDispatched:
+                return WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass;
+            case WebInspector.ScriptTimelineRecord.EventType.ProbeSampleRecorded:
+                return WebInspector.TimelineRecordTreeElement.ProbeRecordIconStyleClass;
+            case WebInspector.ScriptTimelineRecord.EventType.ConsoleProfileRecorded:
+                return WebInspector.TimelineRecordTreeElement.ConsoleProfileIconStyleClass;
+            case WebInspector.ScriptTimelineRecord.EventType.GarbageCollected:
+                return WebInspector.TimelineRecordTreeElement.GarbageCollectionIconStyleClass;
+            case WebInspector.ScriptTimelineRecord.EventType.TimerInstalled:
+                return WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass;
+            case WebInspector.ScriptTimelineRecord.EventType.TimerFired:
+            case WebInspector.ScriptTimelineRecord.EventType.TimerRemoved:
+                return WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass;
+            case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired:
+            case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameRequested:
+            case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameCanceled:
+                return WebInspector.TimelineRecordTreeElement.AnimationRecordIconStyleClass;
+            default:
+                console.error(&quot;Unknown ScriptTimelineRecord eventType: &quot; + timelineRecord.eventType, timelineRecord);
+            }
+
+            break;
+
+        case WebInspector.TimelineRecord.Type.RenderingFrame:
+            return WebInspector.TimelineRecordTreeElement.RenderingFrameRecordIconStyleClass;
+
+        default:
+            console.error(&quot;Unknown TimelineRecord type: &quot; + timelineRecord.type, timelineRecord);
+        }
+
+        return null;
+    }
+
+    static displayNameForRecord(timelineRecord, includeDetailsInMainTitle)
+    {
+        switch (timelineRecord.type) {
+        case WebInspector.TimelineRecord.Type.Network:
+            return WebInspector.displayNameForURL(timelineRecord.resource.url, timelineRecord.resource.urlComponents);
+        case WebInspector.TimelineRecord.Type.Layout:
+            return WebInspector.LayoutTimelineRecord.displayNameForEventType(timelineRecord.eventType);
+        case WebInspector.TimelineRecord.Type.Script:
+            return WebInspector.ScriptTimelineRecord.EventType.displayName(timelineRecord.eventType, timelineRecord.details, includeDetailsInMainTitle);
+        case WebInspector.TimelineRecord.Type.RenderingFrame:
+            return WebInspector.UIString(&quot;Frame %d&quot;).format(timelineRecord.frameNumber);
+        default:
+            console.error(&quot;Unknown TimelineRecord type: &quot; + timelineRecord.type, timelineRecord);
+        }
+
+        return null;
+    }
+
</ins><span class="cx">     // Public
</span><span class="cx"> 
</span><span class="cx">     get type()
</span></span></pre>
</div>
</div>

</body>
</html>