<!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>[200767] 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/200767">200767</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2016-05-12 03:34:16 -0700 (Thu, 12 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Improve snapshot selection in heap allocations overview graph
https://bugs.webkit.org/show_bug.cgi?id=157588
&lt;rdar://problem/26231245&gt;

Reviewed by Joseph Pecoraro.

Heap snapshot icon selection now uses the built-in record selection
behavior provided by TimelineOverview/TimelineOverviewGraph. The marker
representing the selected heap snapshot now has a &quot;selected&quot; style, and
clicking an icon when the HeapAllocationsTimeline is not selected causes
the timeline to become selected.

* UserInterface/Images/HeapSnapshotSelected.svg: Added.
New art for selected snapshot icon.

* UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css:
(.timeline-overview-graph.heap-allocations &gt; img.snapshot.selected):
(.timeline-overview-graph.heap-allocations:not(.selected) &gt; img.snapshot.selected):
Selected icon styles for selected/unselected overview graph.

* UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
(WebInspector.HeapAllocationsTimelineOverviewGraph):
Track selected image element.

(WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.layout):
Associate image elements with their snapshot record, and reuse image
elements between layouts. Image element click handler can just set the
selectedRecord in the TimelineOverviewGraph base class.

(WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.updateSelectedRecord):
(WebInspector.HeapAllocationsTimelineOverviewGraph.prototype._updateSnapshotMarkers):
Refresh snapshot icon styles when selected record changes.

* UserInterface/Views/HeapAllocationsTimelineView.js:
(WebInspector.HeapAllocationsTimelineView.prototype.selectRecord):
Show snapshot list if no record selected.
(WebInspector.HeapAllocationsTimelineView.prototype.userSelectedRecordFromOverview): Deleted.
No longer needed.

* UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
(WebInspector.RenderingFrameTimelineOverviewGraph.prototype._updateFrameMarker):
No need to call dispatchSelectedRecordChangedEvent manually anymore,
method has been removed from base class.

