зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1267510 part 2 - Add origin time invariant to DocumentTimeline. r=birtles
MozReview-Commit-ID: Kf7PzzAH9Tj --HG-- extra : rebase_source : 1cb1ff9f06c778d55f8a4a6beedccba946a31fbc
This commit is contained in:
Родитель
63ef5e7f82
Коммит
a9ead4dd43
|
@ -88,7 +88,9 @@ DocumentTimeline::ToTimelineTime(const TimeStamp& aTimeStamp) const
|
|||
return result;
|
||||
}
|
||||
|
||||
result.SetValue(aTimeStamp - timing->GetNavigationStartTimeStamp());
|
||||
result.SetValue(aTimeStamp
|
||||
- timing->GetNavigationStartTimeStamp()
|
||||
- mOriginTime);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -204,7 +206,7 @@ DocumentTimeline::ToTimeStamp(const TimeDuration& aTimeDuration) const
|
|||
return result;
|
||||
}
|
||||
|
||||
result = timing->GetNavigationStartTimeStamp() + aTimeDuration;
|
||||
result = timing->GetNavigationStartTimeStamp() + aTimeDuration + mOriginTime;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,10 +28,11 @@ class DocumentTimeline final
|
|||
, public nsARefreshObserver
|
||||
{
|
||||
public:
|
||||
explicit DocumentTimeline(nsIDocument* aDocument)
|
||||
DocumentTimeline(nsIDocument* aDocument, const TimeDuration& aOriginTime)
|
||||
: AnimationTimeline(aDocument->GetParentObject())
|
||||
, mDocument(aDocument)
|
||||
, mIsObservingRefreshDriver(false)
|
||||
, mOriginTime(aOriginTime)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -84,6 +85,8 @@ protected:
|
|||
// iframe).
|
||||
mutable TimeStamp mLastRefreshDriverTime;
|
||||
bool mIsObservingRefreshDriver;
|
||||
|
||||
TimeDuration mOriginTime;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -3241,7 +3241,7 @@ DocumentTimeline*
|
|||
nsDocument::Timeline()
|
||||
{
|
||||
if (!mDocumentTimeline) {
|
||||
mDocumentTimeline = new DocumentTimeline(this);
|
||||
mDocumentTimeline = new DocumentTimeline(this, TimeDuration(0));
|
||||
}
|
||||
|
||||
return mDocumentTimeline;
|
||||
|
|
Загрузка…
Ссылка в новой задаче