Changeset 252199 in webkit


Ignore:
Timestamp:
Nov 7, 2019 12:02:22 PM (5 years ago)
Author:
Devin Rousso
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:
Location:
trunk/Source/WebInspectorUI
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r252198 r252199  
     12019-11-07  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Timelines: add a marker for when a stop was requested
     4        https://bugs.webkit.org/show_bug.cgi?id=203935
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        After r244195, the Web Inspector frontend doesn't stop updating the current time marker
     9        until after it receives all of the corresponding `*.trackingComplete` events. This means
     10        that sometimes, the current time marker can move far past the time at which the stop was
     11        requested, such as if there's a blocking script.
     12
     13        We should indicate where the stop was requested, as that is often right after a particular
     14        issue is reproduced during a timeline recording, rather than have the user try to figure out
     15        where they stopped.
     16
     17        Only keep a marker for the last stop request, and hide the marker once capturing resumes.
     18
     19        It's still useful to have the current time marker continue updating, as we should show all
     20        the information we have about captured things, such as blocking scripts.
     21
     22        * UserInterface/Views/TimelineOverview.js:
     23        (WI.TimelineOverview):
     24        (WI.TimelineOverview.prototype._handleTimelineCapturingStateChanged):
     25
     26        * UserInterface/Models/TimelineMarker.js:
     27        * UserInterface/Views/TimelineRuler.js:
     28        (WI.TimelineRuler.prototype.addMarker):
     29        * UserInterface/Views/TimelineRuler.css:
     30        (.timeline-ruler > .markers > .marker.stopping-time): Added.
     31        (.timeline-ruler > .markers > .marker.current-time):
     32        (.timeline-ruler > .markers > .marker:matches(.stopping-time, .current-time)::after): Added.
     33        (@media (prefers-color-scheme: dark) .timeline-ruler > .markers > .marker.stopping-time): Added.
     34        (.timeline-ruler > .markers > .marker.current-time::after): Deleted.
     35        Make the current time marker always on top (`z-index`).
     36
     37        * Localizations/en.lproj/localizedStrings.js:
     38
    1392019-11-07  Devin Rousso  <drousso@apple.com>
    240
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r252063 r252199  
    884884localizedStrings["Recording Timeline Data"] = "Recording Timeline Data";
    885885localizedStrings["Recording Warning: %s"] = "Recording Warning: %s";
     886localizedStrings["Recording stop requested \u2014 %s"] = "Recording stop requested \u2014 %s";
    886887localizedStrings["Recordings"] = "Recordings";
    887888localizedStrings["Redirect Response"] = "Redirect Response";
  • trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js

    r243024 r252199  
    8484
    8585WI.TimelineMarker.Type = {
     86    StoppingTime: "stopping-time",
    8687    CurrentTime: "current-time",
    8788    LoadEvent: "load-event",
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js

    r245498 r252199  
    8686        this.addSubview(this._timelineRuler);
    8787
     88        this._stoppingTimeMarker = null;
    8889        this._currentTimeMarker = new WI.TimelineMarker(0, WI.TimelineMarker.Type.CurrentTime);
    8990        this._timelineRuler.addMarker(this._currentTimeMarker);
     
    10301031    {
    10311032        switch (WI.timelineManager.capturingState) {
     1033        case WI.TimelineManager.CapturingState.Starting:
     1034            if (this._stoppingTimeMarker)
     1035                this._stoppingTimeMarker.time = -1; // Hide the marker when capturing resumes.
     1036            break;
     1037
    10321038        case WI.TimelineManager.CapturingState.Active:
    10331039            this._editInstrumentsButton.enabled = false;
    10341040            this._stopEditingInstruments();
     1041            break;
     1042
     1043        case WI.TimelineManager.CapturingState.Stopping:
     1044            if (!this._stoppingTimeMarker) {
     1045                this._stoppingTimeMarker = new WI.TimelineMarker(this._currentTime, WI.TimelineMarker.Type.StoppingTime);
     1046                this._timelineRuler.addMarker(this._stoppingTimeMarker);
     1047            } else
     1048                this._stoppingTimeMarker.time = this._currentTime;
    10351049            break;
    10361050
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css

    r242194 r252199  
    173173}
    174174
     175.timeline-ruler > .markers > .marker.stopping-time {
     176    color: hsl(0, 0%, 75%);
     177}
     178
    175179.timeline-ruler > .markers > .marker.current-time {
     180    z-index: 1;
    176181    color: red;
    177182}
    178183
    179 .timeline-ruler > .markers > .marker.current-time::after {
     184.timeline-ruler > .markers > .marker:matches(.stopping-time, .current-time)::after {
    180185    top: var(--timeline-ruler-marker-after-offset);
    181186    width: var(--timeline-ruler-marker-after-size);
     
    288293
    289294@media (prefers-color-scheme: dark) {
     295    .timeline-ruler > .markers > .marker.stopping-time {
     296        color: lightgrey;
     297    }
     298
    290299    .timeline-ruler > .markers > .marker.dom-content-event {
    291300        color: hsl(240, 100%, 70%);
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js

    r242567 r252199  
    349349
    350350        switch (marker.type) {
     351        case WI.TimelineMarker.Type.StoppingTime:
     352            markerElement.title = WI.UIString("Recording stop requested \u2014 %s").format(Number.secondsToString(markerTime));
     353            break;
    351354        case WI.TimelineMarker.Type.LoadEvent:
    352355            markerElement.title = WI.UIString("Load \u2014 %s").format(Number.secondsToString(markerTime));
Note: See TracChangeset for help on using the changeset viewer.