https://bugs.webkit.org/show_bug.cgi?id=150178
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-10-27
Reviewed by Brian Burg.
* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype.capturingStarted):
* UserInterface/Models/TimelineRecording.js:
(WebInspector.TimelineRecording.prototype.initializeTimeBoundsIfNecessary):
For a recording to start updating current time the recording itself
must have a start time. Provide a setter so that the start time can
be set without waiting for a timeline record. For example the
timestamp that the frontend receives when it starts a recording.
* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._startUpdatingCurrentTime):
When we have a startTime number (new backends) always use it as the current time.
Previously we were only doing this if current time was NaN, which would be when
re-starting a recording after it had stopped, but not for the initial recording
after opening the inspector.
* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype.updateLayout):
Even if we do not need to create new time dividers we may need to perform
other updates like update the current time marker. So do work before bailing.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191639
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-10-27 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Timeline current time marker does not start moving when starting recording after just opening inspector
+ https://bugs.webkit.org/show_bug.cgi?id=150178
+
+ Reviewed by Brian Burg.
+
+ * UserInterface/Controllers/TimelineManager.js:
+ (WebInspector.TimelineManager.prototype.capturingStarted):
+ * UserInterface/Models/TimelineRecording.js:
+ (WebInspector.TimelineRecording.prototype.initializeTimeBoundsIfNecessary):
+ For a recording to start updating current time the recording itself
+ must have a start time. Provide a setter so that the start time can
+ be set without waiting for a timeline record. For example the
+ timestamp that the frontend receives when it starts a recording.
+
+ * UserInterface/Views/TimelineRecordingContentView.js:
+ (WebInspector.TimelineRecordingContentView.prototype._startUpdatingCurrentTime):
+ When we have a startTime number (new backends) always use it as the current time.
+ Previously we were only doing this if current time was NaN, which would be when
+ re-starting a recording after it had stopped, but not for the initial recording
+ after opening the inspector.
+
+ * UserInterface/Views/TimelineRuler.js:
+ (WebInspector.TimelineRuler.prototype.updateLayout):
+ Even if we do not need to create new time dividers we may need to perform
+ other updates like update the current time marker. So do work before bailing.
+
2015-10-26 Matt Baker <mattbaker@apple.com>
Web Inspector: WebInspector.Object can dispatch constructor-level events multiple times
this._isCapturing = true;
+ if (startTime)
+ this.activeRecording.initializeTimeBoundsIfNecessary(startTime);
+
this.dispatchEventToListeners(WebInspector.TimelineManager.Event.CapturingStarted, {startTime});
}
this._legacyFirstRecordedTimestamp = timestamp;
}
+ initializeTimeBoundsIfNecessary(timestamp)
+ {
+ if (isNaN(this._startTime)) {
+ console.assert(isNaN(this._endTime));
+
+ this._startTime = timestamp;
+ this._endTime = timestamp;
+
+ this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.TimesUpdated);
+ }
+ }
+
// Private
_keyForRecord(record)
if (this._updating)
return;
- if (!isNaN(this._currentTime)) {
+ if (typeof startTime === "number")
+ this._currentTime = startTime;
+ else if (!isNaN(this._currentTime)) {
// This happens when you stop and later restart recording.
- if (typeof startTime === "number")
- this._currentTime = startTime;
- else {
- // COMPATIBILITY (iOS 9): Timeline.recordingStarted events did not include a timestamp.
- // We likely need to jump into the future to a better current time which we can
- // ascertained from a new incoming timeline record, so we wait for a Timeline to update.
- console.assert(!this._waitingToResetCurrentTime);
- this._waitingToResetCurrentTime = true;
- this._recording.addEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
- }
+ // COMPATIBILITY (iOS 9): Timeline.recordingStarted events did not include a timestamp.
+ // We likely need to jump into the future to a better current time which we can
+ // ascertained from a new incoming timeline record, so we wait for a Timeline to update.
+ console.assert(!this._waitingToResetCurrentTime);
+ this._waitingToResetCurrentTime = true;
+ this._recording.addEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
}
this._updating = true;
lastTime: lastDividerTime,
};
- if (Object.shallowEqual(dividerData, this._currentDividers))
+ if (Object.shallowEqual(dividerData, this._currentDividers)) {
+ this._updateMarkers(visibleWidth, duration);
+ this._updateSelection(visibleWidth, duration);
return;
+ }
+
this._currentDividers = dividerData;
var markerDividers = this._markersElement.querySelectorAll("." + WebInspector.TimelineRuler.DividerElementStyleClassName);