* UserInterface/Views/TimelineOverviewGraph.js:
(WebInspector.TimelineOverviewGraph.prototype._needsSelectedRecordLayout):
(WebInspector.TimelineOverviewGraph):
(WebInspector.TimelineOverviewGraph.prototype.dispatchSelectedRecordChangedEvent): Deleted.
No longer needed. Event dispatched automatically by the rAF callback.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._recordSelected):
Allow switching to another timeline, if the selected record does not
belong to the current timeline.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineOverviewGraphcss">trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsRenderingFrameTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesHeapSnapshotSelectedsvg">trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotSelected.svg</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (200766 => 200767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-05-12 09:36:00 UTC (rev 200766)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-05-12 10:34:16 UTC (rev 200767)
</span><span class="lines">@@ -1,3 +1,60 @@
</span><ins>+2016-05-12  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+        Web Inspector: Improve snapshot selection in heap allocations overview graph
+        https://bugs.webkit.org/show_bug.cgi?id=157588
+        &lt;rdar://problem/26231245&gt;
+
+        Reviewed by Joseph Pecoraro.
+
+        Heap snapshot icon selection now uses the built-in record selection
+        behavior provided by TimelineOverview/TimelineOverviewGraph. The marker
+        representing the selected heap snapshot now has a &quot;selected&quot; style, and
+        clicking an icon when the HeapAllocationsTimeline is not selected causes
+        the timeline to become selected.
+
+        * UserInterface/Images/HeapSnapshotSelected.svg: Added.
+        New art for selected snapshot icon.
+
+        * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css:
+        (.timeline-overview-graph.heap-allocations &gt; img.snapshot.selected):
+        (.timeline-overview-graph.heap-allocations:not(.selected) &gt; img.snapshot.selected):
+        Selected icon styles for selected/unselected overview graph.
+
+        * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
+        (WebInspector.HeapAllocationsTimelineOverviewGraph):
+        Track selected image element.
+
+        (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.layout):
+        Associate image elements with their snapshot record, and reuse image
+        elements between layouts. Image element click handler can just set the
+        selectedRecord in the TimelineOverviewGraph base class.
+
+        (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.updateSelectedRecord):
+        (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype._updateSnapshotMarkers):
+        Refresh snapshot icon styles when selected record changes.
+
+        * UserInterface/Views/HeapAllocationsTimelineView.js:
+        (WebInspector.HeapAllocationsTimelineView.prototype.selectRecord):
+        Show snapshot list if no record selected.
+        (WebInspector.HeapAllocationsTimelineView.prototype.userSelectedRecordFromOverview): Deleted.
+        No longer needed.
+
+        * UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
+        (WebInspector.RenderingFrameTimelineOverviewGraph.prototype._updateFrameMarker):
+        No need to call dispatchSelectedRecordChangedEvent manually anymore,
+        method has been removed from base class.
+
+        * UserInterface/Views/TimelineOverviewGraph.js:
+        (WebInspector.TimelineOverviewGraph.prototype._needsSelectedRecordLayout):
+        (WebInspector.TimelineOverviewGraph):
+        (WebInspector.TimelineOverviewGraph.prototype.dispatchSelectedRecordChangedEvent): Deleted.
+        No longer needed. Event dispatched automatically by the rAF callback.
+
+        * UserInterface/Views/TimelineRecordingContentView.js:
+        (WebInspector.TimelineRecordingContentView.prototype._recordSelected):
+        Allow switching to another timeline, if the selected record does not
+        belong to the current timeline.
+
</ins><span class="cx"> 2016-05-12  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: 3.5% of time in toFixed in TimelineRecordBar updating element positions
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesHeapSnapshotSelectedsvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotSelected.svg (0 => 200767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotSelected.svg                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotSelected.svg        2016-05-12 10:34:16 UTC (rev 200767)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!-- Copyright © 2016 Apple Inc. All rights reserved. --&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; id=&quot;root&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot;&gt;
+    &lt;path fill=&quot;hsl(212, 92%, 54%)&quot; d=&quot;M 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 L 3 1 Z M 3 1&quot;/&gt;
+    &lt;path fill=&quot;hsl(212, 92%, 54%)&quot; d=&quot;M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 M 13 2 C 13.550781 2 14 2.449219 14 3 L 14 13 C 14 13.550781 13.550781 14 13 14 L 3 14 C 2.449219 14 2 13.550781 2 13 L 2 3 C 2 2.449219 2.449219 2 3 2 L 13 2&quot;/&gt;
+    &lt;path fill=&quot;hsl(212, 92%, 54%)&quot; d=&quot;M 5.19849793 12.6584609 C 5.2831472 12.676395 6.98277851 12.9487305 7.62939453 12.9487305 C 8.79640591 12.9487305 9.76331344 12.6806542 10.5034462 12.1146703 C 11.3037555 11.5026691 11.7177734 10.6286312 11.7177734 9.58544922 C 11.7177734 8.84534902 11.4998181 8.18341061 11.0628295 7.63852362 C 10.6767371 7.15709971 10.0557113 6.69185669 9.18734192 6.20492057 L 8.61524891 5.88648574 C 8.27558142 5.69523066 8.15431716 5.69238281 8.23632812 5.69238281 C 8.56703836 5.69238281 9.10333246 5.81936052 9.8138795 6.08542439 L 11.1645508 6.59118236 L 11.1645508 5.14892578 L 11.1645508 3.87597656 L 11.1645508 3.07965768 L 10.3884483 2.90136387 C 9.52406853 2.70279014 8.73593121 2.60205078 8.02148438 2.60205078 C 7.01081351 2.60205078 6.14909735 2.87110984 5.47554965 3.42697448 C 4.76046595 4.01711791 4.38964844 4.82767811 4.38964844 5.77734375 C 4.38964844 6.49239045 4.61205052 7.14196725 5.04920932 7.68841575 C 5.43639142 8.1723
 9338 6.03437082 8.62885808 6.84888633 9.08727887 L 7.38545082 9.38538774 C 7.71699471 9.57330366 7.92926232 9.72631865 7.99164827 9.79813503 C 7.94460492 9.81851991 7.82252674 9.85302734 7.60253906 9.85302734 C 7.14294036 9.85302734 6.53493744 9.70437137 5.79174704 9.39341305 L 4.40576172 8.81350287 L 4.40576172 10.315918 L 4.40576172 11.6801758 L 4.40576172 12.4905083 L 5.19849793 12.6584609 C 5.52713094 12.7280865 5.52713094 12.7280865 5.57407851 12.738033 L 5.19849793 12.6584609 Z M 5.19849793 12.6584609&quot;/&gt;
+    &lt;path fill=&quot;white&quot; d=&quot;M 5.40576172 11.6801758 L 5.40576172 10.315918 C 6.26156027 10.6739927 6.99381206 10.8530273 7.60253906 10.8530273 C 8.02864796 10.8530273 8.36433797 10.758139 8.60961914 10.5683594 C 8.85490031 10.3785798 8.97753906 10.1207699 8.97753906 9.79492188 C 8.97753906 9.53710809 8.90055416 9.31958096 8.74658203 9.14233398 C 8.59260991 8.965087 8.3007834 8.75472127 7.87109375 8.51123047 L 7.33935547 8.21582031 C 6.6267868 7.81477664 6.12369938 7.43074728 5.83007812 7.0637207 C 5.53645687 6.69669413 5.38964844 6.2679061 5.38964844 5.77734375 C 5.38964844 5.12206704 5.63045007 4.59570511 6.11206055 4.19824219 C 6.59367103 3.80077926 7.23013927 3.60205078 8.02148438 3.60205078 C 8.65527661 3.60205078 9.36962493 3.69335846 10.1645508 3.87597656 L 10.1645508 5.14892578 C 9.3517212 4.84456228 8.70898674 4.69238281 8.23632812 4.69238281 C 7.87109192 4.69238281 7.57837024 4.77384359 7.3581543 4.93676758 C 7.13793835 5.09969157 7.02783203 5.313638
  7.02783203 5.57861328 C 7.02783203 5.79703885 7.10481694 5.98860595 7.25878906 6.15332031 C 7.41276119 6.31803468 7.70279735 6.52034385 8.12890625 6.76025391 L 8.69824219 7.07714844 C 9.46452206 7.50683809 9.99267433 7.9025047 10.2827148 8.26416016 C 10.5727554 8.62581561 10.7177734 9.06624089 10.7177734 9.58544922 C 10.7177734 10.3230831 10.4438504 10.9013651 9.89599609 11.3203125 C 9.34814179 11.7392599 8.59261549 11.9487305 7.62939453 11.9487305 C 6.99202155 11.9487305 6.25081803 11.8592131 5.40576172 11.6801758 C 5.40576172 11.6801758 6.25081803 11.8592131 5.40576172 11.6801758 L 5.40576172 11.6801758 L 5.40576172 11.6801758 Z M 5.40576172 11.6801758&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineOverviewGraphcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css (200766 => 200767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css        2016-05-12 09:36:00 UTC (rev 200766)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css        2016-05-12 10:34:16 UTC (rev 200767)
</span><span class="lines">@@ -34,3 +34,11 @@
</span><span class="cx">     width: 16px;
</span><span class="cx">     height: 16px;
</span><span class="cx"> }
</span><ins>+
+.timeline-overview-graph.heap-allocations &gt; img.snapshot.selected {
+    content: url(../Images/HeapSnapshotSelected.svg);
+}
+
+.timeline-overview-graph.heap-allocations:not(.selected) &gt; img.snapshot.selected {
+    filter: grayscale(100%) brightness(1.3);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineOverviewGraphjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js (200766 => 200767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js        2016-05-12 09:36:00 UTC (rev 200766)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js        2016-05-12 10:34:16 UTC (rev 200767)
</span><span class="lines">@@ -34,6 +34,8 @@
</span><span class="cx">         this._heapAllocationsTimeline = timeline;
</span><span class="cx">         this._heapAllocationsTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._heapAllocationTimelineRecordAdded, this);
</span><span class="cx"> 
</span><ins>+        this._selectedImageElement = null;
+
</ins><span class="cx">         this.reset();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -52,6 +54,7 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         this.element.removeChildren();
</span><ins>+        this._selectedImageElement = null;
</ins><span class="cx"> 
</span><span class="cx">         // This may display records past the current time marker.
</span><span class="cx">         let visibleRecords = this._visibleRecords(this.startTime, this.endTime);
</span><span class="lines">@@ -71,17 +74,46 @@
</span><span class="cx">             if (x &lt;= 1)
</span><span class="cx">                 x = 1;
</span><span class="cx"> 
</span><del>-            let imageElement = this.element.appendChild(document.createElement(&quot;img&quot;));
-            imageElement.classList.add(&quot;snapshot&quot;);
</del><ins>+            let imageElement = record[WebInspector.HeapAllocationsTimelineOverviewGraph.RecordElementAssociationSymbol];
+            if (!imageElement) {
+                imageElement = document.createElement(&quot;img&quot;);
+                imageElement.classList.add(&quot;snapshot&quot;);
+                imageElement.addEventListener(&quot;click&quot;, () =&gt; { this.selectedRecord = record; });
+                record[WebInspector.HeapAllocationsTimelineOverviewGraph.RecordElementAssociationSymbol] = imageElement;
+            }
+
</ins><span class="cx">             imageElement.style.left = x + &quot;px&quot;;
</span><del>-            imageElement.addEventListener(&quot;click&quot;, (event) =&gt; {
-                this.timelineOverview.userSelectedRecord(record);
-            });
</del><ins>+
+            this.element.appendChild(imageElement);
</ins><span class="cx">         }
</span><ins>+
+        this._updateSnapshotMarkers();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    updateSelectedRecord()
+    {
+        this._updateSnapshotMarkers();
+    }
+
</ins><span class="cx">     // Private
</span><span class="cx"> 
</span><ins>+    _updateSnapshotMarkers()
+    {
+        if (this._selectedImageElement)
+            this._selectedImageElement.classList.remove(&quot;selected&quot;);
+
+        if (!this.selectedRecord) {
+            this._selectedImageElement = null;
+            return;
+        }
+
+        let imageElement = this.selectedRecord[WebInspector.HeapAllocationsTimelineOverviewGraph.RecordElementAssociationSymbol];
+        console.assert(imageElement, &quot;Missing snapshot image element for selected record&quot;, this.selectedRecord);
+        imageElement.classList.add(&quot;selected&quot;);
+
+        this._selectedImageElement = imageElement;
+    }
+
</ins><span class="cx">     _visibleRecords(startTime, endTime)
</span><span class="cx">     {
</span><span class="cx">         let records = this._heapAllocationsTimeline.records;
</span><span class="lines">@@ -95,3 +127,5 @@
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="cx"> };
</span><ins>+
+WebInspector.HeapAllocationsTimelineOverviewGraph.RecordElementAssociationSymbol = Symbol(&quot;record-element-association&quot;);
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js (200766 => 200767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js        2016-05-12 09:36:00 UTC (rev 200766)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js        2016-05-12 10:34:16 UTC (rev 200767)
</span><span class="lines">@@ -191,9 +191,12 @@
</span><span class="cx">         return components.concat(this._contentViewContainer.currentContentView.selectionPathComponents);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    userSelectedRecordFromOverview(timelineRecord)
</del><ins>+    selectRecord(record)
</ins><span class="cx">     {
</span><del>-        this.showHeapSnapshotTimelineRecord(timelineRecord);
</del><ins>+        if (record)
+            this.showHeapSnapshotTimelineRecord(record);
+        else
+            this.showHeapSnapshotList();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     shown()
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsRenderingFrameTimelineOverviewGraphjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineOverviewGraph.js (200766 => 200767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineOverviewGraph.js        2016-05-12 09:36:00 UTC (rev 200766)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineOverviewGraph.js        2016-05-12 10:34:16 UTC (rev 200767)
</span><span class="lines">@@ -219,8 +219,6 @@
</span><span class="cx">         if (!this.selectedRecord) {
</span><span class="cx">             if (this._selectedFrameMarker.parentElement)
</span><span class="cx">                 this.element.removeChild(this._selectedFrameMarker);
</span><del>-
-            this.dispatchSelectedRecordChangedEvent();
</del><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -244,8 +242,6 @@
</span><span class="cx"> 
</span><span class="cx">         this._selectedTimelineRecordFrame = this._timelineRecordFrames[index];
</span><span class="cx">         this._selectedTimelineRecordFrame.selected = true;
</span><del>-
-        this.dispatchSelectedRecordChangedEvent();
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     _mouseClicked(event)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewGraphjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js (200766 => 200767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js        2016-05-12 09:36:00 UTC (rev 200766)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js        2016-05-12 10:34:16 UTC (rev 200767)
</span><span class="lines">@@ -226,16 +226,6 @@
</span><span class="cx"> 
</span><span class="cx">     // Protected
</span><span class="cx"> 
</span><del>-    dispatchSelectedRecordChangedEvent()
-    {
-        if (!this._selectedRecordChanged)
-            return;
-
-        this._selectedRecordChanged = false;
-
-        this.dispatchEventToListeners(WebInspector.TimelineOverviewGraph.Event.RecordSelected, {record: this.selectedRecord});
-    }
-
</del><span class="cx">     updateSelectedRecord()
</span><span class="cx">     {
</span><span class="cx">         // Implemented by sub-classes if needed.
</span><span class="lines">@@ -252,10 +242,12 @@
</span><span class="cx">         if (this._scheduledSelectedRecordLayoutUpdateIdentifier)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._scheduledSelectedRecordLayoutUpdateIdentifier = requestAnimationFrame(function() {
</del><ins>+        this._scheduledSelectedRecordLayoutUpdateIdentifier = requestAnimationFrame(() =&gt; {
</ins><span class="cx">             this._scheduledSelectedRecordLayoutUpdateIdentifier = undefined;
</span><ins>+
</ins><span class="cx">             this.updateSelectedRecord();
</span><del>-        }.bind(this));
</del><ins>+            this.dispatchEventToListeners(WebInspector.TimelineOverviewGraph.Event.RecordSelected, {record: this.selectedRecord});
+        });
</ins><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (200766 => 200767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2016-05-12 09:36:00 UTC (rev 200766)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2016-05-12 10:34:16 UTC (rev 200767)
</span><span class="lines">@@ -630,12 +630,13 @@
</span><span class="cx"> 
</span><span class="cx">     _recordSelected(event)
</span><span class="cx">     {
</span><del>-        let timelineView = this._timelineViewMap.get(event.data.timeline);
-        console.assert(timelineView === this.currentTimelineView, timelineView);
-        if (timelineView !== this.currentTimelineView)
-            return;
</del><ins>+        let {record, timeline} = event.data;
+        let timelineView = this._timelineViewMap.get(timeline);
</ins><span class="cx"> 
</span><del>-        timelineView.selectRecord(event.data.record);
</del><ins>+        if (record &amp;&amp; timelineView !== this.currentTimelineView)
+            this.showTimelineViewForTimeline(timeline);
+
+        timelineView.selectRecord(record);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     _timelineSelected()
</span></span></pre>
</div>
</div>

</body>
</html>