Diff
Modified: trunk/Source/WebCore/ChangeLog (260735 => 260736)
--- trunk/Source/WebCore/ChangeLog 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/ChangeLog 2020-04-27 01:02:58 UTC (rev 260736)
@@ -1,3 +1,51 @@
+2020-04-26 Said Abou-Hallawa <[email protected]>
+
+ Rendering update steps should use Seconds for the timestamps
+ https://bugs.webkit.org/show_bug.cgi?id=210990
+
+ Reviewed by Daniel Bates.
+
+ Make DOMWindow::nowTimestamp() return ReducedResolutionSeconds and change
+ the callers accordingly. ReducedResolutionSeconds is a new type but it's
+ just an alias of the type Seconds. It indicates that the returned value
+ is a web-safe seconds.
+
+ * Headers.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * animation/DocumentTimeline.cpp:
+ (WebCore::DocumentTimeline::suspendAnimations):
+ (WebCore::DocumentTimeline::liveCurrentTime const):
+ (WebCore::DocumentTimeline::cacheCurrentTime):
+ (WebCore::DocumentTimeline::documentWillUpdateAnimationsAndSendEvents):
+ * animation/DocumentTimeline.h:
+ * animation/DocumentTimelinesController.cpp:
+ (WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents):
+ * animation/DocumentTimelinesController.h:
+ * dom/Document.cpp:
+ (WebCore::Document::serviceRequestAnimationFrameCallbacks):
+ (WebCore::Document::updateIntersectionObservations):
+ * dom/Document.h:
+ * dom/ScriptedAnimationController.cpp:
+ (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
+ (WebCore::ScriptedAnimationController::scheduleAnimation):
+ * dom/ScriptedAnimationController.h:
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::nowTimestamp const):
+ * page/DOMWindow.h:
+ * page/IntersectionObserver.cpp:
+ (WebCore::IntersectionObserver::nowTimestamp const):
+ (WebCore::IntersectionObserver::createTimestamp const): Deleted.
+ * page/IntersectionObserver.h:
+ * page/Page.cpp:
+ (WebCore::Page::updateRendering):
+ * page/Performance.cpp:
+ (WebCore::Performance::now const):
+ (WebCore::Performance::nowInReducedResolutionSeconds const):
+ * page/Performance.h:
+ * page/ReducedResolutionSeconds.h: Added.
+
2020-04-26 Alexey Shvayka <[email protected]>
InternalFunction::createSubclassStructure should use newTarget's globalObject
Modified: trunk/Source/WebCore/Headers.cmake (260735 => 260736)
--- trunk/Source/WebCore/Headers.cmake 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/Headers.cmake 2020-04-27 01:02:58 UTC (rev 260736)
@@ -840,6 +840,7 @@
page/PrintContext.h
page/ProcessWarming.h
page/Quirks.h
+ page/ReducedResolutionSeconds.h
page/RemoteDOMWindow.h
page/RemoteFrame.h
page/RenderingUpdateScheduler.h
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (260735 => 260736)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-04-27 01:02:58 UTC (rev 260736)
@@ -1749,6 +1749,7 @@
555B87ED1CAAF0AB00349425 /* ImageDecoderCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */; };
556C7C4B22123997009B06CA /* RenderingUpdateScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 556C7C4722123942009B06CA /* RenderingUpdateScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
5576A5651D88A70800CCC04C /* ImageFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 5576A5631D88A70800CCC04C /* ImageFrame.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 5584765A2453F334009F550C /* ReducedResolutionSeconds.h in Headers */ = {isa = PBXBuildFile; fileRef = 558476582453ABC2009F550C /* ReducedResolutionSeconds.h */; settings = {ATTRIBUTES = (Private, ); }; };
55A336F91D821E3C0022C4C7 /* ImageBackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 55A336F81D821E3C0022C4C7 /* ImageBackingStore.h */; settings = {ATTRIBUTES = (Private, ); }; };
55AD093E2408963500DE4D2F /* DisplayListImageBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 72EA09F723FCCB3D008504A5 /* DisplayListImageBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
55AD09402408964000DE4D2F /* DisplayListDrawingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 72EA09F923FCCC6A008504A5 /* DisplayListDrawingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -8738,6 +8739,7 @@
556C7C4922123943009B06CA /* RenderingUpdateScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderingUpdateScheduler.cpp; sourceTree = "<group>"; };
5576A5621D88A70800CCC04C /* ImageFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageFrame.cpp; sourceTree = "<group>"; };
5576A5631D88A70800CCC04C /* ImageFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFrame.h; sourceTree = "<group>"; };
+ 558476582453ABC2009F550C /* ReducedResolutionSeconds.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReducedResolutionSeconds.h; sourceTree = "<group>"; };
5597FCCB2076C06800D35BB0 /* GlyphDisplayListCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlyphDisplayListCache.h; sourceTree = "<group>"; };
55A336F61D8209F40022C4C7 /* NativeImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeImage.h; sourceTree = "<group>"; };
55A336F81D821E3C0022C4C7 /* ImageBackingStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageBackingStore.h; sourceTree = "<group>"; };
@@ -21077,6 +21079,7 @@
E42050142141901A0066EF3B /* ProcessWarming.h */,
CD9A87F9215D6CF3006F17B5 /* Quirks.cpp */,
CD9A87FB215D6CF3006F17B5 /* Quirks.h */,
+ 558476582453ABC2009F550C /* ReducedResolutionSeconds.h */,
46B9518D207D632A00A7D2DD /* RemoteDOMWindow.cpp */,
46B9518E207D632A00A7D2DD /* RemoteDOMWindow.h */,
46BCBBC3208500A700710638 /* RemoteDOMWindow.idl */,
@@ -32428,6 +32431,7 @@
BC4368E80C226E32005EFB5F /* Rect.h in Headers */,
FD45A958175D414C00C21EC8 /* RectangleShape.h in Headers */,
5CEEE4361F5F8F210014A5F5 /* RectEdges.h in Headers */,
+ 5584765A2453F334009F550C /* ReducedResolutionSeconds.h in Headers */,
9831AE4A154225C900FE2644 /* ReferrerPolicy.h in Headers */,
BCAB418213E356E800D8AAF3 /* Region.h in Headers */,
26B9998F1803AE7200D01121 /* RegisterAllocator.h in Headers */,
Modified: trunk/Source/WebCore/animation/DocumentTimeline.cpp (260735 => 260736)
--- trunk/Source/WebCore/animation/DocumentTimeline.cpp 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/animation/DocumentTimeline.cpp 2020-04-27 01:02:58 UTC (rev 260736)
@@ -232,7 +232,7 @@
return;
if (!m_cachedCurrentTime)
- m_cachedCurrentTime = Seconds(liveCurrentTime());
+ m_cachedCurrentTime = liveCurrentTime();
for (const auto& animation : m_animations)
animation->setSuspended(true);
@@ -274,7 +274,7 @@
return count;
}
-DOMHighResTimeStamp DocumentTimeline::liveCurrentTime() const
+ReducedResolutionSeconds DocumentTimeline::liveCurrentTime() const
{
return m_document->domWindow()->nowTimestamp();
}
@@ -297,11 +297,11 @@
return m_cachedCurrentTime.value() - m_originTime;
}
-void DocumentTimeline::cacheCurrentTime(DOMHighResTimeStamp newCurrentTime)
+void DocumentTimeline::cacheCurrentTime(ReducedResolutionSeconds newCurrentTime)
{
ASSERT(m_document);
- m_cachedCurrentTime = Seconds(newCurrentTime);
+ m_cachedCurrentTime = newCurrentTime;
// We want to be sure to keep this time cached until we've both finished running JS and finished updating
// animations, so we schedule the invalidation task and register a whenIdle callback on the VM, which will
// fire syncronously if no JS is running.
@@ -361,7 +361,7 @@
return !m_animations.isEmpty() || !m_pendingAnimationEvents.isEmpty() || !m_acceleratedAnimationsPendingRunningStateChange.isEmpty();
}
-DocumentTimeline::ShouldUpdateAnimationsAndSendEvents DocumentTimeline::documentWillUpdateAnimationsAndSendEvents(DOMHighResTimeStamp timestamp)
+DocumentTimeline::ShouldUpdateAnimationsAndSendEvents DocumentTimeline::documentWillUpdateAnimationsAndSendEvents(ReducedResolutionSeconds timestamp)
{
// We need to freeze the current time even if no animation is running.
// document.timeline.currentTime may be called from a rAF callback and
Modified: trunk/Source/WebCore/animation/DocumentTimeline.h (260735 => 260736)
--- trunk/Source/WebCore/animation/DocumentTimeline.h 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/animation/DocumentTimeline.h 2020-04-27 01:02:58 UTC (rev 260736)
@@ -28,6 +28,7 @@
#include "AnimationTimeline.h"
#include "DocumentTimelineOptions.h"
#include "GenericTaskQueue.h"
+#include "ReducedResolutionSeconds.h"
#include "Timer.h"
#include <wtf/Markable.h>
#include <wtf/Ref.h>
@@ -74,7 +75,7 @@
void enqueueAnimationEvent(AnimationEventBase&);
enum class ShouldUpdateAnimationsAndSendEvents : uint8_t { Yes, No };
- ShouldUpdateAnimationsAndSendEvents documentWillUpdateAnimationsAndSendEvents(DOMHighResTimeStamp);
+ ShouldUpdateAnimationsAndSendEvents documentWillUpdateAnimationsAndSendEvents(ReducedResolutionSeconds);
void removeReplacedAnimations();
AnimationEvents prepareForPendingAnimationEventsDispatch();
void documentDidUpdateAnimationsAndSendEvents();
@@ -92,9 +93,9 @@
DocumentTimeline(Document&, Seconds);
DocumentTimelinesController* controller() const;
- DOMHighResTimeStamp liveCurrentTime() const;
+ ReducedResolutionSeconds liveCurrentTime() const;
void applyPendingAcceleratedAnimations();
- void cacheCurrentTime(DOMHighResTimeStamp);
+ void cacheCurrentTime(ReducedResolutionSeconds);
void maybeClearCachedCurrentTime();
void scheduleInvalidationTaskIfNeeded();
void scheduleAnimationResolution();
Modified: trunk/Source/WebCore/animation/DocumentTimelinesController.cpp (260735 => 260736)
--- trunk/Source/WebCore/animation/DocumentTimelinesController.cpp 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/animation/DocumentTimelinesController.cpp 2020-04-27 01:02:58 UTC (rev 260736)
@@ -61,7 +61,7 @@
m_timelines.begin()->detachFromDocument();
}
-void DocumentTimelinesController::updateAnimationsAndSendEvents(DOMHighResTimeStamp timestamp)
+void DocumentTimelinesController::updateAnimationsAndSendEvents(ReducedResolutionSeconds timestamp)
{
ASSERT(!m_timelines.hasNullReferences());
Modified: trunk/Source/WebCore/animation/DocumentTimelinesController.h (260735 => 260736)
--- trunk/Source/WebCore/animation/DocumentTimelinesController.h 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/animation/DocumentTimelinesController.h 2020-04-27 01:02:58 UTC (rev 260736)
@@ -25,7 +25,7 @@
#pragma once
-#include "DOMHighResTimeStamp.h"
+#include "ReducedResolutionSeconds.h"
#include <wtf/WeakHashSet.h>
namespace WebCore {
@@ -44,7 +44,7 @@
void addTimeline(DocumentTimeline&);
void removeTimeline(DocumentTimeline&);
void detachFromDocument();
- void updateAnimationsAndSendEvents(DOMHighResTimeStamp);
+ void updateAnimationsAndSendEvents(ReducedResolutionSeconds);
private:
struct AnimationsToProcess {
Modified: trunk/Source/WebCore/dom/Document.cpp (260735 => 260736)
--- trunk/Source/WebCore/dom/Document.cpp 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/dom/Document.cpp 2020-04-27 01:02:58 UTC (rev 260736)
@@ -6371,7 +6371,7 @@
m_scriptedAnimationController->resume();
}
-void Document::serviceRequestAnimationFrameCallbacks(DOMHighResTimeStamp timestamp)
+void Document::serviceRequestAnimationFrameCallbacks(ReducedResolutionSeconds timestamp)
{
if (m_scriptedAnimationController)
m_scriptedAnimationController->serviceRequestAnimationFrameCallbacks(timestamp);
@@ -7622,8 +7622,8 @@
for (const auto& observer : m_intersectionObservers) {
bool needNotify = false;
- DOMHighResTimeStamp timestamp;
- if (!observer->createTimestamp(timestamp))
+ auto timestamp = observer->nowTimestamp();
+ if (!timestamp)
continue;
for (Element* target : observer->observationTargets()) {
auto& targetRegistrations = target->intersectionObserverDataIfExists()->registrations;
@@ -7676,7 +7676,7 @@
}
observer->appendQueuedEntry(IntersectionObserverEntry::create({
- timestamp,
+ timestamp->milliseconds(),
reportedRootBounds,
{ targetBoundingClientRect.x(), targetBoundingClientRect.y(), targetBoundingClientRect.width(), targetBoundingClientRect.height() },
{ clientIntersectionRect.x(), clientIntersectionRect.y(), clientIntersectionRect.width(), clientIntersectionRect.height() },
Modified: trunk/Source/WebCore/dom/Document.h (260735 => 260736)
--- trunk/Source/WebCore/dom/Document.h 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/dom/Document.h 2020-04-27 01:02:58 UTC (rev 260736)
@@ -1080,7 +1080,7 @@
void suspendScriptedAnimationControllerCallbacks();
void resumeScriptedAnimationControllerCallbacks();
- void serviceRequestAnimationFrameCallbacks(DOMHighResTimeStamp);
+ void serviceRequestAnimationFrameCallbacks(ReducedResolutionSeconds);
void windowScreenDidChange(PlatformDisplayID);
Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.cpp (260735 => 260736)
--- trunk/Source/WebCore/dom/ScriptedAnimationController.cpp 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.cpp 2020-04-27 01:02:58 UTC (rev 260736)
@@ -193,7 +193,7 @@
}
}
-void ScriptedAnimationController::serviceRequestAnimationFrameCallbacks(DOMHighResTimeStamp timestamp)
+void ScriptedAnimationController::serviceRequestAnimationFrameCallbacks(ReducedResolutionSeconds timestamp)
{
if (!m_callbacks.size() || m_suspendCount || !requestAnimationFrameEnabled())
return;
@@ -200,7 +200,7 @@
TraceScope tracingScope(RAFCallbackStart, RAFCallbackEnd);
- auto highResNowMs = std::round(1000 * timestamp);
+ auto highResNowMs = timestamp.milliseconds();
if (m_document && m_document->quirks().needsMillisecondResolutionForHighResTimeStamp())
highResNowMs += 0.1;
@@ -273,7 +273,7 @@
return;
Seconds animationInterval = interval();
- Seconds scheduleDelay = std::max(animationInterval - Seconds(m_document->domWindow()->nowTimestamp() - m_lastAnimationFrameTimestamp), 0_s);
+ Seconds scheduleDelay = std::max(animationInterval - (m_document->domWindow()->nowTimestamp() - m_lastAnimationFrameTimestamp), 0_s);
if (isThrottled()) {
// FIXME: not ideal to snapshot time both in now() and nowTimestamp(), the latter of which also has reduced resolution.
Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.h (260735 => 260736)
--- trunk/Source/WebCore/dom/ScriptedAnimationController.h 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.h 2020-04-27 01:02:58 UTC (rev 260736)
@@ -53,7 +53,7 @@
CallbackId registerCallback(Ref<RequestAnimationFrameCallback>&&);
void cancelCallback(CallbackId);
- void serviceRequestAnimationFrameCallbacks(DOMHighResTimeStamp timestamp);
+ void serviceRequestAnimationFrameCallbacks(ReducedResolutionSeconds);
void suspend();
void resume();
@@ -86,7 +86,7 @@
int m_suspendCount { 0 };
Timer m_animationTimer;
- double m_lastAnimationFrameTimestamp { 0 };
+ ReducedResolutionSeconds m_lastAnimationFrameTimestamp { 0 };
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
OptionSet<ThrottlingReason> m_throttlingReasons;
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (260735 => 260736)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2020-04-27 01:02:58 UTC (rev 260736)
@@ -7110,7 +7110,7 @@
RefPtr<VideoPlaybackQuality> HTMLMediaElement::getVideoPlaybackQuality()
{
RefPtr<DOMWindow> domWindow = document().domWindow();
- double timestamp = domWindow ? 1000 * domWindow->nowTimestamp() : 0;
+ double timestamp = domWindow ? domWindow->nowTimestamp().milliseconds() : 0;
auto metrics = m_player ? m_player->videoPlaybackQualityMetrics() : WTF::nullopt;
if (!metrics)
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (260735 => 260736)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2020-04-27 01:02:58 UTC (rev 260736)
@@ -734,9 +734,9 @@
return *m_performance;
}
-double DOMWindow::nowTimestamp() const
+ReducedResolutionSeconds DOMWindow::nowTimestamp() const
{
- return performance().now() / 1000.;
+ return performance().nowInReducedResolutionSeconds();
}
Location& DOMWindow::location()
Modified: trunk/Source/WebCore/page/DOMWindow.h (260735 => 260736)
--- trunk/Source/WebCore/page/DOMWindow.h 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/page/DOMWindow.h 2020-04-27 01:02:58 UTC (rev 260736)
@@ -34,6 +34,7 @@
#include "FrameDestructionObserver.h"
#include "ImageBitmap.h"
#include "PostMessageOptions.h"
+#include "ReducedResolutionSeconds.h"
#include "ScrollToOptions.h"
#include "ScrollTypes.h"
#include "Supplementable.h"
@@ -349,7 +350,7 @@
#endif
Performance& performance() const;
- WEBCORE_EXPORT double nowTimestamp() const;
+ WEBCORE_EXPORT ReducedResolutionSeconds nowTimestamp() const;
#if PLATFORM(IOS_FAMILY)
void incrementScrollEventListenersCount();
Modified: trunk/Source/WebCore/page/IntersectionObserver.cpp (260735 => 260736)
--- trunk/Source/WebCore/page/IntersectionObserver.cpp 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/page/IntersectionObserver.cpp 2020-04-27 01:02:58 UTC (rev 260736)
@@ -244,21 +244,21 @@
m_root = nullptr;
}
-bool IntersectionObserver::createTimestamp(DOMHighResTimeStamp& timestamp) const
+Optional<ReducedResolutionSeconds> IntersectionObserver::nowTimestamp() const
{
if (!m_callback)
- return false;
+ return WTF::nullopt;
auto* context = m_callback->scriptExecutionContext();
if (!context)
- return false;
+ return WTF::nullopt;
+
ASSERT(context->isDocument());
auto& document = downcast<Document>(*context);
- if (auto* window = document.domWindow()) {
- timestamp = window->performance().now();
- return true;
- }
- return false;
+ if (auto* window = document.domWindow())
+ return window->nowTimestamp();
+
+ return WTF::nullopt;
}
void IntersectionObserver::appendQueuedEntry(Ref<IntersectionObserverEntry>&& entry)
Modified: trunk/Source/WebCore/page/IntersectionObserver.h (260735 => 260736)
--- trunk/Source/WebCore/page/IntersectionObserver.h 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/page/IntersectionObserver.h 2020-04-27 01:02:58 UTC (rev 260736)
@@ -94,7 +94,7 @@
bool hasObservationTargets() const { return m_observationTargets.size(); }
void rootDestroyed();
- bool createTimestamp(DOMHighResTimeStamp&) const;
+ Optional<ReducedResolutionSeconds> nowTimestamp() const;
void appendQueuedEntry(Ref<IntersectionObserverEntry>&&);
void notify();
Modified: trunk/Source/WebCore/page/Page.cpp (260735 => 260736)
--- trunk/Source/WebCore/page/Page.cpp 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/page/Page.cpp 2020-04-27 01:02:58 UTC (rev 260736)
@@ -1358,7 +1358,7 @@
forEachDocument([] (Document& document) {
if (!document.domWindow())
return;
- DOMHighResTimeStamp timestamp = document.domWindow()->nowTimestamp();
+ auto timestamp = document.domWindow()->nowTimestamp();
if (auto* timelinesController = document.timelinesController())
timelinesController->updateAnimationsAndSendEvents(timestamp);
// FIXME: Run the fullscreen steps.
Modified: trunk/Source/WebCore/page/Performance.cpp (260735 => 260736)
--- trunk/Source/WebCore/page/Performance.cpp 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/page/Performance.cpp 2020-04-27 01:02:58 UTC (rev 260736)
@@ -74,8 +74,13 @@
DOMHighResTimeStamp Performance::now() const
{
+ return nowInReducedResolutionSeconds().milliseconds();
+}
+
+ReducedResolutionSeconds Performance::nowInReducedResolutionSeconds() const
+{
Seconds now = MonotonicTime::now() - m_timeOrigin;
- return reduceTimeResolution(now).milliseconds();
+ return reduceTimeResolution(now);
}
Seconds Performance::reduceTimeResolution(Seconds seconds)
Modified: trunk/Source/WebCore/page/Performance.h (260735 => 260736)
--- trunk/Source/WebCore/page/Performance.h 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebCore/page/Performance.h 2020-04-27 01:02:58 UTC (rev 260736)
@@ -37,6 +37,7 @@
#include "EventTarget.h"
#include "ExceptionOr.h"
#include "GenericTaskQueue.h"
+#include "ReducedResolutionSeconds.h"
#include <wtf/ListHashSet.h>
namespace WebCore {
@@ -58,6 +59,7 @@
~Performance();
DOMHighResTimeStamp now() const;
+ ReducedResolutionSeconds nowInReducedResolutionSeconds() const;
PerformanceNavigation* navigation();
PerformanceTiming* timing();
Added: trunk/Source/WebCore/page/ReducedResolutionSeconds.h (0 => 260736)
--- trunk/Source/WebCore/page/ReducedResolutionSeconds.h (rev 0)
+++ trunk/Source/WebCore/page/ReducedResolutionSeconds.h 2020-04-27 01:02:58 UTC (rev 260736)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/Seconds.h>
+
+namespace WebCore {
+
+using ReducedResolutionSeconds = Seconds;
+
+}
+
Modified: trunk/Source/WebKit/ChangeLog (260735 => 260736)
--- trunk/Source/WebKit/ChangeLog 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebKit/ChangeLog 2020-04-27 01:02:58 UTC (rev 260736)
@@ -1,3 +1,13 @@
+2020-04-26 Said Abou-Hallawa <[email protected]>
+
+ Rendering update steps should use Seconds for the timestamps
+ https://bugs.webkit.org/show_bug.cgi?id=210990
+
+ Reviewed by Daniel Bates.
+
+ * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
+ (WebKit::CompositingCoordinator::timestamp const):
+
2020-04-26 Peng Liu <[email protected]>
Remove unused class PlaybackSessionInterface
Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp (260735 => 260736)
--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp 2020-04-27 00:37:15 UTC (rev 260735)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp 2020-04-27 01:02:58 UTC (rev 260736)
@@ -180,7 +180,7 @@
auto* document = m_page.corePage()->mainFrame().document();
if (!document)
return 0;
- return document->domWindow() ? document->domWindow()->nowTimestamp() : document->monotonicTimestamp();
+ return document->domWindow() ? document->domWindow()->nowTimestamp().seconds() : document->monotonicTimestamp();
}
void CompositingCoordinator::syncDisplayState()