Title: [293631] trunk/Source/WebInspectorUI
Revision
293631
Author
pan...@apple.com
Date
2022-04-29 14:50:20 -0700 (Fri, 29 Apr 2022)

Log Message

Web Inspector: Regression(r267038) Import a timeline does not render the timeline, only lists the events
https://bugs.webkit.org/show_bug.cgi?id=239872

Reviewed by Devin Rousso.

Two issues existed after r267038 that prevented the timeline overview from rendering correctly for imported
recordings. The first is that the timeline view itself was not visible as the result of assuming that we would
already be in middle of layout when inside `WI.TimelineRecordingContentView.prototype._updateTimes`, which isn't
true for the updating of times when importing a recording. In that case, syncronously attempting to lay out the
view means that the layout, including initial layout, will be performed before the view is attached, which means
we are unable to get the clientWidth of the view's element during layout, which in turn prevents us from
painting the timeline ruler.

The second issue is that when importing a timeline, we should ignore the current capturing state when setting
the current, start, and end times, otherwise not all the values will be kept.

* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._updateTimes):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (293630 => 293631)


--- trunk/Source/WebInspectorUI/ChangeLog	2022-04-29 21:38:40 UTC (rev 293630)
+++ trunk/Source/WebInspectorUI/ChangeLog	2022-04-29 21:50:20 UTC (rev 293631)
@@ -1,3 +1,25 @@
+2022-04-29  Patrick Angle  <pan...@apple.com>
+
+        Web Inspector: Regression(r267038) Import a timeline does not render the timeline, only lists the events
+        https://bugs.webkit.org/show_bug.cgi?id=239872
+
+        Reviewed by Devin Rousso.
+
+        Two issues existed after r267038 that prevented the timeline overview from rendering correctly for imported
+        recordings. The first is that the timeline view itself was not visible as the result of assuming that we would
+        already be in middle of layout when inside `WI.TimelineRecordingContentView.prototype._updateTimes`, which isn't
+        true for the updating of times when importing a recording. In that case, syncronously attempting to lay out the
+        view means that the layout, including initial layout, will be performed before the view is attached, which means
+        we are unable to get the clientWidth of the view's element during layout, which in turn prevents us from
+        painting the timeline ruler.
+
+        The second issue is that when importing a timeline, we should ignore the current capturing state when setting
+        the current, start, and end times, otherwise not all the values will be kept.
+
+        * UserInterface/Views/TimelineRecordingContentView.js:
+        (WI.TimelineRecordingContentView):
+        (WI.TimelineRecordingContentView.prototype._updateTimes):
+
 2022-04-27  Devin Rousso  <drou...@apple.com>
 
         Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'this.resource.hadLoadingError')

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (293630 => 293631)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js	2022-04-29 21:38:40 UTC (rev 293630)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js	2022-04-29 21:50:20 UTC (rev 293631)
@@ -476,11 +476,11 @@
             this._startTimeNeedsReset = false;
         }
 
-        if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Stopping) {
+        if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Stopping || this._recording.imported) {
             // Only update end time while not stopping, otherwise the interface continues scrolling.
             this._timelineOverview.endTime = Math.max(endTime, currentTime);
 
-            if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Inactive) {
+            if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Inactive || this._recording.imported) {
                 // Only update current time while active/starting or else the interface continues scrolling.
                 this._currentTime = currentTime;
                 this._timelineOverview.currentTime = currentTime;
@@ -490,10 +490,14 @@
         if (this.currentTimelineView)
             this._updateTimelineViewTimes(this.currentTimelineView);
 
-        // Force a layout now since we are already in an animation frame and don't need to delay it until the next.
-        this._timelineOverview.updateLayoutIfNeeded();
-        if (this.currentTimelineView)
-            this.currentTimelineView.updateLayoutIfNeeded();
+        if (this._recording.imported) {
+            this._timelineOverview.needsLayout();
+            this.currentTimelineView?.needsLayout();
+        } else {
+            // Force a layout now since we are already in an animation frame and don't need to delay it until the next.
+            this._timelineOverview.updateLayoutIfNeeded();
+            this.currentTimelineView?.updateLayoutIfNeeded();
+        }
     }
 
     _startUpdatingCurrentTime(startTime)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to