From 67df248e7600f16673d6fc2385fe07b429001873 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 30 Aug 2014 00:56:35 -0400 Subject: [PATCH] Bug 908390 followup. Fix up event timestamps on workers, and enable the test that was supposed to test for it. r=khuey pending --- dom/events/Event.cpp | 8 +++----- dom/events/test/test_eventTimeStamp.html | 18 ++++++------------ dom/workers/WorkerPrivate.cpp | 6 +++--- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index e0e53496bcb0..ff96b4acfde6 100644 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -997,16 +997,14 @@ Event::TimeStamp() const } // For dedicated workers, we should make times relative to the navigation - // start of the document that created the worker. We currently don't have - // that information handy so for now we treat shared workers and dedicated - // workers alike and make times relative to the worker creation time. We can - // fix this when we implement WorkerPerformance. + // start of the document that created the worker, which is the same as the + // timebase for performance.now(). workers::WorkerPrivate* workerPrivate = workers::GetCurrentThreadWorkerPrivate(); MOZ_ASSERT(workerPrivate); TimeDuration duration = - mEvent->timeStamp - workerPrivate->CreationTimeStamp(); + mEvent->timeStamp - workerPrivate->NowBaseTimeStamp(); return duration.ToMilliseconds(); } diff --git a/dom/events/test/test_eventTimeStamp.html b/dom/events/test/test_eventTimeStamp.html index ccb15cd7f8a7..bcf1bcb8d4c7 100644 --- a/dom/events/test/test_eventTimeStamp.html +++ b/dom/events/test/test_eventTimeStamp.html @@ -16,14 +16,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=77992