WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-154246-20170921124039.patch (text/plain), 115.07 KB, created by
Chris Dumez
on 2017-09-21 12:40:40 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2017-09-21 12:40:40 PDT
Size:
115.07 KB
patch
obsolete
>Subversion Revision: 222321 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6d92cf4ad65179a6f09685758fe902713258af4a..9b560d20083be13b51cc2bfc10556affd48ef4ef 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,101 @@ >+2017-09-21 Chris Dumez <cdumez@apple.com> >+ >+ Use high resolution timestamp for event time >+ https://bugs.webkit.org/show_bug.cgi?id=154246 >+ <rdar://problem/34333304> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Have event.timeStamp return a DOMHighResTimeStamp instead of a DOMResTimeStamp. It now >+ has better precision, is monotonic and is relative to PerformanceTiming.navigationStart. >+ >+ This is as per: >+ - https://dom.spec.whatwg.org/#interface-event >+ >+ Chrome, Firefox and Edge all already ship this so the compatibility risk should be low. >+ >+ Also use WallTime / MonotonicTime instead of double type for clarity. >+ >+ Test: imported/w3c/web-platform-tests/dom/events/Event-timestamp-high-resolution.html >+ >+ * WebCore.xcodeproj/project.pbxproj: >+ * dom/DOMHighResTimeStamp.h: Copied from Source/WebKit/Shared/WebTouchEvent.cpp. >+ * dom/Element.cpp: >+ (WebCore::Element::dispatchMouseForceWillBegin): >+ * dom/Event.cpp: >+ (WebCore::Event::Event): >+ (WebCore::Event::timeStampForBindings const): >+ * dom/Event.h: >+ (WebCore::Event::timeStamp const): >+ * dom/Event.idl: >+ * dom/KeyboardEvent.cpp: >+ (WebCore::KeyboardEvent::KeyboardEvent): >+ * dom/MouseEvent.cpp: >+ (WebCore::MouseEvent::create): >+ (WebCore::MouseEvent::MouseEvent): >+ * dom/MouseEvent.h: >+ * dom/MouseRelatedEvent.cpp: >+ (WebCore::MouseRelatedEvent::MouseRelatedEvent): >+ * dom/MouseRelatedEvent.h: >+ * dom/SimulatedClick.cpp: >+ * dom/TouchEvent.cpp: >+ (WebCore::TouchEvent::TouchEvent): >+ * dom/UIEvent.cpp: >+ (WebCore::UIEvent::UIEvent): >+ * dom/UIEvent.h: >+ * dom/UIEventWithKeyState.h: >+ (WebCore::UIEventWithKeyState::UIEventWithKeyState): >+ * dom/WheelEvent.cpp: >+ (WebCore::WheelEvent::WheelEvent): >+ * html/TypeAhead.cpp: >+ (WebCore::TypeAhead::TypeAhead): >+ (WebCore::TypeAhead::handleEvent): >+ * html/TypeAhead.h: >+ * page/AutoscrollController.cpp: >+ (WebCore::AutoscrollController::AutoscrollController): >+ (WebCore::AutoscrollController::updateDragAndDrop): >+ (WebCore::AutoscrollController::autoscrollTimerFired): >+ * page/AutoscrollController.h: >+ * page/ContextMenuController.cpp: >+ (WebCore::ContextMenuController::showContextMenuAt): >+ * page/DragController.cpp: >+ (WebCore::createMouseEvent): >+ * page/EventHandler.cpp: >+ (WebCore::EventHandler::dispatchDragEvent): >+ (WebCore::EventHandler::sendContextMenuEventForKey): >+ (WebCore::EventHandler::fakeMouseMoveEventTimerFired): >+ * page/EventHandler.h: >+ * page/Performance.cpp: >+ (WebCore::Performance::now const): >+ (WebCore::Performance::monotonicTimeToHighResTimeStamp const): >+ * page/Performance.h: >+ * page/ios/EventHandlerIOS.mm: >+ (WebCore::EventHandler::tryToBeginDataInteractionAtPoint): >+ * page/win/EventHandlerWin.cpp: >+ * platform/PlatformEvent.h: >+ (WebCore::PlatformEvent::timestamp const): >+ (WebCore::PlatformEvent::PlatformEvent): >+ * platform/PlatformKeyboardEvent.h: >+ (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): >+ * platform/PlatformMouseEvent.h: >+ (WebCore::PlatformMouseEvent::PlatformMouseEvent): >+ * platform/PlatformWheelEvent.h: >+ (WebCore::PlatformWheelEvent::PlatformWheelEvent): >+ * platform/cocoa/ScrollController.mm: >+ (WebCore::ScrollController::handleWheelEvent): >+ * platform/glib/EventHandlerGLib.cpp: >+ * platform/gtk/ScrollAnimatorGtk.cpp: >+ (WebCore::ScrollAnimatorGtk::computeVelocity): >+ (WebCore::ScrollAnimatorGtk::handleWheelEvent): >+ * platform/ios/PlatformEventFactoryIOS.mm: >+ (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder): >+ (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): >+ (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): >+ (WebCore::PlatformTouchEventBuilder::PlatformTouchEventBuilder): >+ * platform/mac/PlatformEventFactoryMac.h: >+ * platform/mac/PlatformEventFactoryMac.mm: >+ (WebCore::eventTimeStampSince1970): >+ > 2017-09-21 Zhifei FANG <facetothefate@gmail.com> > > In regular block layout, the width of a child's margin box should always be equal to that of its containing block >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 81565adee61a6267c6db548256e3adb797b5b9f9..68a12452c4bdcf3fddd0ae06186437fe9884a1dc 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,5 +1,76 @@ > 2017-09-21 Chris Dumez <cdumez@apple.com> > >+ Use high resolution timestamp for event time >+ https://bugs.webkit.org/show_bug.cgi?id=154246 >+ <rdar://problem/34333304> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use WallTime / MonotonicTime instead of double type for clarity. >+ >+ * Shared/WebCoreArgumentCoders.cpp: >+ (IPC::ArgumentCoder<WallTime>::encode): >+ (IPC::ArgumentCoder<WallTime>::decode): >+ * Shared/WebCoreArgumentCoders.h: >+ * Shared/WebEvent.cpp: >+ (WebKit::WebEvent::WebEvent): >+ * Shared/WebEvent.h: >+ (WebKit::WebEvent::timestamp const): >+ (WebKit::WebTouchEvent::WebTouchEvent): >+ * Shared/WebKeyboardEvent.cpp: >+ (WebKit::WebKeyboardEvent::WebKeyboardEvent): >+ * Shared/WebMouseEvent.cpp: >+ (WebKit::WebMouseEvent::WebMouseEvent): >+ * Shared/WebTouchEvent.cpp: >+ (WebKit::WebTouchEvent::WebTouchEvent): >+ * Shared/WebWheelEvent.cpp: >+ (WebKit::WebWheelEvent::WebWheelEvent): >+ * Shared/gtk/WebEventFactory.cpp: >+ (WebKit::WebEventFactory::createWebMouseEvent): >+ (WebKit::WebEventFactory::createWebWheelEvent): >+ (WebKit::WebEventFactory::createWebKeyboardEvent): >+ (WebKit::WebEventFactory::createWebTouchEvent): >+ * Shared/ios/NativeWebTouchEventIOS.mm: >+ (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): >+ * Shared/ios/WebIOSEventFactory.mm: >+ (WebIOSEventFactory::createWebKeyboardEvent): >+ * Shared/mac/NativeWebGestureEventMac.mm: >+ (WebKit::NativeWebGestureEvent::NativeWebGestureEvent): >+ * Shared/mac/WebEventFactory.mm: >+ (WebKit::WebEventFactory::createWebMouseEvent): >+ (WebKit::WebEventFactory::createWebWheelEvent): >+ (WebKit::WebEventFactory::createWebKeyboardEvent): >+ * Shared/mac/WebGestureEvent.h: >+ (WebKit::WebGestureEvent::WebGestureEvent): >+ * Shared/wpe/WebEventFactory.cpp: >+ (WebKit::WebEventFactory::createWebKeyboardEvent): >+ (WebKit::WebEventFactory::createWebMouseEvent): >+ (WebKit::WebEventFactory::createWebWheelEvent): >+ (WebKit::WebEventFactory::createWebTouchEvent): >+ * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: >+ (WKBundlePageSimulateMouseDown): >+ (WKBundlePageSimulateMouseUp): >+ (WKBundlePageSimulateMouseMotion): >+ * WebProcess/Plugins/PDF/PDFPlugin.mm: >+ (WebKit::PDFPlugin::showContextMenuAtPoint): >+ * WebProcess/Plugins/PluginView.cpp: >+ (WebKit::PluginView::createWebEvent const): >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): >+ (WebKit::WebPage::contextMenuAtPointInWindow): >+ (WebKit::WebPage::dragEnded): >+ (WebKit::WebPage::simulateMouseDown): >+ (WebKit::WebPage::simulateMouseUp): >+ (WebKit::WebPage::simulateMouseMotion): >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::handleSyntheticClick): >+ (WebKit::WebPage::completeSyntheticClick): >+ (WebKit::WebPage::requestAdditionalItemsForDragSession): >+ (WebKit::WebPage::inspectorNodeSearchMovedToPosition): >+ >+2017-09-21 Chris Dumez <cdumez@apple.com> >+ > Unreviewed, temporarily disable assertion added in r222308 while I investigate. > > * UIProcess/WebFrameProxy.cpp: >diff --git a/Source/WebKitLegacy/ios/ChangeLog b/Source/WebKitLegacy/ios/ChangeLog >index 6c419b0d0825c2f4ea03edd5a52ee7f826d30edf..1bfba2c30eaaea68813cad6409d0039691bea23f 100644 >--- a/Source/WebKitLegacy/ios/ChangeLog >+++ b/Source/WebKitLegacy/ios/ChangeLog >@@ -1,3 +1,16 @@ >+2017-09-21 Chris Dumez <cdumez@apple.com> >+ >+ Use high resolution timestamp for event time >+ https://bugs.webkit.org/show_bug.cgi?id=154246 >+ <rdar://problem/34333304> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use WallTime / MonotonicTime instead of double type for clarity. >+ >+ * WebView/WebPDFViewPlaceholder.mm: >+ (-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]): >+ > 2017-08-09 Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com> > > [PAL] Move spi/cocoa and spi/cg directories into PAL >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index e8a9cd91d151d404c79938133d4f023fa6bd7cd9..946edf3686b46c84d302f8995b81f195f1e3a672 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,20 @@ >+2017-09-21 Chris Dumez <cdumez@apple.com> >+ >+ Use high resolution timestamp for event time >+ https://bugs.webkit.org/show_bug.cgi?id=154246 >+ <rdar://problem/34333304> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use WallTime / MonotonicTime instead of double type for clarity. >+ >+ * DOM/DOMEvent.mm: >+ (-[DOMEvent timeStamp]): >+ * WebView/WebFrame.mm: >+ (-[WebFrame _dragSourceEndedAt:operation:]): >+ * WebView/WebPDFView.mm: >+ (-[WebPDFView PDFViewWillClickOnLink:withURL:]): >+ > 2017-09-20 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: WebView indication highlights sticks around for WebKitLegacy views >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 2a295e063a65efc109697fb10d8bf5c276eb5c6a..d867d1eb4832854e0d556a6c6283003ff6e80908 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1957,6 +1957,7 @@ > 460BB6161D0A1BF000221812 /* Base64Utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 460BB6141D0A1BEC00221812 /* Base64Utilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 460CBF351D4BCD0E0092E88E /* JSDOMWindowProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 460CBF331D4BCCFE0092E88E /* JSDOMWindowProperties.cpp */; }; > 460CBF361D4BCD0E0092E88E /* JSDOMWindowProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 460CBF341D4BCCFE0092E88E /* JSDOMWindowProperties.h */; }; >+ 46218ACB1F72D64E00574FBE /* DOMHighResTimeStamp.h in Headers */ = {isa = PBXBuildFile; fileRef = 46E016AD1F72D61E00282B2C /* DOMHighResTimeStamp.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 4634592C1AC2271000ECB71C /* PowerObserverMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */; }; > 463EB6221B8789E00096ED51 /* TagCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 463EB6201B8789CB0096ED51 /* TagCollection.cpp */; }; > 463EB6231B8789E00096ED51 /* TagCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 463EB6211B8789CB0096ED51 /* TagCollection.h */; }; >@@ -9840,6 +9841,7 @@ > 46DFF4971DC2601300B80B48 /* ShadowRootMode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ShadowRootMode.idl; sourceTree = "<group>"; }; > 46DFF4991DC261F900B80B48 /* JSShadowRootMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSShadowRootMode.cpp; sourceTree = "<group>"; }; > 46DFF49A1DC261F900B80B48 /* JSShadowRootMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSShadowRootMode.h; sourceTree = "<group>"; }; >+ 46E016AD1F72D61E00282B2C /* DOMHighResTimeStamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHighResTimeStamp.h; sourceTree = "<group>"; }; > 46EBEA011B7D4D5D00BE4941 /* CollectionTraversal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionTraversal.h; sourceTree = "<group>"; }; > 46EFAF0D1E5FB9C200E7F34B /* LowPowerModeNotifierIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LowPowerModeNotifierIOS.mm; sourceTree = "<group>"; }; > 46EFAF0F1E5FB9E100E7F34B /* LowPowerModeNotifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LowPowerModeNotifier.cpp; sourceTree = "<group>"; }; >@@ -26253,6 +26255,7 @@ > BC60D6E80D28D83400B9918F /* DOMException.h */, > BC60D6EB0D28D99900B9918F /* DOMException.idl */, > BC9A6141146859D9006057FD /* DOMExceptions.in */, >+ 46E016AD1F72D61E00282B2C /* DOMHighResTimeStamp.h */, > A8185F3609765765005826D9 /* DOMImplementation.cpp */, > A8185F3309765765005826D9 /* DOMImplementation.h */, > 93EEC1E909C2877700C515D1 /* DOMImplementation.idl */, >@@ -27704,6 +27707,7 @@ > BC60D6E90D28D83400B9918F /* DOMException.h in Headers */, > 8399470C1F50B63E00E9D86B /* DOMFileSystem.h in Headers */, > 2ED609BD1145B07100C8684E /* DOMFormData.h in Headers */, >+ 46218ACB1F72D64E00574FBE /* DOMHighResTimeStamp.h in Headers */, > A8185F3B09765766005826D9 /* DOMImplementation.h in Headers */, > E3C99A091DC3D41C00794AD3 /* DOMJITCheckDOM.h in Headers */, > E3150EA71DA7219300194012 /* DOMJITHelpers.h in Headers */, >diff --git a/Source/WebCore/dom/DOMHighResTimeStamp.h b/Source/WebCore/dom/DOMHighResTimeStamp.h >new file mode 100644 >index 0000000000000000000000000000000000000000..11b67860093ea096557efe5f851a067e5369d3dc >--- /dev/null >+++ b/Source/WebCore/dom/DOMHighResTimeStamp.h >@@ -0,0 +1,32 @@ >+/* >+ * Copyright (C) 2017 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 >+ >+namespace WebCore { >+ >+using DOMHighResTimeStamp = double; >+ >+} >diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp >index 1135c947900ed32d4db8623edd619144eef1a381..3cc45835ee8fa11ec969b3a56747b67ebb24ac04 100644 >--- a/Source/WebCore/dom/Element.cpp >+++ b/Source/WebCore/dom/Element.cpp >@@ -2525,7 +2525,7 @@ bool Element::dispatchMouseForceWillBegin() > if (!frame) > return false; > >- PlatformMouseEvent platformMouseEvent { frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick, NoTap }; >+ PlatformMouseEvent platformMouseEvent { frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WallTime::now(), ForceAtClick, NoTap }; > auto mouseForceWillBeginEvent = MouseEvent::create(eventNames().webkitmouseforcewillbeginEvent, document().defaultView(), platformMouseEvent, 0, nullptr); > mouseForceWillBeginEvent->setTarget(this); > dispatchEvent(mouseForceWillBeginEvent); >diff --git a/Source/WebCore/dom/Event.cpp b/Source/WebCore/dom/Event.cpp >index 870595184e13413a2e25ee073c7e538b58ca649e..e463dcf4aec59e9c00974101a49ad54bb848221b 100644 >--- a/Source/WebCore/dom/Event.cpp >+++ b/Source/WebCore/dom/Event.cpp >@@ -23,17 +23,21 @@ > #include "config.h" > #include "Event.h" > >+#include "DOMWindow.h" >+#include "Document.h" > #include "EventNames.h" > #include "EventPath.h" > #include "EventTarget.h" >+#include "Performance.h" > #include "UserGestureIndicator.h" >+#include "WorkerGlobalScope.h" > #include <wtf/CurrentTime.h> > > namespace WebCore { > > Event::Event(IsTrusted isTrusted) > : m_isTrusted(isTrusted == IsTrusted::Yes) >- , m_createTime(convertSecondsToDOMTimeStamp(currentTime())) >+ , m_createTime(MonotonicTime::now()) > { > } > >@@ -43,17 +47,17 @@ Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr > , m_canBubble(canBubbleArg) > , m_cancelable(cancelableArg) > , m_isTrusted(true) >- , m_createTime(convertSecondsToDOMTimeStamp(currentTime())) >+ , m_createTime(MonotonicTime::now()) > { > } > >-Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg, double timestamp) >+Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg, MonotonicTime timestamp) > : m_type(eventType) > , m_isInitialized(true) > , m_canBubble(canBubbleArg) > , m_cancelable(cancelableArg) > , m_isTrusted(true) >- , m_createTime(convertSecondsToDOMTimeStamp(timestamp)) >+ , m_createTime(timestamp) > { > } > >@@ -64,7 +68,7 @@ Event::Event(const AtomicString& eventType, const EventInit& initializer, IsTrus > , m_cancelable(initializer.cancelable) > , m_composed(initializer.composed) > , m_isTrusted(isTrusted == IsTrusted::Yes) >- , m_createTime(convertSecondsToDOMTimeStamp(currentTime())) >+ , m_createTime(MonotonicTime::now()) > { > } > >@@ -216,4 +220,18 @@ void Event::setUnderlyingEvent(Event* underlyingEvent) > m_underlyingEvent = underlyingEvent; > } > >+DOMHighResTimeStamp Event::timeStampForBindings(ScriptExecutionContext& context) const >+{ >+ Performance* performance = nullptr; >+ if (is<WorkerGlobalScope>(context)) >+ performance = &downcast<WorkerGlobalScope>(context).performance(); >+ else if (auto* window = downcast<Document>(context).domWindow()) >+ performance = window->performance(); >+ >+ if (!performance) >+ return 0; >+ >+ return performance->monotonicTimeToHighResTimeStamp(m_createTime); >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/dom/Event.h b/Source/WebCore/dom/Event.h >index 9edb3af31ecff55a077250c5df9dbc9d3451c8d2..c5d4d41d637811f2242e7590cb478c733699f81b 100644 >--- a/Source/WebCore/dom/Event.h >+++ b/Source/WebCore/dom/Event.h >@@ -23,11 +23,12 @@ > > #pragma once > >-#include "DOMTimeStamp.h" >+#include "DOMHighResTimeStamp.h" > #include "EventInit.h" > #include "EventInterfaces.h" > #include "ExceptionOr.h" > #include "ScriptWrappable.h" >+#include <wtf/MonotonicTime.h> > #include <wtf/RefCounted.h> > #include <wtf/TypeCasts.h> > #include <wtf/text/AtomicString.h> >@@ -96,7 +97,8 @@ public: > bool cancelable() const { return m_cancelable; } > WEBCORE_EXPORT bool composed() const; > >- DOMTimeStamp timeStamp() const { return m_createTime; } >+ DOMHighResTimeStamp timeStampForBindings(ScriptExecutionContext&) const; >+ MonotonicTime timeStamp() const { return m_createTime; } > > void setEventPath(const EventPath& path) { m_eventPath = &path; } > void clearEventPath() { m_eventPath = nullptr; } >@@ -170,7 +172,7 @@ public: > protected: > Event(IsTrusted = IsTrusted::No); > WEBCORE_EXPORT Event(const AtomicString& type, bool canBubble, bool cancelable); >- Event(const AtomicString& type, bool canBubble, bool cancelable, double timestamp); >+ Event(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp); > Event(const AtomicString& type, const EventInit&, IsTrusted); > > virtual void receivedTarget(); >@@ -195,7 +197,7 @@ private: > RefPtr<EventTarget> m_currentTarget; > const EventPath* m_eventPath { nullptr }; > RefPtr<EventTarget> m_target; >- DOMTimeStamp m_createTime; >+ MonotonicTime m_createTime; > > RefPtr<Event> m_underlyingEvent; > }; >diff --git a/Source/WebCore/dom/Event.idl b/Source/WebCore/dom/Event.idl >index 533f31cc8d5fc02caa34335109597b8ab5498715..87ae1fb49c25a2b864a3e2278c3ff5fd31916095 100644 >--- a/Source/WebCore/dom/Event.idl >+++ b/Source/WebCore/dom/Event.idl >@@ -18,6 +18,8 @@ > * Boston, MA 02110-1301, USA. > */ > >+typedef double DOMHighResTimeStamp; >+ > [ > Constructor(DOMString type, optional EventInit eventInitDict), > CustomToJSObject, >@@ -48,7 +50,7 @@ > [EnabledAtRuntime=ShadowDOM] readonly attribute boolean composed; > > [Unforgeable] readonly attribute boolean isTrusted; >- readonly attribute DOMTimeStamp timeStamp; >+ [CallWith=ScriptExecutionContext, ImplementedAs=timeStampForBindings] readonly attribute DOMHighResTimeStamp timeStamp; > > void initEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false); // Historical. > >diff --git a/Source/WebCore/dom/KeyboardEvent.cpp b/Source/WebCore/dom/KeyboardEvent.cpp >index 2bd931fc480087efd350b4d18f0f1e08ddb2f1af..4804c1d05e56b788c64ae372a21f7ed446f3744e 100644 >--- a/Source/WebCore/dom/KeyboardEvent.cpp >+++ b/Source/WebCore/dom/KeyboardEvent.cpp >@@ -95,7 +95,7 @@ KeyboardEvent::KeyboardEvent() = default; > > KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, DOMWindow* view) > : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()) >- , true, true, key.timestamp(), view, 0, key.ctrlKey(), key.altKey(), key.shiftKey() >+ , true, true, key.timestamp().approximateMonotonicTime(), view, 0, key.ctrlKey(), key.altKey(), key.shiftKey() > , key.metaKey(), false, key.modifiers().contains(PlatformEvent::Modifier::CapsLockKey)) > , m_keyEvent(std::make_unique<PlatformKeyboardEvent>(key)) > #if ENABLE(KEYBOARD_KEY_ATTRIBUTE) >diff --git a/Source/WebCore/dom/MouseEvent.cpp b/Source/WebCore/dom/MouseEvent.cpp >index eb76d6af91f956d23d46751d3d3f66f7d65dfd8a..3c785a7a4466a502382cee712db8ec2dfcd6ca1d 100644 >--- a/Source/WebCore/dom/MouseEvent.cpp >+++ b/Source/WebCore/dom/MouseEvent.cpp >@@ -34,7 +34,6 @@ > #include "JSEventTargetCustom.h" > #include "PlatformMouseEvent.h" > #include "RuntimeApplicationChecks.h" >-#include <wtf/CurrentTime.h> > > namespace WebCore { > >@@ -51,7 +50,7 @@ Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, DOMWindow* vie > bool isCancelable = eventType != eventNames().mousemoveEvent && !isMouseEnterOrLeave; > bool canBubble = !isMouseEnterOrLeave; > >- return MouseEvent::create(eventType, canBubble, isCancelable, event.timestamp(), view, >+ return MouseEvent::create(eventType, canBubble, isCancelable, event.timestamp().approximateMonotonicTime(), view, > detail, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(), > #if ENABLE(POINTER_LOCK) > event.movementDelta().x(), event.movementDelta().y(), >@@ -60,7 +59,7 @@ Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, DOMWindow* vie > relatedTarget, event.force(), event.syntheticClickType()); > } > >-Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow* view, int detail, int screenX, int screenY, int pageX, int pageY, >+Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, DOMWindow* view, int detail, int screenX, int screenY, int pageX, int pageY, > #if ENABLE(POINTER_LOCK) > int movementX, int movementY, > #endif >@@ -83,7 +82,7 @@ MouseEvent::MouseEvent() > { > } > >-MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, double timestamp, DOMWindow* view, int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, >+MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, MonotonicTime timestamp, DOMWindow* view, int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, > #if ENABLE(POINTER_LOCK) > const IntPoint& movementDelta, > #endif >@@ -103,7 +102,7 @@ MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance > } > > MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, DOMWindow* view, int detail, const IntPoint& screenLocation, const IntPoint& clientLocation, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short syntheticClickType, EventTarget* relatedTarget) >- : MouseRelatedEvent(eventType, canBubble, cancelable, WTF::currentTime(), view, detail, screenLocation, { }, >+ : MouseRelatedEvent(eventType, canBubble, cancelable, MonotonicTime::now(), view, detail, screenLocation, { }, > #if ENABLE(POINTER_LOCK) > { }, > #endif >diff --git a/Source/WebCore/dom/MouseEvent.h b/Source/WebCore/dom/MouseEvent.h >index e30082bd3af6a4ae5ab7396d1d196fe4b0901489..5f1c03a451b3cb5689a7b3c76f9829f93dbc1778 100644 >--- a/Source/WebCore/dom/MouseEvent.h >+++ b/Source/WebCore/dom/MouseEvent.h >@@ -33,7 +33,7 @@ class PlatformMouseEvent; > > class MouseEvent : public MouseRelatedEvent { > public: >- WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*, int detail, int screenX, int screenY, int pageX, int pageY, >+ WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, DOMWindow*, int detail, int screenX, int screenY, int pageX, int pageY, > #if ENABLE(POINTER_LOCK) > int movementX, int movementY, > #endif >@@ -71,7 +71,7 @@ public: > int which() const final; > > protected: >- MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*, >+ MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, DOMWindow*, > int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, > #if ENABLE(POINTER_LOCK) > const IntPoint& movementDelta, >diff --git a/Source/WebCore/dom/MouseRelatedEvent.cpp b/Source/WebCore/dom/MouseRelatedEvent.cpp >index eba9a7a92aeb1b4203424ba698962968593d3f48..6915e9c307697d390e3c3b8ab7893108ac2a2f4a 100644 >--- a/Source/WebCore/dom/MouseRelatedEvent.cpp >+++ b/Source/WebCore/dom/MouseRelatedEvent.cpp >@@ -32,7 +32,7 @@ > > namespace WebCore { > >-MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubble, bool cancelable, double timestamp, DOMWindow* DOMWindow, >+MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubble, bool cancelable, MonotonicTime timestamp, DOMWindow* DOMWindow, > int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, > #if ENABLE(POINTER_LOCK) > const IntPoint& movementDelta, >diff --git a/Source/WebCore/dom/MouseRelatedEvent.h b/Source/WebCore/dom/MouseRelatedEvent.h >index 80a730a208af9415201a528d34870b9663a91d0e..e35d293c4114f0593f3c9eddeafb3202d0010f8c 100644 >--- a/Source/WebCore/dom/MouseRelatedEvent.h >+++ b/Source/WebCore/dom/MouseRelatedEvent.h >@@ -73,7 +73,7 @@ public: > > protected: > MouseRelatedEvent() = default; >- MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*, >+ MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, DOMWindow*, > int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, > #if ENABLE(POINTER_LOCK) > const IntPoint& movementDelta, >diff --git a/Source/WebCore/dom/SimulatedClick.cpp b/Source/WebCore/dom/SimulatedClick.cpp >index 6fb3b4d7f72362fa7e9b720e542bc46fb752cb60..4549368be927872b99be017d1b8e068318b780cf 100644 >--- a/Source/WebCore/dom/SimulatedClick.cpp >+++ b/Source/WebCore/dom/SimulatedClick.cpp >@@ -46,7 +46,7 @@ public: > > private: > SimulatedMouseEvent(const AtomicString& eventType, DOMWindow* view, RefPtr<Event>&& underlyingEvent, Element& target, SimulatedClickSource source) >- : MouseEvent(eventType, true, true, underlyingEvent ? underlyingEvent->timeStamp() : currentTime(), view, 0, { }, { }, >+ : MouseEvent(eventType, true, true, underlyingEvent ? underlyingEvent->timeStamp() : MonotonicTime::now(), view, 0, { }, { }, > #if ENABLE(POINTER_LOCK) > { }, > #endif >diff --git a/Source/WebCore/dom/TouchEvent.cpp b/Source/WebCore/dom/TouchEvent.cpp >index f5cec7cc40cb7292942e40a3b9bb0f99a402829d..873f2964bd43bc9b33e0ba775029adb32ac82a0b 100644 >--- a/Source/WebCore/dom/TouchEvent.cpp >+++ b/Source/WebCore/dom/TouchEvent.cpp >@@ -31,7 +31,6 @@ > #include "TouchEvent.h" > > #include "EventDispatcher.h" >-#include <wtf/CurrentTime.h> > > namespace WebCore { > >@@ -43,7 +42,7 @@ TouchEvent::TouchEvent(TouchList* touches, TouchList* targetTouches, > TouchList* changedTouches, const AtomicString& type, > DOMWindow* view, int screenX, int screenY, int pageX, int pageY, > bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) >- : MouseRelatedEvent(type, true, true, currentTime(), view, 0, IntPoint(screenX, screenY), >+ : MouseRelatedEvent(type, true, true, MonotonicTime::now(), view, 0, IntPoint(screenX, screenY), > IntPoint(pageX, pageY), > #if ENABLE(POINTER_LOCK) > IntPoint(0, 0), >diff --git a/Source/WebCore/dom/UIEvent.cpp b/Source/WebCore/dom/UIEvent.cpp >index 4cb2239ec5be0da80d9dd18f0ee4e427022ea594..e815af97afe4d08e5ec0b77f313cab6af89bf9e8 100644 >--- a/Source/WebCore/dom/UIEvent.cpp >+++ b/Source/WebCore/dom/UIEvent.cpp >@@ -39,7 +39,7 @@ UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab > { > } > >-UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg, double timestamp, DOMWindow* viewArg, int detailArg) >+UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg, MonotonicTime timestamp, DOMWindow* viewArg, int detailArg) > : Event(eventType, canBubbleArg, cancelableArg, timestamp) > , m_view(viewArg) > , m_detail(detailArg) >diff --git a/Source/WebCore/dom/UIEvent.h b/Source/WebCore/dom/UIEvent.h >index 973d73ef3fa3353c0f7963ca0fa8e1e7856ad7cb..baa731fcf81eebaf23153da51ba0aeafd2455fac 100644 >--- a/Source/WebCore/dom/UIEvent.h >+++ b/Source/WebCore/dom/UIEvent.h >@@ -66,7 +66,7 @@ public: > protected: > UIEvent(); > UIEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*, int detail); >- UIEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*, int detail); >+ UIEvent(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, DOMWindow*, int detail); > UIEvent(const AtomicString&, const UIEventInit&, IsTrusted); > > private: >diff --git a/Source/WebCore/dom/UIEventWithKeyState.h b/Source/WebCore/dom/UIEventWithKeyState.h >index bfea387c212c251ad51f070be36be44581624de2..0a8e4031248d6f7265442e5bf80012ba30cccdeb 100644 >--- a/Source/WebCore/dom/UIEventWithKeyState.h >+++ b/Source/WebCore/dom/UIEventWithKeyState.h >@@ -49,7 +49,7 @@ protected: > { > } > >- UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow* view, >+ UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, DOMWindow* view, > int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey, bool capsLockKey) > : UIEvent(type, canBubble, cancelable, timestamp, view, detail) > , m_ctrlKey(ctrlKey) >diff --git a/Source/WebCore/dom/WheelEvent.cpp b/Source/WebCore/dom/WheelEvent.cpp >index 530e6b0119292892a6d8a49ce278b573f6f37084..80db05a155288b95e3820a287f919baadbd2509a 100644 >--- a/Source/WebCore/dom/WheelEvent.cpp >+++ b/Source/WebCore/dom/WheelEvent.cpp >@@ -50,7 +50,7 @@ WheelEvent::WheelEvent(const AtomicString& type, const Init& initializer, IsTrus > } > > WheelEvent::WheelEvent(const PlatformWheelEvent& event, DOMWindow* view) >- : MouseEvent(eventNames().wheelEvent, true, true, event.timestamp(), view, 0, event.globalPosition(), event.position() >+ : MouseEvent(eventNames().wheelEvent, true, true, event.timestamp().approximateMonotonicTime(), view, 0, event.globalPosition(), event.position() > #if ENABLE(POINTER_LOCK) > , { } > #endif >diff --git a/Source/WebCore/html/TypeAhead.cpp b/Source/WebCore/html/TypeAhead.cpp >index d26f57d849a6bae059686b5d29494800be5a7388..f1ecb7cd60fe0da2486f875fafb223a3753d4253 100644 >--- a/Source/WebCore/html/TypeAhead.cpp >+++ b/Source/WebCore/html/TypeAhead.cpp >@@ -37,12 +37,11 @@ namespace WebCore { > > TypeAhead::TypeAhead(TypeAheadDataSource* dataSource) > : m_dataSource(dataSource) >- , m_lastTypeTime(0) > , m_repeatingChar(0) > { > } > >-static const DOMTimeStamp typeAheadTimeout = 1000; >+static const Seconds typeAheadTimeout { 1_s }; > > static String stripLeadingWhiteSpace(const String& string) > { >@@ -63,7 +62,7 @@ int TypeAhead::handleEvent(KeyboardEvent* event, MatchModeFlags matchMode) > return -1; > > int optionCount = m_dataSource->optionCount(); >- DOMTimeStamp delta = event->timeStamp() - m_lastTypeTime; >+ Seconds delta = event->timeStamp() - m_lastTypeTime; > m_lastTypeTime = event->timeStamp(); > > UChar c = event->charCode(); >diff --git a/Source/WebCore/html/TypeAhead.h b/Source/WebCore/html/TypeAhead.h >index 610ac78288b760247977bf2e2382cca2e22bda89..046c001e571745f7be1f9e4627c6f74de6ac258f 100644 >--- a/Source/WebCore/html/TypeAhead.h >+++ b/Source/WebCore/html/TypeAhead.h >@@ -25,7 +25,7 @@ > > #pragma once > >-#include "DOMTimeStamp.h" >+#include <wtf/MonotonicTime.h> > #include <wtf/text/StringBuilder.h> > #include <wtf/text/WTFString.h> > >@@ -58,7 +58,7 @@ public: > > private: > TypeAheadDataSource* m_dataSource; >- DOMTimeStamp m_lastTypeTime; >+ MonotonicTime m_lastTypeTime; > UChar m_repeatingChar; > StringBuilder m_buffer; > }; >diff --git a/Source/WebCore/page/AutoscrollController.cpp b/Source/WebCore/page/AutoscrollController.cpp >index e3996fded50c5b3e64d241231ce426f45d87e5e5..e5287c0cb2370126aee9f4f5cf833a809adbc5c6 100644 >--- a/Source/WebCore/page/AutoscrollController.cpp >+++ b/Source/WebCore/page/AutoscrollController.cpp >@@ -37,12 +37,11 @@ > #include "RenderView.h" > #include "ScrollView.h" > #include "Settings.h" >-#include <wtf/CurrentTime.h> > > namespace WebCore { > > // Delay time in second for start autoscroll if pointer is in border edge of scrollable element. >-static const double autoscrollDelay = 0.2; >+static const Seconds autoscrollDelay { 200_ms }; > > // When the autoscroll or the panScroll is triggered when do the scroll every 50ms to make it smooth. > static const Seconds autoscrollInterval { 50_ms }; >@@ -59,7 +58,6 @@ AutoscrollController::AutoscrollController() > : m_autoscrollTimer(*this, &AutoscrollController::autoscrollTimerFired) > , m_autoscrollRenderer(nullptr) > , m_autoscrollType(NoAutoscroll) >- , m_dragAndDropAutoscrollStartTime(0) > { > } > >@@ -140,7 +138,7 @@ void AutoscrollController::updateAutoscrollRenderer() > m_autoscrollRenderer = is<RenderBox>(renderer) ? downcast<RenderBox>(renderer) : nullptr; > } > >-void AutoscrollController::updateDragAndDrop(Node* dropTargetNode, const IntPoint& eventPosition, double eventTime) >+void AutoscrollController::updateDragAndDrop(Node* dropTargetNode, const IntPoint& eventPosition, WallTime eventTime) > { > if (!dropTargetNode) { > stopAutoscrollTimer(); >@@ -241,7 +239,7 @@ void AutoscrollController::autoscrollTimerFired() > Frame& frame = m_autoscrollRenderer->frame(); > switch (m_autoscrollType) { > case AutoscrollForDragAndDrop: >- if (WTF::currentTime() - m_dragAndDropAutoscrollStartTime > autoscrollDelay) >+ if (WallTime::now() - m_dragAndDropAutoscrollStartTime > autoscrollDelay) > m_autoscrollRenderer->autoscroll(m_dragAndDropAutoscrollReferencePosition); > break; > case AutoscrollForSelection: { >diff --git a/Source/WebCore/page/AutoscrollController.h b/Source/WebCore/page/AutoscrollController.h >index 3cd9dbf3379cb777a8aabc75bb83b9671361cf64..71360ba44ddc94514f6942d46bdb8f0f8d06be32 100644 >--- a/Source/WebCore/page/AutoscrollController.h >+++ b/Source/WebCore/page/AutoscrollController.h >@@ -27,6 +27,7 @@ > > #include "IntPoint.h" > #include "Timer.h" >+#include <wtf/WallTime.h> > > namespace WebCore { > >@@ -59,7 +60,7 @@ public: > void startAutoscrollForSelection(RenderObject*); > void stopAutoscrollTimer(bool rendererIsBeingDestroyed = false); > void updateAutoscrollRenderer(); >- void updateDragAndDrop(Node* targetNode, const IntPoint& eventPosition, double eventTime); >+ void updateDragAndDrop(Node* targetNode, const IntPoint& eventPosition, WallTime eventTime); > #if ENABLE(PAN_SCROLLING) > void didPanScrollStart(); > void didPanScrollStop(); >@@ -79,7 +80,7 @@ private: > RenderBox* m_autoscrollRenderer; > AutoscrollType m_autoscrollType; > IntPoint m_dragAndDropAutoscrollReferencePosition; >- double m_dragAndDropAutoscrollStartTime; >+ WallTime m_dragAndDropAutoscrollStartTime; > #if ENABLE(PAN_SCROLLING) > IntPoint m_panScrollStartPos; > #endif >diff --git a/Source/WebCore/page/ContextMenuController.cpp b/Source/WebCore/page/ContextMenuController.cpp >index 8011c42d603a1dd92696f37e614109da8926fbf7..322b4923ffb2427c2b85a9c6d5d1c71e0c605649 100644 >--- a/Source/WebCore/page/ContextMenuController.cpp >+++ b/Source/WebCore/page/ContextMenuController.cpp >@@ -68,6 +68,7 @@ > #include "UserTypingGestureIndicator.h" > #include "WindowFeatures.h" > #include "markup.h" >+#include <wtf/WallTime.h> > #include <wtf/unicode/CharacterNames.h> > > using namespace WTF; >@@ -1440,7 +1441,7 @@ void ContextMenuController::showContextMenuAt(Frame& frame, const IntPoint& clic > clearContextMenu(); > > // Simulate a click in the middle of the accessibility object. >- PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), ForceAtClick, NoTap); >+ PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, WallTime::now(), ForceAtClick, NoTap); > frame.eventHandler().handleMousePressEvent(mouseEvent); > bool handled = frame.eventHandler().sendContextMenuEvent(mouseEvent); > if (handled) >diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp >index ef566795aad0bd04338bd38df66045dfa9f63646..3f8a206b5559647c08e2b51ba5c6cfedaa6584d5 100644 >--- a/Source/WebCore/page/DragController.cpp >+++ b/Source/WebCore/page/DragController.cpp >@@ -128,7 +128,7 @@ static PlatformMouseEvent createMouseEvent(const DragData& dragData) > > return PlatformMouseEvent(dragData.clientPosition(), dragData.globalPosition(), > LeftButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, >- metaKey, currentTime(), ForceAtClick, NoTap); >+ metaKey, WallTime::now(), ForceAtClick, NoTap); > } > > DragController::DragController(Page& page, DragClient& client) >diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp >index 5c848afd9b01d1ae339f46ced4a24588d3f70e3a..ef069c47e746b81344e929cf774e2934d4a44796 100644 >--- a/Source/WebCore/page/EventHandler.cpp >+++ b/Source/WebCore/page/EventHandler.cpp >@@ -135,7 +135,7 @@ const int ImageDragHysteresis = 5; > const int TextDragHysteresis = 3; > const int GeneralDragHysteresis = 3; > #if PLATFORM(COCOA) >-const double EventHandler::TextDragDelay = 0.15; >+const Seconds EventHandler::TextDragDelay { 150_ms }; > #endif > #endif // ENABLE(DRAG_SUPPORT) > >@@ -2190,7 +2190,7 @@ bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Element& dra > > view->disableLayerFlushThrottlingTemporarilyForInteraction(); > Ref<MouseEvent> me = MouseEvent::create(eventType, >- true, true, event.timestamp(), m_frame.document()->defaultView(), >+ true, true, event.timestamp().approximateMonotonicTime(), m_frame.document()->defaultView(), > 0, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(), > #if ENABLE(POINTER_LOCK) > event.movementDelta().x(), event.movementDelta().y(), >@@ -2939,7 +2939,7 @@ bool EventHandler::sendContextMenuEventForKey() > PlatformEvent::Type eventType = PlatformEvent::MousePressed; > #endif > >- PlatformMouseEvent platformMouseEvent(position, globalPosition, RightButton, eventType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick, NoTap); >+ PlatformMouseEvent platformMouseEvent(position, globalPosition, RightButton, eventType, 1, false, false, false, false, WallTime::now(), ForceAtClick, NoTap); > > return sendContextMenuEvent(platformMouseEvent); > } >@@ -3021,7 +3021,7 @@ void EventHandler::fakeMouseMoveEventTimerFired() > bool altKey; > bool metaKey; > PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey); >- PlatformMouseEvent fakeMouseMoveEvent(m_lastKnownMousePosition, m_lastKnownMouseGlobalPosition, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime(), 0, NoTap); >+ PlatformMouseEvent fakeMouseMoveEvent(m_lastKnownMousePosition, m_lastKnownMouseGlobalPosition, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, NoTap); > mouseMoved(fakeMouseMoveEvent); > } > #endif // !ENABLE(IOS_TOUCH_EVENTS) >diff --git a/Source/WebCore/page/EventHandler.h b/Source/WebCore/page/EventHandler.h >index 6663c8f2a89d3f22c3bef62b097c46aedbf67663..a0aa535f5a5d8ca81175a891015b6e9bbf487984 100644 >--- a/Source/WebCore/page/EventHandler.h >+++ b/Source/WebCore/page/EventHandler.h >@@ -323,7 +323,7 @@ public: > private: > #if ENABLE(DRAG_SUPPORT) > static DragState& dragState(); >- static const double TextDragDelay; >+ static const Seconds TextDragDelay; > Ref<DataTransfer> createDraggingDataTransfer() const; > #endif > >@@ -564,7 +564,7 @@ private: > IntPoint m_lastKnownMousePosition; > IntPoint m_lastKnownMouseGlobalPosition; > IntPoint m_mouseDownPos; // In our view's coords. >- double m_mouseDownTimestamp { 0 }; >+ WallTime m_mouseDownTimestamp; > PlatformMouseEvent m_mouseDown; > > #if PLATFORM(COCOA) >diff --git a/Source/WebCore/page/Performance.cpp b/Source/WebCore/page/Performance.cpp >index 1afa36459131317a02635890ed1beaee1d4e4e9a..f2e14bcf75b32b63955400ba32098bb6a7ac735e 100644 >--- a/Source/WebCore/page/Performance.cpp >+++ b/Source/WebCore/page/Performance.cpp >@@ -69,7 +69,7 @@ void Performance::contextDestroyed() > ContextDestructionObserver::contextDestroyed(); > } > >-double Performance::now() const >+DOMHighResTimeStamp Performance::now() const > { > Seconds now = MonotonicTime::now() - m_timeOrigin; > return reduceTimeResolution(now).milliseconds(); >@@ -82,6 +82,12 @@ Seconds Performance::reduceTimeResolution(Seconds seconds) > return Seconds(reduced); > } > >+DOMHighResTimeStamp Performance::monotonicTimeToHighResTimeStamp(MonotonicTime timestamp) const >+{ >+ Seconds seconds = timestamp - m_timeOrigin; >+ return reduceTimeResolution(seconds).milliseconds(); >+} >+ > PerformanceNavigation* Performance::navigation() > { > if (!is<Document>(scriptExecutionContext())) >diff --git a/Source/WebCore/page/Performance.h b/Source/WebCore/page/Performance.h >index 9a60ec0ab2ca58b7f10c4b8db9cff612109d585d..d1486b835f2cd953fbcedf64d484a1250da36c0e 100644 >--- a/Source/WebCore/page/Performance.h >+++ b/Source/WebCore/page/Performance.h >@@ -33,6 +33,7 @@ > #pragma once > > #include "ContextDestructionObserver.h" >+#include "DOMHighResTimeStamp.h" > #include "EventTarget.h" > #include "ExceptionOr.h" > #include "GenericTaskQueue.h" >@@ -56,7 +57,7 @@ public: > static Ref<Performance> create(ScriptExecutionContext& context, MonotonicTime timeOrigin) { return adoptRef(*new Performance(context, timeOrigin)); } > ~Performance(); > >- double now() const; >+ DOMHighResTimeStamp now() const; > > PerformanceNavigation* navigation(); > PerformanceTiming* timing(); >@@ -82,6 +83,8 @@ public: > > static Seconds reduceTimeResolution(Seconds); > >+ DOMHighResTimeStamp monotonicTimeToHighResTimeStamp(MonotonicTime) const; >+ > ScriptExecutionContext* scriptExecutionContext() const final { return ContextDestructionObserver::scriptExecutionContext(); } > > using RefCounted::ref; >diff --git a/Source/WebCore/page/ios/EventHandlerIOS.mm b/Source/WebCore/page/ios/EventHandlerIOS.mm >index 8f0fb4e2eaba3dd96ceeb4438f8f3b039958b142..9f9758bf35017ebb4b5d2d71b20d7e8d99caac9b 100644 >--- a/Source/WebCore/page/ios/EventHandlerIOS.mm >+++ b/Source/WebCore/page/ios/EventHandlerIOS.mm >@@ -587,8 +587,8 @@ bool EventHandler::tryToBeginDataInteractionAtPoint(const IntPoint& clientPositi > IntPoint adjustedClientPosition = roundedIntPoint(adjustedClientPositionAsFloatPoint); > IntPoint adjustedGlobalPosition = protectedFrame->view()->windowToContents(adjustedClientPosition); > >- PlatformMouseEvent syntheticMousePressEvent(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), 0, NoTap); >- PlatformMouseEvent syntheticMouseMoveEvent(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0, NoTap); >+ PlatformMouseEvent syntheticMousePressEvent(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, WallTime::now(), 0, NoTap); >+ PlatformMouseEvent syntheticMouseMoveEvent(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, WallTime::now(), 0, NoTap); > > HitTestRequest request(HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent); > auto documentPoint = protectedFrame->view() ? protectedFrame->view()->windowToContents(syntheticMouseMoveEvent.position()) : syntheticMouseMoveEvent.position(); >diff --git a/Source/WebCore/page/win/EventHandlerWin.cpp b/Source/WebCore/page/win/EventHandlerWin.cpp >index dcec034dfec3b61c51cadf2772a567590afcdf24..42106a68ffbd81ac107f50b90786b7e09e08327c 100644 >--- a/Source/WebCore/page/win/EventHandlerWin.cpp >+++ b/Source/WebCore/page/win/EventHandlerWin.cpp >@@ -48,7 +48,7 @@ > namespace WebCore { > > #if ENABLE(DRAG_SUPPORT) >-const double EventHandler::TextDragDelay = 0.0; >+const Seconds EventHandler::TextDragDelay { 0_s }; > #endif > > bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) >diff --git a/Source/WebCore/platform/PlatformEvent.h b/Source/WebCore/platform/PlatformEvent.h >index 5cb478471d66a8ec96a548df4908e587e81d85e7..52cb9c87402f07102df638b151082d787a13b8d7 100644 >--- a/Source/WebCore/platform/PlatformEvent.h >+++ b/Source/WebCore/platform/PlatformEvent.h >@@ -26,6 +26,7 @@ > #pragma once > > #include <wtf/OptionSet.h> >+#include <wtf/WallTime.h> > > namespace WebCore { > >@@ -86,29 +87,27 @@ public: > > OptionSet<Modifier> modifiers() const { return m_modifiers; } > >- double timestamp() const { return m_timestamp; } >+ WallTime timestamp() const { return m_timestamp; } > > protected: > PlatformEvent() > : m_type(NoType) >- , m_timestamp(0) > { > } > > explicit PlatformEvent(Type type) > : m_type(type) >- , m_timestamp(0) > { > } > >- PlatformEvent(Type type, OptionSet<Modifier> modifiers, double timestamp) >+ PlatformEvent(Type type, OptionSet<Modifier> modifiers, WallTime timestamp) > : m_type(type) > , m_modifiers(modifiers) > , m_timestamp(timestamp) > { > } > >- PlatformEvent(Type type, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, double timestamp) >+ PlatformEvent(Type type, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, WallTime timestamp) > : m_type(type) > , m_timestamp(timestamp) > { >@@ -130,7 +129,7 @@ protected: > > unsigned m_type; > OptionSet<Modifier> m_modifiers; >- double m_timestamp; >+ WallTime m_timestamp; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/PlatformKeyboardEvent.h b/Source/WebCore/platform/PlatformKeyboardEvent.h >index 87ba57608df57bfd8ba40b78c0d96434d087c30a..97d03af92ad3812be5e9ce1394b85cc2cc7a65f6 100644 >--- a/Source/WebCore/platform/PlatformKeyboardEvent.h >+++ b/Source/WebCore/platform/PlatformKeyboardEvent.h >@@ -72,7 +72,7 @@ namespace WebCore { > #if ENABLE(KEYBOARD_CODE_ATTRIBUTE) > const String& code, > #endif >- const String& keyIdentifier, int windowsVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<Modifier> modifiers, double timestamp) >+ const String& keyIdentifier, int windowsVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<Modifier> modifiers, WallTime timestamp) > : PlatformEvent(type, modifiers, timestamp) > , m_text(text) > , m_unmodifiedText(unmodifiedText) >diff --git a/Source/WebCore/platform/PlatformMouseEvent.h b/Source/WebCore/platform/PlatformMouseEvent.h >index 104f5397092a907a1e985387dfb3d2adb7287a71..a4e7d58924c0d2c2c42413f4f2ec2ec6fccb2bf9 100644 >--- a/Source/WebCore/platform/PlatformMouseEvent.h >+++ b/Source/WebCore/platform/PlatformMouseEvent.h >@@ -61,7 +61,7 @@ const double ForceAtForceClick = 2; > } > > PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition, MouseButton button, PlatformEvent::Type type, >- int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, double timestamp, double force, SyntheticClickType syntheticClickType) >+ int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, WallTime timestamp, double force, SyntheticClickType syntheticClickType) > : PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp) > , m_position(position) > , m_globalPosition(globalPosition) >diff --git a/Source/WebCore/platform/PlatformWheelEvent.h b/Source/WebCore/platform/PlatformWheelEvent.h >index 6d458bef4b804f52bde294d1679b1613fc902480..29588210c83883f4db7d90c16fe4bdcaf9bf197c 100644 >--- a/Source/WebCore/platform/PlatformWheelEvent.h >+++ b/Source/WebCore/platform/PlatformWheelEvent.h >@@ -70,7 +70,7 @@ public: > } > > PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranularity granularity, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey) >- : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey, 0) >+ : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey, { }) > , m_position(position) > , m_globalPosition(globalPosition) > , m_deltaX(deltaX) >diff --git a/Source/WebCore/platform/cocoa/ScrollController.mm b/Source/WebCore/platform/cocoa/ScrollController.mm >index d379e2474d166654a4c129cccb0f1ede3e6325e3..0b2b28180c443636b549badc55bcfba9abe455ec 100644 >--- a/Source/WebCore/platform/cocoa/ScrollController.mm >+++ b/Source/WebCore/platform/cocoa/ScrollController.mm >@@ -179,14 +179,14 @@ bool ScrollController::handleWheelEvent(const PlatformWheelEvent& wheelEvent) > if (!m_momentumScrollInProgress && (momentumPhase == PlatformWheelEventPhaseBegan || momentumPhase == PlatformWheelEventPhaseChanged)) > m_momentumScrollInProgress = true; > >- CFTimeInterval timeDelta = wheelEvent.timestamp() - m_lastMomentumScrollTimestamp; >+ CFTimeInterval timeDelta = wheelEvent.timestamp().secondsSinceEpoch().value() - m_lastMomentumScrollTimestamp; > if (m_inScrollGesture || m_momentumScrollInProgress) { > if (m_lastMomentumScrollTimestamp && timeDelta > 0 && timeDelta < scrollVelocityZeroingTimeout) { > m_momentumVelocity.setWidth(eventCoalescedDeltaX / (float)timeDelta); > m_momentumVelocity.setHeight(eventCoalescedDeltaY / (float)timeDelta); >- m_lastMomentumScrollTimestamp = wheelEvent.timestamp(); >+ m_lastMomentumScrollTimestamp = wheelEvent.timestamp().secondsSinceEpoch().value(); > } else { >- m_lastMomentumScrollTimestamp = wheelEvent.timestamp(); >+ m_lastMomentumScrollTimestamp = wheelEvent.timestamp().secondsSinceEpoch().value(); > m_momentumVelocity = FloatSize(); > } > >diff --git a/Source/WebCore/platform/glib/EventHandlerGLib.cpp b/Source/WebCore/platform/glib/EventHandlerGLib.cpp >index bfa4c6c10e4b19e5051008235690bf3ab7704e98..a5e6853ae2dc6101f1d6c7a2bceada1b30690d31 100644 >--- a/Source/WebCore/platform/glib/EventHandlerGLib.cpp >+++ b/Source/WebCore/platform/glib/EventHandlerGLib.cpp >@@ -49,7 +49,7 @@ > namespace WebCore { > > #if ENABLE(DRAG_SUPPORT) >-const double EventHandler::TextDragDelay = 0.0; >+const Seconds EventHandler::TextDragDelay { 0_s }; > #endif > > bool EventHandler::tabsToAllFormControls(KeyboardEvent&) const >diff --git a/Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp b/Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp >index d9b95a97ddb9761fd3c076af8aa796d63f1359b5..4fc13becc3ab2d61aed44b9fe8c2a1718e0f1f16 100644 >--- a/Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp >+++ b/Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp >@@ -1259,7 +1259,7 @@ static OptionSet<PlatformEvent::Modifier> modifiersForGdkKeyEvent(GdkEventKey* e > > // Keep this in sync with the other platform event constructors > PlatformKeyboardEvent::PlatformKeyboardEvent(GdkEventKey* event, const CompositionResults& compositionResults) >- : PlatformEvent(eventTypeForGdkKeyEvent(event), modifiersForGdkKeyEvent(event), currentTime()) >+ : PlatformEvent(eventTypeForGdkKeyEvent(event), modifiersForGdkKeyEvent(event), WallTime::now()) > , m_text(compositionResults.simpleString.length() ? compositionResults.simpleString : singleCharacterString(event->keyval)) > , m_unmodifiedText(m_text) > , m_key(keyValueForGdkKeyCode(event->keyval)) >diff --git a/Source/WebCore/platform/gtk/PlatformMouseEventGtk.cpp b/Source/WebCore/platform/gtk/PlatformMouseEventGtk.cpp >index b6924856cb8b03ce68991e42f5d53a31ad6e578d..ec91afeef7a5bf1da05e9492bab026c4dd0a9a80 100644 >--- a/Source/WebCore/platform/gtk/PlatformMouseEventGtk.cpp >+++ b/Source/WebCore/platform/gtk/PlatformMouseEventGtk.cpp >@@ -38,7 +38,7 @@ namespace WebCore { > // Keep this in sync with the other platform event constructors > PlatformMouseEvent::PlatformMouseEvent(GdkEventButton* event) > { >- m_timestamp = event->time; >+ m_timestamp = WallTime::fromRawSeconds(event->time); > m_position = IntPoint((int)event->x, (int)event->y); > m_globalPosition = IntPoint((int)event->x_root, (int)event->y_root); > m_button = NoButton; >@@ -87,7 +87,7 @@ PlatformMouseEvent::PlatformMouseEvent(GdkEventButton* event) > > PlatformMouseEvent::PlatformMouseEvent(GdkEventMotion* motion) > { >- m_timestamp = motion->time; >+ m_timestamp = WallTime::fromRawSeconds(motion->time); > m_position = IntPoint((int)motion->x, (int)motion->y); > m_globalPosition = IntPoint((int)motion->x_root, (int)motion->y_root); > m_button = NoButton; >diff --git a/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp b/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp >index 3b0e5906fcd502cf9c5d7dcaa9ec7a2d9ac23c8e..4e6d792520c48471778c9933ea6254921470af70 100644 >--- a/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp >+++ b/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp >@@ -33,7 +33,7 @@ > #include "Scrollbar.h" > #include <gdk/gdk.h> > #include <gtk/gtk.h> >-#include <wtf/CurrentTime.h> >+#include <wtf/WallTime.h> > > namespace WebCore { > >@@ -43,7 +43,7 @@ PlatformWheelEvent::PlatformWheelEvent(GdkEventScroll* event) > static const float delta = 1; > > m_type = PlatformEvent::Wheel; >- m_timestamp = currentTime(); >+ m_timestamp = WallTime::now(); > > if (event->state & GDK_SHIFT_MASK) > m_modifiers |= Modifier::ShiftKey; >diff --git a/Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp b/Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp >index c2aa9dc01f767eea98e313a864a6a2782ba8f04b..43df2303fd87110d00189975c99a1febc443b243 100644 >--- a/Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp >+++ b/Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp >@@ -112,8 +112,8 @@ FloatPoint ScrollAnimatorGtk::computeVelocity() > if (m_scrollHistory.isEmpty()) > return { }; > >- double first = m_scrollHistory[0].timestamp(); >- double last = m_scrollHistory.rbegin()->timestamp(); >+ auto first = m_scrollHistory[0].timestamp(); >+ auto last = m_scrollHistory.rbegin()->timestamp(); > > if (last == first) > return { }; >@@ -124,7 +124,7 @@ FloatPoint ScrollAnimatorGtk::computeVelocity() > > m_scrollHistory.clear(); > >- return FloatPoint(accumDelta.x() * -1000 / (last - first), accumDelta.y() * -1000 / (last - first)); >+ return FloatPoint(accumDelta.x() * -1000 / (last - first).value(), accumDelta.y() * -1000 / (last - first).value()); > } > > bool ScrollAnimatorGtk::handleWheelEvent(const PlatformWheelEvent& event) >@@ -132,7 +132,7 @@ bool ScrollAnimatorGtk::handleWheelEvent(const PlatformWheelEvent& event) > m_kineticAnimation->stop(); > > m_scrollHistory.removeAllMatching([&event] (PlatformWheelEvent& otherEvent) -> bool { >- return Seconds::fromMilliseconds(event.timestamp() - otherEvent.timestamp()) > scrollCaptureThreshold; >+ return (event.timestamp() - otherEvent.timestamp()) > scrollCaptureThreshold; > }); > > if (event.isEndOfNonMomentumScroll()) { >diff --git a/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm b/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm >index 062f9823771bdfa36029e25689f3d8f163923146..48c840332b89bfa926101760b7fb081c210d5463 100644 >--- a/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm >+++ b/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm >@@ -32,7 +32,7 @@ > #import "WAKAppKitStubs.h" > #import "WebEvent.h" > #import "WindowsKeyboardCodes.h" >-#import <wtf/CurrentTime.h> >+#import <wtf/WallTime.h> > > namespace WebCore { > >@@ -85,7 +85,7 @@ public: > PlatformMouseEventBuilder(WebEvent *event) > { > m_type = mouseEventType(event); >- m_timestamp = currentTime(); >+ m_timestamp = WallTime::now(); > > m_position = pointForEvent(event); > m_globalPosition = globalPointForEvent(event); >@@ -106,7 +106,7 @@ public: > ASSERT(event.type == WebEventScrollWheel); > > m_type = PlatformEvent::Wheel; >- m_timestamp = currentTime(); >+ m_timestamp = WallTime::now(); > > m_position = pointForEvent(event); > m_globalPosition = globalPointForEvent(event); >@@ -369,7 +369,7 @@ public: > > m_type = (event.type == WebEventKeyUp ? PlatformEvent::KeyUp : PlatformEvent::KeyDown); > m_modifiers = modifiersForEvent(event); >- m_timestamp = currentTime(); >+ m_timestamp = WallTime::now(); > > m_text = event.characters; > m_unmodifiedText = event.charactersIgnoringModifiers; >@@ -475,7 +475,7 @@ public: > { > m_type = touchEventType(event); > m_modifiers = modifiersForEvent(event); >- m_timestamp = event.timestamp; >+ m_timestamp = WallTime::fromRawSeconds(event.timestamp); > > m_gestureScale = event.gestureScale; > m_gestureRotation = event.gestureRotation; >@@ -496,7 +496,7 @@ public: > PlatformTouchEventBuilder(PlatformEvent::Type type, IntPoint location) > { > m_type = type; >- m_timestamp = currentTime(); >+ m_timestamp = WallTime::now(); > > m_gestureScale = 1; > m_gestureRotation = 0; >diff --git a/Source/WebCore/platform/mac/PlatformEventFactoryMac.h b/Source/WebCore/platform/mac/PlatformEventFactoryMac.h >index d20a2d8ee90f4c1867b96e594921959c4f6c026f..c40ec21f12a178df88e9bf2904a0d7fd7795b926 100644 >--- a/Source/WebCore/platform/mac/PlatformEventFactoryMac.h >+++ b/Source/WebCore/platform/mac/PlatformEventFactoryMac.h >@@ -48,7 +48,7 @@ WEBCORE_EXPORT int windowsKeyCodeForKeyEvent(NSEvent *); > WEBCORE_EXPORT String keyIdentifierForKeyEvent(NSEvent *); > WEBCORE_EXPORT String keyForKeyEvent(NSEvent *); > WEBCORE_EXPORT String codeForKeyEvent(NSEvent *); >-WEBCORE_EXPORT double eventTimeStampSince1970(NSEvent *); >+WEBCORE_EXPORT WallTime eventTimeStampSince1970(NSEvent *); > > WEBCORE_EXPORT void getWheelEventDeltas(NSEvent *, float& deltaX, float& deltaY, BOOL& continuous); > WEBCORE_EXPORT UInt8 keyCharForEvent(NSEvent *); >diff --git a/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm b/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm >index 2b18224f8349ffbb6e3c18a8d1541545d9c2ab62..7941cd6c4dd2828c6d6f739c0b252a4798c56990 100644 >--- a/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm >+++ b/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm >@@ -39,6 +39,7 @@ > #import <pal/spi/mac/NSEventSPI.h> > #import <pal/spi/mac/NSMenuSPI.h> > #import <wtf/ASCIICType.h> >+#import <wtf/WallTime.h> > > namespace WebCore { > >@@ -617,9 +618,9 @@ static CFTimeInterval cachedStartupTimeIntervalSince1970() > return systemStartupTime; > } > >-double eventTimeStampSince1970(NSEvent* event) >+WallTime eventTimeStampSince1970(NSEvent* event) > { >- return static_cast<double>(cachedStartupTimeIntervalSince1970() + [event timestamp]); >+ return WallTime::fromRawSeconds(static_cast<double>(cachedStartupTimeIntervalSince1970() + [event timestamp])); > } > > static inline bool isKeyUpEvent(NSEvent *event) >diff --git a/Source/WebCore/platform/win/KeyEventWin.cpp b/Source/WebCore/platform/win/KeyEventWin.cpp >index 6555aef098fdb0d03084241ec78f18d241030c4a..62ccac3b885127e26c0c9ec5ee7a27c734f61b49 100644 >--- a/Source/WebCore/platform/win/KeyEventWin.cpp >+++ b/Source/WebCore/platform/win/KeyEventWin.cpp >@@ -220,7 +220,7 @@ static inline String singleCharacterString(UChar c) > } > > PlatformKeyboardEvent::PlatformKeyboardEvent(HWND, WPARAM code, LPARAM keyData, Type type, bool systemKey) >- : PlatformEvent(type, GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_CONTROL) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, false, ::GetTickCount() * 0.001) >+ : PlatformEvent(type, GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_CONTROL) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, false, WallTime::fromRawSeconds(::GetTickCount() * 0.001)) > , m_text((type == PlatformEvent::Char) ? singleCharacterString(code) : String()) > , m_unmodifiedText((type == PlatformEvent::Char) ? singleCharacterString(code) : String()) > , m_keyIdentifier((type == PlatformEvent::Char) ? String() : keyIdentifierForWindowsKeyCode(code)) >diff --git a/Source/WebCore/platform/win/PlatformMouseEventWin.cpp b/Source/WebCore/platform/win/PlatformMouseEventWin.cpp >index 000fd3ac33185582419932d5c257f68e9366676d..ea247c9e6c58f42fef4dfaa312caddea0a86c1bc 100644 >--- a/Source/WebCore/platform/win/PlatformMouseEventWin.cpp >+++ b/Source/WebCore/platform/win/PlatformMouseEventWin.cpp >@@ -81,7 +81,7 @@ static PlatformEvent::Type messageToEventType(UINT message) > } > > PlatformMouseEvent::PlatformMouseEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool didActivateWebView) >- : PlatformEvent(messageToEventType(message), wParam & MK_SHIFT, wParam & MK_CONTROL, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, currentTime()) >+ : PlatformEvent(messageToEventType(message), wParam & MK_SHIFT, wParam & MK_CONTROL, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, WallTime::now()) > , m_position(positionForEvent(hWnd, lParam)) > , m_globalPosition(globalPositionForEvent(hWnd, lParam)) > , m_clickCount(0) >diff --git a/Source/WebCore/platform/win/WheelEventWin.cpp b/Source/WebCore/platform/win/WheelEventWin.cpp >index 9ef248bc74f6d505eeb7ed672be93fe3875c5128..6dbea20e462f04cb70a7fd358515986c8a86b08d 100644 >--- a/Source/WebCore/platform/win/WheelEventWin.cpp >+++ b/Source/WebCore/platform/win/WheelEventWin.cpp >@@ -73,7 +73,7 @@ static int verticalScrollLines() > } > > PlatformWheelEvent::PlatformWheelEvent(HWND hWnd, const FloatSize& delta, const FloatPoint& location) >- : PlatformEvent(PlatformEvent::Wheel, false, false, false, false, ::GetTickCount() * 0.001) >+ : PlatformEvent(PlatformEvent::Wheel, false, false, false, false, WallTime::fromRawSeconds(::GetTickCount() * 0.001)) > , m_directionInvertedFromDevice(false) > { > m_deltaX = delta.width(); >@@ -95,7 +95,7 @@ PlatformWheelEvent::PlatformWheelEvent(HWND hWnd, const FloatSize& delta, const > } > > PlatformWheelEvent::PlatformWheelEvent(HWND hWnd, WPARAM wParam, LPARAM lParam, bool isMouseHWheel) >- : PlatformEvent(PlatformEvent::Wheel, wParam & MK_SHIFT, wParam & MK_CONTROL, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, ::GetTickCount() * 0.001) >+ : PlatformEvent(PlatformEvent::Wheel, wParam & MK_SHIFT, wParam & MK_CONTROL, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, WallTime::fromRawSeconds(::GetTickCount() * 0.001)) > , m_position(positionForEvent(hWnd, lParam)) > , m_globalPosition(globalPositionForEvent(hWnd, lParam)) > , m_directionInvertedFromDevice(false) >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >index e7d41c71039d193642b129a228d9ed90af185538..aa9980c34247c6ea89f9559a2df95a4f28c191e1 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >@@ -75,6 +75,7 @@ > #include <pal/SessionID.h> > #include <wtf/MonotonicTime.h> > #include <wtf/Seconds.h> >+#include <wtf/WallTime.h> > #include <wtf/text/CString.h> > #include <wtf/text/StringHash.h> > >@@ -160,6 +161,21 @@ bool ArgumentCoder<MonotonicTime>::decode(Decoder& decoder, MonotonicTime& time) > return true; > } > >+void ArgumentCoder<WallTime>::encode(Encoder& encoder, const WallTime& time) >+{ >+ encoder << time.secondsSinceEpoch().value(); >+} >+ >+bool ArgumentCoder<WallTime>::decode(Decoder& decoder, WallTime& time) >+{ >+ double value; >+ if (!decoder.decode(value)) >+ return false; >+ >+ time = WallTime::fromRawSeconds(value); >+ return true; >+} >+ > void ArgumentCoder<Seconds>::encode(Encoder& encoder, const Seconds& seconds) > { > encoder << seconds.value(); >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.h b/Source/WebKit/Shared/WebCoreArgumentCoders.h >index 5b5fd3974134a9d4a99449b5b997598639124c6e..08c38390b84ce48741cd44fe141ee56b84b92c43 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.h >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.h >@@ -43,6 +43,7 @@ > namespace WTF { > class MonotonicTime; > class Seconds; >+class WallTime; > } > > namespace WebCore { >@@ -162,6 +163,11 @@ template<> struct ArgumentCoder<WTF::MonotonicTime> { > static bool decode(Decoder&, WTF::MonotonicTime&); > }; > >+template<> struct ArgumentCoder<WTF::WallTime> { >+ static void encode(Encoder&, const WTF::WallTime&); >+ static bool decode(Decoder&, WTF::WallTime&); >+}; >+ > template<> struct ArgumentCoder<WTF::Seconds> { > static void encode(Encoder&, const WTF::Seconds&); > static bool decode(Decoder&, WTF::Seconds&); >diff --git a/Source/WebKit/Shared/WebEvent.cpp b/Source/WebKit/Shared/WebEvent.cpp >index 507bc166289ed5e26246fb9c5b7e707e802d19bc..5a086f97b8394a8c884ff60ff7957facde5df57f 100644 >--- a/Source/WebKit/Shared/WebEvent.cpp >+++ b/Source/WebKit/Shared/WebEvent.cpp >@@ -28,17 +28,17 @@ > > #include "Decoder.h" > #include "Encoder.h" >+#include "WebCoreArgumentCoders.h" > > namespace WebKit { > > WebEvent::WebEvent() > : m_type(static_cast<uint32_t>(NoType)) > , m_modifiers(0) >- , m_timestamp(0) > { > } > >-WebEvent::WebEvent(Type type, Modifiers modifiers, double timestamp) >+WebEvent::WebEvent(Type type, Modifiers modifiers, WallTime timestamp) > : m_type(type) > , m_modifiers(modifiers) > , m_timestamp(timestamp) >diff --git a/Source/WebKit/Shared/WebEvent.h b/Source/WebKit/Shared/WebEvent.h >index 210186dc0fdc0f6620542badaac2a63dc8bf3e21..2d459f6a106f681af88a375e3ee65f5b2be3978a 100644 >--- a/Source/WebKit/Shared/WebEvent.h >+++ b/Source/WebKit/Shared/WebEvent.h >@@ -34,6 +34,7 @@ > #include <WebCore/FloatSize.h> > #include <WebCore/IntPoint.h> > #include <WebCore/IntSize.h> >+#include <wtf/WallTime.h> > #include <wtf/text/WTFString.h> > > namespace IPC { >@@ -104,12 +105,12 @@ public: > > Modifiers modifiers() const { return static_cast<Modifiers>(m_modifiers); } > >- double timestamp() const { return m_timestamp; } >+ WallTime timestamp() const { return m_timestamp; } > > protected: > WebEvent(); > >- WebEvent(Type, Modifiers, double timestamp); >+ WebEvent(Type, Modifiers, WallTime timestamp); > > void encode(IPC::Encoder&) const; > static bool decode(IPC::Decoder&, WebEvent&); >@@ -117,7 +118,7 @@ protected: > private: > uint32_t m_type; // Type > uint32_t m_modifiers; // Modifiers >- double m_timestamp; >+ WallTime m_timestamp; > }; > > // FIXME: Move this class to its own header file. >@@ -135,9 +136,9 @@ public: > WebMouseEvent(); > > #if PLATFORM(MAC) >- WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, double force, SyntheticClickType = NoTap, int eventNumber = -1, int menuType = 0); >+ WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, WallTime timestamp, double force, SyntheticClickType = NoTap, int eventNumber = -1, int menuType = 0); > #else >- WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, double force = 0, SyntheticClickType = NoTap); >+ WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, WallTime timestamp, double force = 0, SyntheticClickType = NoTap); > #endif > > Button button() const { return static_cast<Button>(m_button); } >@@ -197,11 +198,11 @@ public: > > WebWheelEvent() { } > >- WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, Modifiers, double timestamp); >+ WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, Modifiers, WallTime timestamp); > #if PLATFORM(COCOA) >- WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, bool directionInvertedFromDevice, Phase, Phase momentumPhase, bool hasPreciseScrollingDeltas, uint32_t scrollCount, const WebCore::FloatSize& unacceleratedScrollingDelta, Modifiers, double timestamp); >+ WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, bool directionInvertedFromDevice, Phase, Phase momentumPhase, bool hasPreciseScrollingDeltas, uint32_t scrollCount, const WebCore::FloatSize& unacceleratedScrollingDelta, Modifiers, WallTime timestamp); > #elif PLATFORM(GTK) >- WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Phase, Phase momentumPhase, Granularity, Modifiers, double timestamp); >+ WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Phase, Phase momentumPhase, Granularity, Modifiers, WallTime timestamp); > #endif > > const WebCore::IntPoint position() const { return m_position; } >@@ -250,13 +251,13 @@ public: > ~WebKeyboardEvent(); > > #if USE(APPKIT) >- WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>&, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers, double timestamp); >+ WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>&, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers, WallTime timestamp); > #elif PLATFORM(GTK) >- WebKeyboardEvent(Type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Vector<String>&& commands, bool isKeypad, Modifiers, double timestamp); >+ WebKeyboardEvent(Type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Vector<String>&& commands, bool isKeypad, Modifiers, WallTime timestamp); > #elif PLATFORM(IOS) >- WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers, double timestamp); >+ WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers, WallTime timestamp); > #else >- WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers, double timestamp); >+ WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers, WallTime timestamp); > #endif > > const String& text() const { return m_text; } >@@ -382,7 +383,7 @@ private: > class WebTouchEvent : public WebEvent { > public: > WebTouchEvent() { } >- WebTouchEvent(WebEvent::Type type, Modifiers modifiers, double timestamp, const Vector<WebPlatformTouchPoint>& touchPoints, WebCore::IntPoint position, bool isPotentialTap, bool isGesture, float gestureScale, float gestureRotation) >+ WebTouchEvent(WebEvent::Type type, Modifiers modifiers, WallTime timestamp, const Vector<WebPlatformTouchPoint>& touchPoints, WebCore::IntPoint position, bool isPotentialTap, bool isGesture, float gestureScale, float gestureRotation) > : WebEvent(type, modifiers, timestamp) > , m_touchPoints(touchPoints) > , m_position(position) >@@ -471,7 +472,7 @@ private: > class WebTouchEvent : public WebEvent { > public: > WebTouchEvent() { } >- WebTouchEvent(Type, Vector<WebPlatformTouchPoint>&&, Modifiers, double timestamp); >+ WebTouchEvent(Type, Vector<WebPlatformTouchPoint>&&, Modifiers, WallTime timestamp); > > const Vector<WebPlatformTouchPoint>& touchPoints() const { return m_touchPoints; } > >diff --git a/Source/WebKit/Shared/WebKeyboardEvent.cpp b/Source/WebKit/Shared/WebKeyboardEvent.cpp >index eb4771fda5368e7fad2ad2f174c4472b526a26fc..0cf27199621cf6deda0ea4ed6603a9196e1cee77 100644 >--- a/Source/WebKit/Shared/WebKeyboardEvent.cpp >+++ b/Source/WebKit/Shared/WebKeyboardEvent.cpp >@@ -37,7 +37,7 @@ WebKeyboardEvent::WebKeyboardEvent() > > #if USE(APPKIT) > >-WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>& commands, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers modifiers, double timestamp) >+WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>& commands, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers modifiers, WallTime timestamp) > : WebEvent(type, modifiers, timestamp) > , m_text(text) > , m_unmodifiedText(unmodifiedText) >@@ -62,7 +62,7 @@ WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& > > #elif PLATFORM(GTK) > >-WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Vector<String>&& commands, bool isKeypad, Modifiers modifiers, double timestamp) >+WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Vector<String>&& commands, bool isKeypad, Modifiers modifiers, WallTime timestamp) > : WebEvent(type, modifiers, timestamp) > , m_text(text) > , m_unmodifiedText(text) >@@ -83,7 +83,7 @@ WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& > > #elif PLATFORM(IOS) > >-WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers modifiers, double timestamp) >+WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers modifiers, WallTime timestamp) > : WebEvent(type, modifiers, timestamp) > , m_text(text) > , m_unmodifiedText(unmodifiedText) >@@ -106,7 +106,7 @@ WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& > > #else > >-WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& unmodifiedText, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers modifiers, double timestamp) >+WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& unmodifiedText, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers modifiers, WallTime timestamp) > : WebEvent(type, modifiers, timestamp) > , m_text(text) > , m_unmodifiedText(unmodifiedText) >diff --git a/Source/WebKit/Shared/WebMouseEvent.cpp b/Source/WebKit/Shared/WebMouseEvent.cpp >index 8da8d3fe83360a570fdc47238279f19daa05f389..0f77fae3d0df78b753dec589f085c76eafbfb821 100644 >--- a/Source/WebKit/Shared/WebMouseEvent.cpp >+++ b/Source/WebKit/Shared/WebMouseEvent.cpp >@@ -47,9 +47,9 @@ WebMouseEvent::WebMouseEvent() > } > > #if PLATFORM(MAC) >-WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp, double force, SyntheticClickType syntheticClickType, int eventNumber, int menuType) >+WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, WallTime timestamp, double force, SyntheticClickType syntheticClickType, int eventNumber, int menuType) > #else >-WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp, double force, SyntheticClickType syntheticClickType) >+WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, WallTime timestamp, double force, SyntheticClickType syntheticClickType) > #endif > : WebEvent(type, modifiers, timestamp) > , m_button(button) >diff --git a/Source/WebKit/Shared/WebTouchEvent.cpp b/Source/WebKit/Shared/WebTouchEvent.cpp >index b9aacbaf6e7d07ad9c97f33f53003452bd792caf..7aea0e73d9c556a62777137d42723b071eddea1e 100644 >--- a/Source/WebKit/Shared/WebTouchEvent.cpp >+++ b/Source/WebKit/Shared/WebTouchEvent.cpp >@@ -32,7 +32,7 @@ > > namespace WebKit { > >-WebTouchEvent::WebTouchEvent(WebEvent::Type type, Vector<WebPlatformTouchPoint>&& touchPoints, Modifiers modifiers, double timestamp) >+WebTouchEvent::WebTouchEvent(WebEvent::Type type, Vector<WebPlatformTouchPoint>&& touchPoints, Modifiers modifiers, WallTime timestamp) > : WebEvent(type, modifiers, timestamp) > , m_touchPoints(WTFMove(touchPoints)) > { >diff --git a/Source/WebKit/Shared/WebWheelEvent.cpp b/Source/WebKit/Shared/WebWheelEvent.cpp >index 13fe48de99d98dc9f6eaabf6f8452cfab144d24d..4e13e896521c34c8e1bc3c73cc8f23a52459f7ef 100644 >--- a/Source/WebKit/Shared/WebWheelEvent.cpp >+++ b/Source/WebKit/Shared/WebWheelEvent.cpp >@@ -32,7 +32,7 @@ using namespace WebCore; > > namespace WebKit { > >-WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const FloatSize& delta, const FloatSize& wheelTicks, Granularity granularity, Modifiers modifiers, double timestamp) >+WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const FloatSize& delta, const FloatSize& wheelTicks, Granularity granularity, Modifiers modifiers, WallTime timestamp) > : WebEvent(type, modifiers, timestamp) > , m_position(position) > , m_globalPosition(globalPosition) >@@ -50,7 +50,7 @@ WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint > } > > #if PLATFORM(COCOA) >-WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const FloatSize& delta, const FloatSize& wheelTicks, Granularity granularity, bool directionInvertedFromDevice, Phase phase, Phase momentumPhase, bool hasPreciseScrollingDeltas, uint32_t scrollCount, const WebCore::FloatSize& unacceleratedScrollingDelta, Modifiers modifiers, double timestamp) >+WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const FloatSize& delta, const FloatSize& wheelTicks, Granularity granularity, bool directionInvertedFromDevice, Phase phase, Phase momentumPhase, bool hasPreciseScrollingDeltas, uint32_t scrollCount, const WebCore::FloatSize& unacceleratedScrollingDelta, Modifiers modifiers, WallTime timestamp) > : WebEvent(type, modifiers, timestamp) > , m_position(position) > , m_globalPosition(globalPosition) >@@ -67,7 +67,7 @@ WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint > ASSERT(isWheelEventType(type)); > } > #elif PLATFORM(GTK) >-WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const FloatSize& delta, const FloatSize& wheelTicks, Phase phase, Phase momentumPhase, Granularity granularity, Modifiers modifiers, double timestamp) >+WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const FloatSize& delta, const FloatSize& wheelTicks, Phase phase, Phase momentumPhase, Granularity granularity, Modifiers modifiers, WallTime timestamp) > : WebEvent(type, modifiers, timestamp) > , m_position(position) > , m_globalPosition(globalPosition) >diff --git a/Source/WebKit/Shared/gtk/WebEventFactory.cpp b/Source/WebKit/Shared/gtk/WebEventFactory.cpp >index 68d6d38859a02073e98a7c8a7ee626e309add5db..bcea329d2283ca984566637a1d8d75d516084a8c 100644 >--- a/Source/WebKit/Shared/gtk/WebEventFactory.cpp >+++ b/Source/WebKit/Shared/gtk/WebEventFactory.cpp >@@ -140,7 +140,7 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(const GdkEvent* event, int cu > 0 /* deltaZ */, > currentClickCount, > modifiersForEvent(event), >- gdk_event_get_time(event)); >+ WallTime::fromRawSeconds(gdk_event_get_time(event))); > } > > WebWheelEvent WebEventFactory::createWebWheelEvent(const GdkEvent* event) >@@ -210,7 +210,7 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(const GdkEvent* event, WebWhe > momentumPhase, > WebWheelEvent::ScrollByPixelWheelEvent, > modifiersForEvent(event), >- gdk_event_get_time(event)); >+ WallTime::fromRawSeconds(gdk_event_get_time(event))); > } > > WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(const GdkEvent* event, const WebCore::CompositionResults& compositionResults, Vector<String>&& commands) >@@ -227,7 +227,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(const GdkEvent* event, > WTFMove(commands), > isGdkKeyCodeFromKeyPad(event->key.keyval), > modifiersForEvent(event), >- gdk_event_get_time(event)); >+ WallTime::fromRawSeconds(gdk_event_get_time(event))); > } > > #if ENABLE(TOUCH_EVENTS) >@@ -249,7 +249,7 @@ WebTouchEvent WebEventFactory::createWebTouchEvent(const GdkEvent* event, Vector > ASSERT_NOT_REACHED(); > } > >- return WebTouchEvent(type, WTFMove(touchPoints), modifiersForEvent(event), gdk_event_get_time(event)); >+ return WebTouchEvent(type, WTFMove(touchPoints), modifiersForEvent(event), WallTime::fromRawSeconds(gdk_event_get_time(event))); > #else > return WebTouchEvent(); > #endif // GTK_API_VERSION_2 >diff --git a/Source/WebKit/Shared/ios/NativeWebTouchEventIOS.mm b/Source/WebKit/Shared/ios/NativeWebTouchEventIOS.mm >index 68e0e6cafdf5dc55af87da8383a17f53fb196cd5..7fc777e1f20f8289a1945f38befcd696e02fafab 100644 >--- a/Source/WebKit/Shared/ios/NativeWebTouchEventIOS.mm >+++ b/Source/WebKit/Shared/ios/NativeWebTouchEventIOS.mm >@@ -122,7 +122,7 @@ NativeWebTouchEvent::NativeWebTouchEvent(const _UIWebTouchEvent* event) > : WebTouchEvent( > webEventTypeForUIWebTouchEventType(event->type), > static_cast<Modifiers>(0), >- event->timestamp, >+ WallTime::fromRawSeconds(event->timestamp), > extractWebTouchPoint(event), > positionForCGPoint(event->locationInDocumentCoordinates), > #if defined UI_WEB_TOUCH_EVENT_HAS_IS_POTENTIAL_TAP && UI_WEB_TOUCH_EVENT_HAS_IS_POTENTIAL_TAP >diff --git a/Source/WebKit/Shared/ios/WebIOSEventFactory.mm b/Source/WebKit/Shared/ios/WebIOSEventFactory.mm >index 4e0259bdae71754756bfa2a3e69ac985f073a85e..90fbc28a678385560c8c93e86c6137031034bc7a 100644 >--- a/Source/WebKit/Shared/ios/WebIOSEventFactory.mm >+++ b/Source/WebKit/Shared/ios/WebIOSEventFactory.mm >@@ -85,7 +85,7 @@ WebKit::WebKeyboardEvent WebIOSEventFactory::createWebKeyboardEvent(::WebEvent * > unmodifiedText = text; > } > >- return WebKit::WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, macCharCode, autoRepeat, isKeypad, isSystemKey, modifiers, timestamp); >+ return WebKit::WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, macCharCode, autoRepeat, isKeypad, isSystemKey, modifiers, WallTime::fromRawSeconds(timestamp)); > } > > #endif // PLATFORM(IOS) >diff --git a/Source/WebKit/Shared/mac/NativeWebGestureEventMac.mm b/Source/WebKit/Shared/mac/NativeWebGestureEventMac.mm >index 3b55ce8092fda3ca2a986203e0182b656519a238..0c45bffb1f64a42df5e38c6f29ddeefdc49d8cc9 100644 >--- a/Source/WebKit/Shared/mac/NativeWebGestureEventMac.mm >+++ b/Source/WebKit/Shared/mac/NativeWebGestureEventMac.mm >@@ -31,7 +31,7 @@ > #import "WebEvent.h" > #import "WebGestureEvent.h" > #import <WebCore/IntPoint.h> >-#import <wtf/CurrentTime.h> >+#import <WebCore/PlatformEventFactoryMac.h> > > namespace WebKit { > >@@ -63,7 +63,7 @@ NativeWebGestureEvent::NativeWebGestureEvent(NSEvent *event, NSView *view) > : WebGestureEvent( > webEventTypeForNSEvent(event), > static_cast<Modifiers>(0), >- event.timestamp, >+ WebCore::eventTimeStampSince1970(event), > WebCore::IntPoint(pointForEvent(event, view)), > event.type == NSEventTypeMagnify ? event.magnification : 0, > event.type == NSEventTypeRotate ? event.rotation : 0) >diff --git a/Source/WebKit/Shared/mac/WebEventFactory.mm b/Source/WebKit/Shared/mac/WebEventFactory.mm >index 0db3be8c6474c7632985fe3ea2215b48c6afc05b..9d85594a366c65df2fcd17f3d085f13e1d613eb9 100644 >--- a/Source/WebKit/Shared/mac/WebEventFactory.mm >+++ b/Source/WebKit/Shared/mac/WebEventFactory.mm >@@ -360,7 +360,7 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(NSEvent *event, NSEvent *last > float deltaZ = [event deltaZ]; > int clickCount = clickCountForEvent(event); > WebEvent::Modifiers modifiers = modifiersForEvent(event); >- double timestamp = eventTimeStampSince1970(event); >+ auto timestamp = eventTimeStampSince1970(event); > int eventNumber = [event eventNumber]; > int menuTypeForEvent = typeForEvent(event); > >@@ -418,7 +418,7 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(NSEvent *event, NSView *windo > } > > WebEvent::Modifiers modifiers = modifiersForEvent(event); >- double timestamp = eventTimeStampSince1970(event); >+ auto timestamp = eventTimeStampSince1970(event); > > return WebWheelEvent(WebEvent::Wheel, IntPoint(position), IntPoint(globalPosition), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, directionInvertedFromDevice, phase, momentumPhase, hasPreciseScrollingDeltas, scrollCount, unacceleratedScrollingDelta, modifiers, timestamp); > } >@@ -438,7 +438,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(NSEvent *event, bool ha > bool isKeypad = isKeypadEvent(event); > bool isSystemKey = false; // SystemKey is always false on the Mac. > WebEvent::Modifiers modifiers = modifiersForEvent(event); >- double timestamp = eventTimeStampSince1970(event); >+ auto timestamp = eventTimeStampSince1970(event); > > // Always use 13 for Enter/Return -- we don't want to use AppKit's different character for Enter. > if (windowsVirtualKeyCode == VK_RETURN) { >diff --git a/Source/WebKit/Shared/mac/WebGestureEvent.h b/Source/WebKit/Shared/mac/WebGestureEvent.h >index bc68ba527a5ec82d308b830f6bebe8c0f200c394..b6f9c68db03a5a5fbb695b2bc1cc314e8c55c28a 100644 >--- a/Source/WebKit/Shared/mac/WebGestureEvent.h >+++ b/Source/WebKit/Shared/mac/WebGestureEvent.h >@@ -45,7 +45,7 @@ namespace WebKit { > class WebGestureEvent : public WebEvent { > public: > WebGestureEvent() { } >- WebGestureEvent(WebEvent::Type type, Modifiers modifiers, double timestamp, WebCore::IntPoint position, float gestureScale, float gestureRotation) >+ WebGestureEvent(WebEvent::Type type, Modifiers modifiers, WallTime timestamp, WebCore::IntPoint position, float gestureScale, float gestureRotation) > : WebEvent(type, modifiers, timestamp) > , m_position(position) > , m_gestureScale(gestureScale) >diff --git a/Source/WebKit/Shared/wpe/WebEventFactory.cpp b/Source/WebKit/Shared/wpe/WebEventFactory.cpp >index e0ac6ef85a94a72b22eede070689c72f5ceef976..94741306633a83a94e40dc80e45b99d99e5b17a4 100644 >--- a/Source/WebKit/Shared/wpe/WebEventFactory.cpp >+++ b/Source/WebKit/Shared/wpe/WebEventFactory.cpp >@@ -81,7 +81,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(struct wpe_input_keyboa > singleCharacterString, singleCharacterString, identifierString, > wpe_input_windows_key_code_for_key_event(wpe_input_key_mapper_get_singleton(), event), > event->keyCode, 0, false, false, false, >- modifiersForEvent(event), event->time); >+ modifiersForEvent(event), WallTime::fromRawSeconds(event->time)); > } > > WebMouseEvent WebEventFactory::createWebMouseEvent(struct wpe_input_pointer_event* event, float deviceScaleFactor) >@@ -119,7 +119,7 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(struct wpe_input_pointer_even > WebCore::IntPoint position(event->x, event->y); > position.scale(1 / deviceScaleFactor); > return WebMouseEvent(type, button, position, position, >- 0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(0), event->time); >+ 0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(0), WallTime::fromRawSeconds(event->time)); > } > > WebWheelEvent WebEventFactory::createWebWheelEvent(struct wpe_input_axis_event* event, float deviceScaleFactor) >@@ -154,7 +154,7 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(struct wpe_input_axis_event* > WebCore::IntPoint position(event->x, event->y); > position.scale(1 / deviceScaleFactor); > return WebWheelEvent(WebEvent::Wheel, position, position, >- delta, wheelTicks, WebWheelEvent::ScrollByPixelWheelEvent, static_cast<WebEvent::Modifiers>(0), event->time); >+ delta, wheelTicks, WebWheelEvent::ScrollByPixelWheelEvent, static_cast<WebEvent::Modifiers>(0), WallTime::fromRawSeconds(event->time)); > } > > static WebKit::WebPlatformTouchPoint::TouchPointState stateForTouchPoint(int mainEventId, const struct wpe_input_touch_event_raw* point) >@@ -209,7 +209,7 @@ WebTouchEvent WebEventFactory::createWebTouchEvent(struct wpe_input_touch_event* > pointCoordinates, pointCoordinates)); > } > >- return WebTouchEvent(type, WTFMove(touchPoints), WebEvent::Modifiers(0), event->time); >+ return WebTouchEvent(type, WTFMove(touchPoints), WebEvent::Modifiers(0), WallTime::fromRawSeconds(event->time)); > } > > } // namespace WebKit >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp >index 5df3dfc3e6e20b4f39b1df5984445af618d4c0bf..07edabfb6fc7ffcaf2f076558ffa4c509a825304 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp >@@ -478,17 +478,17 @@ void WKBundlePageForceRepaint(WKBundlePageRef page) > > void WKBundlePageSimulateMouseDown(WKBundlePageRef page, int button, WKPoint position, int clickCount, WKEventModifiers modifiers, double time) > { >- toImpl(page)->simulateMouseDown(button, toIntPoint(position), clickCount, modifiers, time); >+ toImpl(page)->simulateMouseDown(button, toIntPoint(position), clickCount, modifiers, WallTime::fromRawSeconds(time)); > } > > void WKBundlePageSimulateMouseUp(WKBundlePageRef page, int button, WKPoint position, int clickCount, WKEventModifiers modifiers, double time) > { >- toImpl(page)->simulateMouseUp(button, toIntPoint(position), clickCount, modifiers, time); >+ toImpl(page)->simulateMouseUp(button, toIntPoint(position), clickCount, modifiers, WallTime::fromRawSeconds(time)); > } > > void WKBundlePageSimulateMouseMotion(WKBundlePageRef page, WKPoint position, double time) > { >- toImpl(page)->simulateMouseMotion(toIntPoint(position), time); >+ toImpl(page)->simulateMouseMotion(toIntPoint(position), WallTime::fromRawSeconds(time)); > } > > uint64_t WKBundlePageGetRenderTreeSize(WKBundlePageRef pageRef) >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp >index 2618fe6c2ef8566ee273c6a738f03106c622299b..e7ed7d844c6ae656ccc7c937016c73deec932c3e 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp >@@ -361,7 +361,7 @@ guint32 webkit_dom_event_get_time_stamp(WebKitDOMEvent* self) > WebCore::JSMainThreadNullState state; > g_return_val_if_fail(WEBKIT_DOM_IS_EVENT(self), 0); > WebCore::Event* item = WebKit::core(self); >- guint32 result = item->timeStamp(); >+ guint32 result = item->timeStamp().approximateWallTime().secondsSinceEpoch().milliseconds(); > return result; > } > >diff --git a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >index afcffa51745b25b9e740428307faced548decaa1..86fe36b1ffd8ad0cefe25ad4d7e8ca4518c6a89a 100644 >--- a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >+++ b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >@@ -1576,7 +1576,7 @@ bool PDFPlugin::showContextMenuAtPoint(const IntPoint& point) > { > FrameView* frameView = webFrame()->coreFrame()->view(); > IntPoint contentsPoint = frameView->contentsToRootView(point); >- WebMouseEvent event(WebEvent::MouseDown, WebMouseEvent::RightButton, contentsPoint, contentsPoint, 0, 0, 0, 1, static_cast<WebEvent::Modifiers>(0), monotonicallyIncreasingTime(), WebCore::ForceAtClick); >+ WebMouseEvent event(WebEvent::MouseDown, WebMouseEvent::RightButton, contentsPoint, contentsPoint, 0, 0, 0, 1, static_cast<WebEvent::Modifiers>(0), WallTime::now(), WebCore::ForceAtClick); > return handleContextMenuEvent(event); > } > >diff --git a/Source/WebKit/WebProcess/Plugins/PluginView.cpp b/Source/WebKit/WebProcess/Plugins/PluginView.cpp >index a648f7eabfebeed0a6e75e86c62e0b4a2c1ccd53..ecd567fcc3c5de52a50a828f6e6845358123f297 100644 >--- a/Source/WebKit/WebProcess/Plugins/PluginView.cpp >+++ b/Source/WebKit/WebProcess/Plugins/PluginView.cpp >@@ -897,7 +897,7 @@ std::unique_ptr<WebEvent> PluginView::createWebEvent(MouseEvent& event) const > if (event.metaKey()) > modifiers |= WebEvent::MetaKey; > >- return std::make_unique<WebMouseEvent>(type, button, m_plugin->convertToRootView(IntPoint(event.offsetX(), event.offsetY())), event.screenLocation(), 0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(modifiers), 0, 0); >+ return std::make_unique<WebMouseEvent>(type, button, m_plugin->convertToRootView(IntPoint(event.offsetX(), event.offsetY())), event.screenLocation(), 0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(modifiers), WallTime { }, 0); > } > > void PluginView::handleEvent(Event& event) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 0eabe65990d917e1d91d91e2b9e4fb30d842b15a..ff8bb98040501c19200403ce4f49b3598224b7ba 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -1281,7 +1281,7 @@ void WebPage::navigateToPDFLinkWithSimulatedClick(const String& url, IntPoint do > return; > > const int singleClick = 1; >- RefPtr<MouseEvent> mouseEvent = MouseEvent::create(eventNames().clickEvent, true, true, currentTime(), nullptr, singleClick, screenPoint.x(), screenPoint.y(), documentPoint.x(), documentPoint.y(), >+ RefPtr<MouseEvent> mouseEvent = MouseEvent::create(eventNames().clickEvent, true, true, MonotonicTime::now(), nullptr, singleClick, screenPoint.x(), screenPoint.y(), documentPoint.x(), documentPoint.y(), > #if ENABLE(POINTER_LOCK) > 0, 0, > #endif >@@ -2145,11 +2145,11 @@ WebContextMenu* WebPage::contextMenuAtPointInWindow(const IntPoint& point) > corePage()->contextMenuController().clearContextMenu(); > > // Simulate a mouse click to generate the correct menu. >- PlatformMouseEvent mousePressEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, WebCore::NoTap); >+ PlatformMouseEvent mousePressEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, WallTime::now(), WebCore::ForceAtClick, WebCore::NoTap); > corePage()->userInputBridge().handleMousePressEvent(mousePressEvent); > bool handled = corePage()->userInputBridge().handleContextMenuEvent(mousePressEvent, corePage()->mainFrame()); > auto* menu = handled ? contextMenu() : nullptr; >- PlatformMouseEvent mouseReleaseEvent(point, point, RightButton, PlatformEvent::MouseReleased, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, WebCore::NoTap); >+ PlatformMouseEvent mouseReleaseEvent(point, point, RightButton, PlatformEvent::MouseReleased, 1, false, false, false, false, WallTime::now(), WebCore::ForceAtClick, WebCore::NoTap); > corePage()->userInputBridge().handleMouseReleaseEvent(mouseReleaseEvent); > > return menu; >@@ -3674,7 +3674,7 @@ void WebPage::dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint glob > if (!view) > return; > // FIXME: These are fake modifier keys here, but they should be real ones instead. >- PlatformMouseEvent event(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0, WebCore::NoTap); >+ PlatformMouseEvent event(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, WallTime::now(), 0, WebCore::NoTap); > m_page->mainFrame().eventHandler().dragSourceEndedAt(event, (DragOperation)operation); > > send(Messages::WebPageProxy::DidEndDragging()); >@@ -4670,17 +4670,17 @@ void WebPage::handleAlternativeTextUIResult(const String& result) > } > #endif > >-void WebPage::simulateMouseDown(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, double time) >+void WebPage::simulateMouseDown(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, WallTime time) > { > mouseEvent(WebMouseEvent(WebMouseEvent::MouseDown, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time, WebCore::ForceAtClick, WebMouseEvent::NoTap)); > } > >-void WebPage::simulateMouseUp(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, double time) >+void WebPage::simulateMouseUp(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, WallTime time) > { > mouseEvent(WebMouseEvent(WebMouseEvent::MouseUp, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time, WebCore::ForceAtClick, WebMouseEvent::NoTap)); > } > >-void WebPage::simulateMouseMotion(WebCore::IntPoint position, double time) >+void WebPage::simulateMouseMotion(WebCore::IntPoint position, WallTime time) > { > mouseEvent(WebMouseEvent(WebMouseEvent::MouseMove, WebMouseEvent::NoButton, position, position, 0, 0, 0, 0, WebMouseEvent::Modifiers(), time, 0, WebMouseEvent::NoTap)); > } >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index 43154a614b93c137d72749b411bd59729bb7bbb7..bb1f5126d6bf4299a39679e251d381ae44dd7484 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -66,6 +66,7 @@ > #include <wtf/RefPtr.h> > #include <wtf/RunLoop.h> > #include <wtf/Seconds.h> >+#include <wtf/WallTime.h> > #include <wtf/text/WTFString.h> > > #if HAVE(ACCESSIBILITY) && PLATFORM(GTK) >@@ -806,9 +807,9 @@ public: > #endif > > // For testing purpose. >- void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time); >- void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time); >- void simulateMouseMotion(WebCore::IntPoint, double time); >+ void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime); >+ void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime); >+ void simulateMouseMotion(WebCore::IntPoint, WallTime); > > #if ENABLE(CONTEXT_MENUS) > void contextMenuShowing() { m_isShowingContextMenu = true; } >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index bcdb0bf06a0ca9c39ff5f3c5b4a52545612bc051..dbafa15f87ba4077a7a75faddf385df424388be6 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -529,7 +529,7 @@ void WebPage::handleSyntheticClick(Node* nodeRespondingToClick, const WebCore::F > > WKBeginObservingContentChanges(true); > >- mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), WebCore::ForceAtClick, WebCore::NoTap)); >+ mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, WallTime::now(), WebCore::ForceAtClick, WebCore::NoTap)); > mainframe.document()->updateStyleIfNeeded(); > > WKStopObservingContentChanges(); >@@ -581,11 +581,11 @@ void WebPage::completeSyntheticClick(Node* nodeRespondingToClick, const WebCore: > bool tapWasHandled = false; > m_lastInteractionLocation = roundedAdjustedPoint; > >- tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, syntheticClickType)); >+ tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, WallTime::now(), WebCore::ForceAtClick, syntheticClickType)); > if (m_isClosed) > return; > >- tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, syntheticClickType)); >+ tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, WallTime::now(), WebCore::ForceAtClick, syntheticClickType)); > if (m_isClosed) > return; > >@@ -637,7 +637,7 @@ void WebPage::requestAdditionalItemsForDragSession(const IntPoint& clientPositio > // To augment the platform drag session with additional items, end the current drag session and begin a new drag session with the new drag item. > // This process is opaque to the UI process, which still maintains the old drag item in its drag session. Similarly, this persistent drag session > // is opaque to the web process, which only sees that the current drag has ended, and that a new one is beginning. >- PlatformMouseEvent event(clientPosition, globalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0, NoTap); >+ PlatformMouseEvent event(clientPosition, globalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, WallTime::now(), 0, NoTap); > m_page->dragController().dragEnded(); > m_page->mainFrame().eventHandler().dragSourceEndedAt(event, DragOperationNone, MayExtendDragSession::Yes); > >@@ -803,7 +803,7 @@ void WebPage::inspectorNodeSearchMovedToPosition(const FloatPoint& position) > IntPoint adjustedPoint = roundedIntPoint(position); > Frame& mainframe = m_page->mainFrame(); > >- mainframe.eventHandler().mouseMoved(PlatformMouseEvent(adjustedPoint, adjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0, 0, WebCore::NoTap)); >+ mainframe.eventHandler().mouseMoved(PlatformMouseEvent(adjustedPoint, adjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, { }, 0, WebCore::NoTap)); > mainframe.document()->updateStyleIfNeeded(); > } > >diff --git a/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm b/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm >index 48ae9f79cb92440524a7fff49db05c6a9e1433f6..c915fe4d867e22713cfd451e32d8379f983c1cd1 100644 >--- a/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm >+++ b/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm >@@ -48,7 +48,7 @@ > #import <WebKitLegacy/WebNSViewExtras.h> > #import <WebKitLegacy/WebPDFDocumentExtras.h> > #import <WebKitLegacy/WebViewPrivate.h> >-#import <wtf/CurrentTime.h> >+#import <wtf/MonotonicTime.h> > #import <wtf/SoftLinking.h> > #import <wtf/Vector.h> > >@@ -479,7 +479,7 @@ static const float PAGE_HEIGHT_INSET = 4.0f * 2.0f; > return; > > // Construct an event to simulate a click. >- RefPtr<Event> event = MouseEvent::create(eventNames().clickEvent, true, true, currentTime(), 0, 1, 0, 0, 0, 0, >+ RefPtr<Event> event = MouseEvent::create(eventNames().clickEvent, true, true, MonotonicTime::now(), 0, 1, 0, 0, 0, 0, > #if ENABLE(POINTER_LOCK) > 0, 0, > #endif >diff --git a/Source/WebKitLegacy/mac/DOM/DOMEvent.mm b/Source/WebKitLegacy/mac/DOM/DOMEvent.mm >index 95f84dd25a843aebba422d3bdc80d14fa308f21a..321a7f01681f21a48669cd983ed54571084f71aa 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMEvent.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMEvent.mm >@@ -97,7 +97,7 @@ > - (DOMTimeStamp)timeStamp > { > WebCore::JSMainThreadNullState state; >- return IMPL->timeStamp(); >+ return IMPL->timeStamp().approximateWallTime().secondsSinceEpoch().milliseconds(); > } > > - (BOOL)defaultPrevented >diff --git a/Source/WebKitLegacy/mac/WebView/WebFrame.mm b/Source/WebKitLegacy/mac/WebView/WebFrame.mm >index 0016c0a42c030bb3ebc4f4d1aa5dc7ee1dc76145..f34d6959d4cae1537d5261c418f047d38224b9a4 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebFrame.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebFrame.mm >@@ -964,7 +964,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) > return; > // FIXME: These are fake modifier keys here, but they should be real ones instead. > PlatformMouseEvent event(IntPoint(windowLoc), IntPoint(globalPoint(windowLoc, [view->platformWidget() window])), >- LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), WebCore::ForceAtClick, WebCore::NoTap); >+ LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, WallTime::now(), WebCore::ForceAtClick, WebCore::NoTap); > _private->coreFrame->eventHandler().dragSourceEndedAt(event, (DragOperation)operation); > } > #endif // ENABLE(DRAG_SUPPORT) && PLATFORM(MAC) >diff --git a/Source/WebKitLegacy/mac/WebView/WebPDFView.mm b/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >index ec57c88a6cad1bd2b4c9c22a8cf013a0107e025a..18e35a5bd04f9a040571711e777845f26c6c999e 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >@@ -1018,14 +1018,14 @@ static BOOL isFrameInRange(WebFrame *frame, DOMRange *range) > case NSEventTypeKeyDown: { > PlatformKeyboardEvent pe = PlatformEventFactory::createPlatformKeyboardEvent(nsEvent); > pe.disambiguateKeyDownEvent(PlatformEvent::RawKeyDown); >- event = KeyboardEvent::create(pe, 0); >+ event = KeyboardEvent::create(pe, nullptr); > break; > } > default: > break; > } > if (button != noButton) { >- event = MouseEvent::create(eventNames().clickEvent, true, true, currentTime(), 0, [nsEvent clickCount], 0, 0, 0, 0, >+ event = MouseEvent::create(eventNames().clickEvent, true, true, MonotonicTime::now(), 0, [nsEvent clickCount], 0, 0, 0, 0, > #if ENABLE(POINTER_LOCK) > 0, 0, > #endif >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 657273cfc007e12808362ad24c020b265f0fad78..fa914427777bb63080225a7616b79027a75fb046 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,15 @@ >+2017-09-21 Chris Dumez <cdumez@apple.com> >+ >+ Use high resolution timestamp for event time >+ https://bugs.webkit.org/show_bug.cgi?id=154246 >+ <rdar://problem/34333304> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Rebaseline WPT test now that more checks are passing. >+ >+ * web-platform-tests/dom/events/Event-timestamp-high-resolution-expected.txt: >+ > 2017-09-20 Youenn Fablet <youenn@apple.com> > > Refresh WPT tests up to f65af411d63ec13ee8fe208b4effd730a4a8b7fe >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 7e75b80acfb7961c6f76b260387487fb660f2e0a..ed5948c704fd6a893f676de779d24d780f68908b 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -176,7 +176,6 @@ imported/w3c/web-platform-tests/css/css-ui-3/text-overflow-012.html [ ImageOnlyF > imported/w3c/web-platform-tests/css/css-ui-3/text-overflow-015.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-ui-3/text-overflow-017.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-ui-3/text-overflow-021.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/dom/events/Event-timestamp-high-resolution.html [ Failure ] > imported/w3c/web-platform-tests/dom/nodes/Document-constructor-svg.svg [ Timeout ] > imported/w3c/web-platform-tests/fetch/security/dangling-markup-mitigation.tentative.html [ Pass Failure ] > imported/w3c/web-platform-tests/hr-time/timeOrigin.html [ Failure ] >diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-timestamp-high-resolution-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-timestamp-high-resolution-expected.txt >index f47fa3d6f567e4e98b128012825d62d1886cee3f..6eb10e8735ab2404d0fab7df374a52c6e36fc34b 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-timestamp-high-resolution-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-timestamp-high-resolution-expected.txt >@@ -1,7 +1,7 @@ > >-FAIL Constructed MouseEvent timestamp should be high resolution and have the same time origin as performance.now() assert_less_than_equal: Event timestamp should be less than performance.now() timestamp taken after its creation expected a number less than or equal to 523.8000000000001 but got 1505770152566 >-FAIL Constructed KeyboardEvent timestamp should be high resolution and have the same time origin as performance.now() assert_less_than_equal: Event timestamp should be less than performance.now() timestamp taken after its creation expected a number less than or equal to 524.4 but got 1505770152566 >-FAIL Constructed WheelEvent timestamp should be high resolution and have the same time origin as performance.now() assert_less_than_equal: Event timestamp should be less than performance.now() timestamp taken after its creation expected a number less than or equal to 524.5000000000001 but got 1505770152566 >+PASS Constructed MouseEvent timestamp should be high resolution and have the same time origin as performance.now() >+PASS Constructed KeyboardEvent timestamp should be high resolution and have the same time origin as performance.now() >+PASS Constructed WheelEvent timestamp should be high resolution and have the same time origin as performance.now() > FAIL Constructed GamepadEvent timestamp should be high resolution and have the same time origin as performance.now() Not enough arguments >-FAIL Constructed FocusEvent timestamp should be high resolution and have the same time origin as performance.now() assert_less_than_equal: Event timestamp should be less than performance.now() timestamp taken after its creation expected a number less than or equal to 524.6 but got 1505770152566 >+PASS Constructed FocusEvent timestamp should be high resolution and have the same time origin as performance.now() >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 154246
:
321348
|
321384
|
321385
|
321387
|
321388
|
321390
|
321430
|
321432
|
321433
|
321435
|
321437
|
321440
|
321458
|
321462
|
321463
|
321466
|
321473
|
321474
|
321551
|
321556