Title: [239421] trunk/Source/WebInspectorUI
Revision
239421
Author
drou...@apple.com
Date
2018-12-19 19:57:10 -0800 (Wed, 19 Dec 2018)

Log Message

Web Inspector: REGRESSION (r237195): Timelines: selecting a rendering frame row moves the time selection
https://bugs.webkit.org/show_bug.cgi?id=192773
<rdar://problem/46782446>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview.prototype._recordSelected):
The Frames timeline uses `frameIndex` instead of `startTime`/`endTime`, so when trying to
ensure that the selected record is within the filtered range, use `frameIndex` instead.
The associated `WI.TimelineRuler` will already be using an index-based approach for
selection, so this will match.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (239420 => 239421)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-12-20 03:56:27 UTC (rev 239420)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-12-20 03:57:10 UTC (rev 239421)
@@ -1,5 +1,20 @@
 2018-12-19  Devin Rousso  <drou...@apple.com>
 
+        Web Inspector: REGRESSION (r237195): Timelines: selecting a rendering frame row moves the time selection
+        https://bugs.webkit.org/show_bug.cgi?id=192773
+        <rdar://problem/46782446>
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/TimelineOverview.js:
+        (WI.TimelineOverview.prototype._recordSelected):
+        The Frames timeline uses `frameIndex` instead of `startTime`/`endTime`, so when trying to
+        ensure that the selected record is within the filtered range, use `frameIndex` instead.
+        The associated `WI.TimelineRuler` will already be using an index-based approach for
+        selection, so this will match.
+
+2018-12-19  Devin Rousso  <drou...@apple.com>
+
         Web Inspector: Canvas: the recording auto-capture input shouldn't start focused
         https://bugs.webkit.org/show_bug.cgi?id=192454
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (239420 => 239421)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2018-12-20 03:56:27 UTC (rev 239420)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2018-12-20 03:57:10 UTC (rev 239421)
@@ -733,10 +733,13 @@
                 lastRecord = recordBar.records.lastValue;
             }
 
-            if (firstRecord.startTime < this.selectionStartTime || lastRecord.endTime > this.selectionStartTime + this.selectionDuration) {
+            let startTime = firstRecord instanceof WI.RenderingFrameTimelineRecord ? firstRecord.frameIndex : firstRecord.startTime;
+            let endTime = lastRecord instanceof WI.RenderingFrameTimelineRecord ? lastRecord.frameIndex : lastRecord.startTime;
+
+            if (startTime < this.selectionStartTime || endTime > this.selectionStartTime + this.selectionDuration) {
                 let selectionPadding = this.secondsPerPixel * 10;
-                this.selectionStartTime = firstRecord.startTime - selectionPadding;
-                this.selectionDuration = lastRecord.endTime - firstRecord.startTime + (selectionPadding * 2);
+                this.selectionStartTime = startTime - selectionPadding;
+                this.selectionDuration = endTime - startTime + (selectionPadding * 2);
             }
         }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to