Title: [252199] trunk/Source/WebInspectorUI
Revision
252199
Author
[email protected]
Date
2019-11-07 12:02:22 -0800 (Thu, 07 Nov 2019)

Log Message

Web Inspector: Timelines: add a marker for when a stop was requested
https://bugs.webkit.org/show_bug.cgi?id=203935

Reviewed by Timothy Hatcher.

After r244195, the Web Inspector frontend doesn't stop updating the current time marker
until after it receives all of the corresponding `*.trackingComplete` events. This means
that sometimes, the current time marker can move far past the time at which the stop was
requested, such as if there's a blocking script.

We should indicate where the stop was requested, as that is often right after a particular
issue is reproduced during a timeline recording, rather than have the user try to figure out
where they stopped.

Only keep a marker for the last stop request, and hide the marker once capturing resumes.

It's still useful to have the current time marker continue updating, as we should show all
the information we have about captured things, such as blocking scripts.

* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview):
(WI.TimelineOverview.prototype._handleTimelineCapturingStateChanged):

* UserInterface/Models/TimelineMarker.js:
* UserInterface/Views/TimelineRuler.js:
(WI.TimelineRuler.prototype.addMarker):
* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .markers > .marker.stopping-time): Added.
(.timeline-ruler > .markers > .marker.current-time):
(.timeline-ruler > .markers > .marker:matches(.stopping-time, .current-time)::after): Added.
(@media (prefers-color-scheme: dark) .timeline-ruler > .markers > .marker.stopping-time): Added.
(.timeline-ruler > .markers > .marker.current-time::after): Deleted.
Make the current time marker always on top (`z-index`).

* Localizations/en.lproj/localizedStrings.js:

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (252198 => 252199)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-11-07 19:59:31 UTC (rev 252198)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-11-07 20:02:22 UTC (rev 252199)
@@ -1,5 +1,43 @@
 2019-11-07  Devin Rousso  <[email protected]>
 
+        Web Inspector: Timelines: add a marker for when a stop was requested
+        https://bugs.webkit.org/show_bug.cgi?id=203935
+
+        Reviewed by Timothy Hatcher.
+
+        After r244195, the Web Inspector frontend doesn't stop updating the current time marker
+        until after it receives all of the corresponding `*.trackingComplete` events. This means
+        that sometimes, the current time marker can move far past the time at which the stop was
+        requested, such as if there's a blocking script.
+
+        We should indicate where the stop was requested, as that is often right after a particular
+        issue is reproduced during a timeline recording, rather than have the user try to figure out
+        where they stopped.
+
+        Only keep a marker for the last stop request, and hide the marker once capturing resumes.
+
+        It's still useful to have the current time marker continue updating, as we should show all
+        the information we have about captured things, such as blocking scripts.
+
+        * UserInterface/Views/TimelineOverview.js:
+        (WI.TimelineOverview):
+        (WI.TimelineOverview.prototype._handleTimelineCapturingStateChanged):
+
+        * UserInterface/Models/TimelineMarker.js:
+        * UserInterface/Views/TimelineRuler.js:
+        (WI.TimelineRuler.prototype.addMarker):
+        * UserInterface/Views/TimelineRuler.css:
+        (.timeline-ruler > .markers > .marker.stopping-time): Added.
+        (.timeline-ruler > .markers > .marker.current-time):
+        (.timeline-ruler > .markers > .marker:matches(.stopping-time, .current-time)::after): Added.
+        (@media (prefers-color-scheme: dark) .timeline-ruler > .markers > .marker.stopping-time): Added.
+        (.timeline-ruler > .markers > .marker.current-time::after): Deleted.
+        Make the current time marker always on top (`z-index`).
+
+        * Localizations/en.lproj/localizedStrings.js:
+
+2019-11-07  Devin Rousso  <[email protected]>
+
         Web Inspector: REGRESSION(r251958): automatic console prompt focusing prevents any "space" shortcuts from working
         https://bugs.webkit.org/show_bug.cgi?id=203939
 

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (252198 => 252199)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2019-11-07 19:59:31 UTC (rev 252198)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2019-11-07 20:02:22 UTC (rev 252199)
@@ -883,6 +883,7 @@
 localizedStrings["Recording Error: %s"] = "Recording Error: %s";
 localizedStrings["Recording Timeline Data"] = "Recording Timeline Data";
 localizedStrings["Recording Warning: %s"] = "Recording Warning: %s";
+localizedStrings["Recording stop requested \u2014 %s"] = "Recording stop requested \u2014 %s";
 localizedStrings["Recordings"] = "Recordings";
 localizedStrings["Redirect Response"] = "Redirect Response";
 localizedStrings["Redirects"] = "Redirects";

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js (252198 => 252199)


--- trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js	2019-11-07 19:59:31 UTC (rev 252198)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js	2019-11-07 20:02:22 UTC (rev 252199)
@@ -83,6 +83,7 @@
 };
 
 WI.TimelineMarker.Type = {
+    StoppingTime: "stopping-time",
     CurrentTime: "current-time",
     LoadEvent: "load-event",
     DOMContentEvent: "dom-content-event",

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (252198 => 252199)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2019-11-07 19:59:31 UTC (rev 252198)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2019-11-07 20:02:22 UTC (rev 252199)
@@ -85,6 +85,7 @@
         this._timelineRuler.addEventListener(WI.TimelineRuler.Event.TimeRangeSelectionChanged, this._timeRangeSelectionChanged, this);
         this.addSubview(this._timelineRuler);
 
+        this._stoppingTimeMarker = null;
         this._currentTimeMarker = new WI.TimelineMarker(0, WI.TimelineMarker.Type.CurrentTime);
         this._timelineRuler.addMarker(this._currentTimeMarker);
 
@@ -1029,11 +1030,24 @@
     _handleTimelineCapturingStateChanged(event)
     {
         switch (WI.timelineManager.capturingState) {
+        case WI.TimelineManager.CapturingState.Starting:
+            if (this._stoppingTimeMarker)
+                this._stoppingTimeMarker.time = -1; // Hide the marker when capturing resumes.
+            break;
+
         case WI.TimelineManager.CapturingState.Active:
             this._editInstrumentsButton.enabled = false;
             this._stopEditingInstruments();
             break;
 
+        case WI.TimelineManager.CapturingState.Stopping:
+            if (!this._stoppingTimeMarker) {
+                this._stoppingTimeMarker = new WI.TimelineMarker(this._currentTime, WI.TimelineMarker.Type.StoppingTime);
+                this._timelineRuler.addMarker(this._stoppingTimeMarker);
+            } else
+                this._stoppingTimeMarker.time = this._currentTime;
+            break;
+
         case WI.TimelineManager.CapturingState.Inactive:
             this._editInstrumentsButton.enabled = true;
             break;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css (252198 => 252199)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css	2019-11-07 19:59:31 UTC (rev 252198)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css	2019-11-07 20:02:22 UTC (rev 252199)
@@ -172,11 +172,16 @@
     right: var(--timeline-ruler-marker-after-offset);
 }
 
+.timeline-ruler > .markers > .marker.stopping-time {
+    color: hsl(0, 0%, 75%);
+}
+
 .timeline-ruler > .markers > .marker.current-time {
+    z-index: 1;
     color: red;
 }
 
-.timeline-ruler > .markers > .marker.current-time::after {
+.timeline-ruler > .markers > .marker:matches(.stopping-time, .current-time)::after {
     top: var(--timeline-ruler-marker-after-offset);
     width: var(--timeline-ruler-marker-after-size);
     height: var(--timeline-ruler-marker-after-size);
@@ -287,6 +292,10 @@
 }
 
 @media (prefers-color-scheme: dark) {
+    .timeline-ruler > .markers > .marker.stopping-time {
+        color: lightgrey;
+    }
+
     .timeline-ruler > .markers > .marker.dom-content-event {
         color: hsl(240, 100%, 70%);
     }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js (252198 => 252199)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js	2019-11-07 19:59:31 UTC (rev 252198)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js	2019-11-07 20:02:22 UTC (rev 252199)
@@ -348,6 +348,9 @@
         markerElement.classList.add(marker.type, "marker");
 
         switch (marker.type) {
+        case WI.TimelineMarker.Type.StoppingTime:
+            markerElement.title = WI.UIString("Recording stop requested \u2014 %s").format(Number.secondsToString(markerTime));
+            break;
         case WI.TimelineMarker.Type.LoadEvent:
             markerElement.title = WI.UIString("Load \u2014 %s").format(Number.secondsToString(markerTime));
             break;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to