Changeset 286712 in webkit
- Timestamp:
- Dec 8, 2021, 1:25:12 PM (5 years ago)
- Location:
- branches/safari-612.4.2.1-branch/Source
- Files:
-
- 16 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/PAL/ChangeLog (modified) (1 diff)
-
WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h (modified) (3 diffs)
-
WebCore/PAL/pal/spi/mac/IOKitSPIMac.h (modified) (2 diffs)
-
WebCore/platform/PlatformWheelEvent.cpp (modified) (1 diff)
-
WebCore/platform/PlatformWheelEvent.h (modified) (2 diffs)
-
WebCore/platform/mac/PlatformEventFactoryMac.h (modified) (1 diff)
-
WebCore/platform/mac/PlatformEventFactoryMac.mm (modified) (4 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Shared/WebEventConversion.cpp (modified) (1 diff)
-
WebKit/Shared/WebWheelEvent.cpp (modified) (4 diffs)
-
WebKit/Shared/WebWheelEvent.h (modified) (4 diffs)
-
WebKit/Shared/WebWheelEventCoalescer.cpp (modified) (1 diff)
-
WebKit/Shared/ios/WebIOSEventFactory.mm (modified) (2 diffs)
-
WebKit/Shared/mac/NativeWebGestureEventMac.mm (modified) (1 diff)
-
WebKit/Shared/mac/WebEventFactory.mm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612.4.2.1-branch/Source/WebCore/ChangeLog
r286711 r286712 1 2021-12-01 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r285790. rdar://problem/85928816 4 5 Attach IOHIDEvent timestamps to wheel events 6 https://bugs.webkit.org/show_bug.cgi?id=233051 7 8 Reviewed by Wenson Hsieh. 9 Source/WebCore: 10 11 On some macOS devices, there can be significant deltas between NSEvent timestamps, 12 and the timestamps on underlying IOHIDEvents (rdar://85309639). This makes momentum 13 velocity computation unpredictable; we can get better results by using IOHIDEvent 14 timestamps. 15 16 * platform/PlatformWheelEvent.cpp: 17 (WebCore::PlatformWheelEvent::createFromGesture): 18 * platform/PlatformWheelEvent.h: 19 (WebCore::PlatformWheelEvent::ioHIDEventTimestamp const): 20 * platform/mac/PlatformEventFactoryMac.h: 21 * platform/mac/PlatformEventFactoryMac.mm: 22 (WebCore::eventTimeStampSince1970): 23 (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder): 24 (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): 25 (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): 26 27 Source/WebCore/PAL: 28 29 Expose a few bits of SPI needed. 30 31 * pal/spi/cg/CoreGraphicsSPI.h: 32 * pal/spi/cocoa/IOKitSPI.h: 33 34 Source/WebKit: 35 36 On some macOS devices, there can be significant deltas between NSEvent timestamps, 37 and the timestamps on underlying IOHIDEvents (rdar://85309639). This makes momentum 38 velocity computation unpredictable; we can get better results by using IOHIDEvent 39 timestamps. 40 41 * Shared/WebEventConversion.cpp: 42 (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): 43 * Shared/WebWheelEvent.cpp: 44 (WebKit::WebWheelEvent::WebWheelEvent): 45 (WebKit::WebWheelEvent::encode const): 46 (WebKit::WebWheelEvent::decode): 47 * Shared/WebWheelEvent.h: 48 (WebKit::WebWheelEvent::ioHIDEventTimestamp const): 49 * Shared/WebWheelEventCoalescer.cpp: 50 (WebKit::WebWheelEventCoalescer::coalesce): 51 * Shared/ios/WebIOSEventFactory.mm: 52 (WebIOSEventFactory::createWebWheelEvent): 53 * Shared/mac/NativeWebGestureEventMac.mm: 54 * Shared/mac/WebEventFactory.mm: 55 (WebKit::WebEventFactory::createWebMouseEvent): 56 (WebKit::WebEventFactory::createWebWheelEvent): 57 (WebKit::WebEventFactory::createWebKeyboardEvent): 58 59 60 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285790 268f45cc-cd09-0410-ab3c-d52691b4dbfc 61 62 2021-11-14 Simon Fraser <simon.fraser@apple.com> 63 64 Attach IOHIDEvent timestamps to wheel events 65 https://bugs.webkit.org/show_bug.cgi?id=233051 66 67 Reviewed by Wenson Hsieh. 68 69 On some macOS devices, there can be significant deltas between NSEvent timestamps, 70 and the timestamps on underlying IOHIDEvents (rdar://85309639). This makes momentum 71 velocity computation unpredictable; we can get better results by using IOHIDEvent 72 timestamps. 73 74 * platform/PlatformWheelEvent.cpp: 75 (WebCore::PlatformWheelEvent::createFromGesture): 76 * platform/PlatformWheelEvent.h: 77 (WebCore::PlatformWheelEvent::ioHIDEventTimestamp const): 78 * platform/mac/PlatformEventFactoryMac.h: 79 * platform/mac/PlatformEventFactoryMac.mm: 80 (WebCore::eventTimeStampSince1970): 81 (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder): 82 (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): 83 (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): 84 1 85 2021-12-01 Alan Coon <alancoon@apple.com> 2 86 -
branches/safari-612.4.2.1-branch/Source/WebCore/PAL/ChangeLog
r286711 r286712 1 2021-12-01 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r285790. rdar://problem/85928816 4 5 Attach IOHIDEvent timestamps to wheel events 6 https://bugs.webkit.org/show_bug.cgi?id=233051 7 8 Reviewed by Wenson Hsieh. 9 Source/WebCore: 10 11 On some macOS devices, there can be significant deltas between NSEvent timestamps, 12 and the timestamps on underlying IOHIDEvents (rdar://85309639). This makes momentum 13 velocity computation unpredictable; we can get better results by using IOHIDEvent 14 timestamps. 15 16 * platform/PlatformWheelEvent.cpp: 17 (WebCore::PlatformWheelEvent::createFromGesture): 18 * platform/PlatformWheelEvent.h: 19 (WebCore::PlatformWheelEvent::ioHIDEventTimestamp const): 20 * platform/mac/PlatformEventFactoryMac.h: 21 * platform/mac/PlatformEventFactoryMac.mm: 22 (WebCore::eventTimeStampSince1970): 23 (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder): 24 (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): 25 (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): 26 27 Source/WebCore/PAL: 28 29 Expose a few bits of SPI needed. 30 31 * pal/spi/cg/CoreGraphicsSPI.h: 32 * pal/spi/cocoa/IOKitSPI.h: 33 34 Source/WebKit: 35 36 On some macOS devices, there can be significant deltas between NSEvent timestamps, 37 and the timestamps on underlying IOHIDEvents (rdar://85309639). This makes momentum 38 velocity computation unpredictable; we can get better results by using IOHIDEvent 39 timestamps. 40 41 * Shared/WebEventConversion.cpp: 42 (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): 43 * Shared/WebWheelEvent.cpp: 44 (WebKit::WebWheelEvent::WebWheelEvent): 45 (WebKit::WebWheelEvent::encode const): 46 (WebKit::WebWheelEvent::decode): 47 * Shared/WebWheelEvent.h: 48 (WebKit::WebWheelEvent::ioHIDEventTimestamp const): 49 * Shared/WebWheelEventCoalescer.cpp: 50 (WebKit::WebWheelEventCoalescer::coalesce): 51 * Shared/ios/WebIOSEventFactory.mm: 52 (WebIOSEventFactory::createWebWheelEvent): 53 * Shared/mac/NativeWebGestureEventMac.mm: 54 * Shared/mac/WebEventFactory.mm: 55 (WebKit::WebEventFactory::createWebMouseEvent): 56 (WebKit::WebEventFactory::createWebWheelEvent): 57 (WebKit::WebEventFactory::createWebKeyboardEvent): 58 59 60 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285790 268f45cc-cd09-0410-ab3c-d52691b4dbfc 61 62 2021-11-14 Simon Fraser <simon.fraser@apple.com> 63 64 Attach IOHIDEvent timestamps to wheel events 65 https://bugs.webkit.org/show_bug.cgi?id=233051 66 67 Reviewed by Wenson Hsieh. 68 69 Expose a few bits of SPI needed. 70 71 * pal/spi/cg/CoreGraphicsSPI.h: 72 * pal/spi/cocoa/IOKitSPI.h: 73 1 74 2021-12-01 Alan Coon <alancoon@apple.com> 2 75 -
branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h
r282936 r286712 33 33 #endif 34 34 35 #if PLATFORM(MAC) 36 #include <pal/spi/cocoa/IOKitSPI.h> 37 #endif 38 35 39 #if USE(APPLE_INTERNAL_SDK) 36 40 … … 43 47 #if PLATFORM(MAC) 44 48 #include <CoreGraphics/CGAccessibility.h> 49 #include <CoreGraphics/CGEventPrivate.h> 45 50 #endif 46 51 … … 351 356 CGSDisplayID CGSMainDisplayID(void); 352 357 358 IOHIDEventRef CGEventCopyIOHIDEvent(CGEventRef); 353 359 #endif // PLATFORM(MAC) 354 360 -
branches/safari-612.4.2.1-branch/Source/WebCore/PAL/pal/spi/mac/IOKitSPIMac.h
r286711 r286712 44 44 45 45 WTF_EXTERN_C_BEGIN 46 47 typedef struct __IOHIDEvent * IOHIDEventRef; 46 48 typedef struct CF_BRIDGED_TYPE(id) __IOHIDServiceClient * IOHIDServiceClientRef; 47 49 typedef struct CF_BRIDGED_TYPE(id) __IOHIDEventSystemClient * IOHIDEventSystemClientRef; … … 82 84 typedef uint32_t IOHIDEventType; 83 85 86 uint64_t IOHIDEventGetTimeStamp(IOHIDEventRef); 87 84 88 WTF_EXTERN_C_END 85 89 -
branches/safari-612.4.2.1-branch/Source/WebCore/platform/PlatformWheelEvent.cpp
r277772 r286712 76 76 77 77 #if PLATFORM(COCOA) 78 platformWheelEvent.m_ioHIDEventTimestamp = platformWheelEvent.m_timestamp; 78 79 platformWheelEvent.m_unacceleratedScrollingDeltaY = deltaY; 79 80 #endif // PLATFORM(COCOA) -
branches/safari-612.4.2.1-branch/Source/WebCore/platform/PlatformWheelEvent.h
r277772 r286712 153 153 float unacceleratedScrollingDeltaX() const { return m_unacceleratedScrollingDeltaX; } 154 154 float unacceleratedScrollingDeltaY() const { return m_unacceleratedScrollingDeltaY; } 155 156 WallTime ioHIDEventTimestamp() const { return m_ioHIDEventTimestamp; } 155 157 #endif 156 158 … … 201 203 #endif 202 204 #if PLATFORM(COCOA) 205 WallTime m_ioHIDEventTimestamp; 203 206 unsigned m_scrollCount { 0 }; 204 207 float m_unacceleratedScrollingDeltaX { 0 }; -
branches/safari-612.4.2.1-branch/Source/WebCore/platform/mac/PlatformEventFactoryMac.h
r235158 r286712 51 51 WEBCORE_EXPORT String keyForKeyEvent(NSEvent *); 52 52 WEBCORE_EXPORT String codeForKeyEvent(NSEvent *); 53 WEBCORE_EXPORT WallTime eventTimeStampSince1970(NS Event *);53 WEBCORE_EXPORT WallTime eventTimeStampSince1970(NSTimeInterval); 54 54 55 55 WEBCORE_EXPORT OptionSet<PlatformEvent::Modifier> modifiersForEvent(NSEvent *); -
branches/safari-612.4.2.1-branch/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
r279059 r286712 608 608 } 609 609 610 WallTime eventTimeStampSince1970(NS Event* event)611 { 612 return WallTime::fromRawSeconds(static_cast<double>(cachedStartupTimeIntervalSince1970() + [event timestamp]));610 WallTime eventTimeStampSince1970(NSTimeInterval timestamp) 611 { 612 return WallTime::fromRawSeconds(static_cast<double>(cachedStartupTimeIntervalSince1970() + timestamp)); 613 613 } 614 614 … … 721 721 722 722 m_modifiers = modifiersForEvent(event); 723 m_timestamp = eventTimeStampSince1970(event );723 m_timestamp = eventTimeStampSince1970(event.timestamp); 724 724 725 725 // PlatformMouseEvent … … 756 756 m_type = PlatformEvent::Wheel; 757 757 m_modifiers = modifiersForEvent(event); 758 m_timestamp = eventTimeStampSince1970(event );758 m_timestamp = eventTimeStampSince1970(event.timestamp); 759 759 760 760 // PlatformWheelEvent … … 795 795 m_type = isKeyUpEvent(event) ? PlatformEvent::KeyUp : PlatformEvent::KeyDown; 796 796 m_modifiers = modifiersForEvent(event); 797 m_timestamp = eventTimeStampSince1970(event );797 m_timestamp = eventTimeStampSince1970(event.timestamp); 798 798 799 799 // PlatformKeyboardEvent -
branches/safari-612.4.2.1-branch/Source/WebKit/ChangeLog
r286510 r286712 1 2021-12-01 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r285790. rdar://problem/85928816 4 5 Attach IOHIDEvent timestamps to wheel events 6 https://bugs.webkit.org/show_bug.cgi?id=233051 7 8 Reviewed by Wenson Hsieh. 9 Source/WebCore: 10 11 On some macOS devices, there can be significant deltas between NSEvent timestamps, 12 and the timestamps on underlying IOHIDEvents (rdar://85309639). This makes momentum 13 velocity computation unpredictable; we can get better results by using IOHIDEvent 14 timestamps. 15 16 * platform/PlatformWheelEvent.cpp: 17 (WebCore::PlatformWheelEvent::createFromGesture): 18 * platform/PlatformWheelEvent.h: 19 (WebCore::PlatformWheelEvent::ioHIDEventTimestamp const): 20 * platform/mac/PlatformEventFactoryMac.h: 21 * platform/mac/PlatformEventFactoryMac.mm: 22 (WebCore::eventTimeStampSince1970): 23 (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder): 24 (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): 25 (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): 26 27 Source/WebCore/PAL: 28 29 Expose a few bits of SPI needed. 30 31 * pal/spi/cg/CoreGraphicsSPI.h: 32 * pal/spi/cocoa/IOKitSPI.h: 33 34 Source/WebKit: 35 36 On some macOS devices, there can be significant deltas between NSEvent timestamps, 37 and the timestamps on underlying IOHIDEvents (rdar://85309639). This makes momentum 38 velocity computation unpredictable; we can get better results by using IOHIDEvent 39 timestamps. 40 41 * Shared/WebEventConversion.cpp: 42 (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): 43 * Shared/WebWheelEvent.cpp: 44 (WebKit::WebWheelEvent::WebWheelEvent): 45 (WebKit::WebWheelEvent::encode const): 46 (WebKit::WebWheelEvent::decode): 47 * Shared/WebWheelEvent.h: 48 (WebKit::WebWheelEvent::ioHIDEventTimestamp const): 49 * Shared/WebWheelEventCoalescer.cpp: 50 (WebKit::WebWheelEventCoalescer::coalesce): 51 * Shared/ios/WebIOSEventFactory.mm: 52 (WebIOSEventFactory::createWebWheelEvent): 53 * Shared/mac/NativeWebGestureEventMac.mm: 54 * Shared/mac/WebEventFactory.mm: 55 (WebKit::WebEventFactory::createWebMouseEvent): 56 (WebKit::WebEventFactory::createWebWheelEvent): 57 (WebKit::WebEventFactory::createWebKeyboardEvent): 58 59 60 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285790 268f45cc-cd09-0410-ab3c-d52691b4dbfc 61 62 2021-11-14 Simon Fraser <simon.fraser@apple.com> 63 64 Attach IOHIDEvent timestamps to wheel events 65 https://bugs.webkit.org/show_bug.cgi?id=233051 66 67 Reviewed by Wenson Hsieh. 68 69 On some macOS devices, there can be significant deltas between NSEvent timestamps, 70 and the timestamps on underlying IOHIDEvents (rdar://85309639). This makes momentum 71 velocity computation unpredictable; we can get better results by using IOHIDEvent 72 timestamps. 73 74 * Shared/WebEventConversion.cpp: 75 (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): 76 * Shared/WebWheelEvent.cpp: 77 (WebKit::WebWheelEvent::WebWheelEvent): 78 (WebKit::WebWheelEvent::encode const): 79 (WebKit::WebWheelEvent::decode): 80 * Shared/WebWheelEvent.h: 81 (WebKit::WebWheelEvent::ioHIDEventTimestamp const): 82 * Shared/WebWheelEventCoalescer.cpp: 83 (WebKit::WebWheelEventCoalescer::coalesce): 84 * Shared/ios/WebIOSEventFactory.mm: 85 (WebIOSEventFactory::createWebWheelEvent): 86 * Shared/mac/NativeWebGestureEventMac.mm: 87 * Shared/mac/WebEventFactory.mm: 88 (WebKit::WebEventFactory::createWebMouseEvent): 89 (WebKit::WebEventFactory::createWebWheelEvent): 90 (WebKit::WebEventFactory::createWebKeyboardEvent): 91 1 92 2021-12-03 Russell Epstein <repstein@apple.com> 2 93 -
branches/safari-612.4.2.1-branch/Source/WebKit/Shared/WebEventConversion.cpp
r279059 r286712 170 170 #endif 171 171 #if PLATFORM(COCOA) 172 m_ioHIDEventTimestamp = webEvent.ioHIDEventTimestamp(); 172 173 m_scrollCount = webEvent.scrollCount(); 173 174 m_unacceleratedScrollingDeltaX = webEvent.unacceleratedScrollingDelta().width(); -
branches/safari-612.4.2.1-branch/Source/WebKit/Shared/WebWheelEvent.cpp
r268522 r286712 45 45 46 46 #if PLATFORM(COCOA) 47 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, OptionSet<Modifier> modifiers, WallTime timestamp )47 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, OptionSet<Modifier> modifiers, WallTime timestamp, WallTime ioHIDEventTimestamp) 48 48 : WebEvent(type, modifiers, timestamp) 49 49 , m_position(position) … … 56 56 , m_directionInvertedFromDevice(directionInvertedFromDevice) 57 57 , m_hasPreciseScrollingDeltas(hasPreciseScrollingDeltas) 58 , m_ioHIDEventTimestamp(ioHIDEventTimestamp) 58 59 , m_scrollCount(scrollCount) 59 60 , m_unacceleratedScrollingDelta(unacceleratedScrollingDelta) … … 93 94 #endif 94 95 #if PLATFORM(COCOA) 96 encoder << m_ioHIDEventTimestamp; 95 97 encoder << m_scrollCount; 96 98 encoder << m_unacceleratedScrollingDelta; … … 123 125 #endif 124 126 #if PLATFORM(COCOA) 127 if (!decoder.decode(t.m_ioHIDEventTimestamp)) 128 return false; 125 129 if (!decoder.decode(t.m_scrollCount)) 126 130 return false; -
branches/safari-612.4.2.1-branch/Source/WebKit/Shared/WebWheelEvent.h
r268522 r286712 54 54 WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, OptionSet<Modifier>, WallTime timestamp); 55 55 #if PLATFORM(COCOA) 56 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, OptionSet<Modifier>, WallTime timestamp );56 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, OptionSet<Modifier>, WallTime timestamp, WallTime ioHIDEventTimestamp); 57 57 #elif PLATFORM(GTK) || USE(LIBWPE) 58 58 WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Phase, Phase momentumPhase, Granularity, bool hasPreciseScrollingDeltas, OptionSet<Modifier>, WallTime timestamp); … … 71 71 #endif 72 72 #if PLATFORM(COCOA) 73 WallTime ioHIDEventTimestamp() const { return m_ioHIDEventTimestamp; } 73 74 uint32_t scrollCount() const { return m_scrollCount; } 74 75 const WebCore::FloatSize& unacceleratedScrollingDelta() const { return m_unacceleratedScrollingDelta; } … … 88 89 uint32_t m_phase { Phase::PhaseNone }; 89 90 uint32_t m_momentumPhase { Phase::PhaseNone }; 91 90 92 bool m_directionInvertedFromDevice { false }; 91 93 #if PLATFORM(COCOA) || PLATFORM(GTK) || USE(LIBWPE) … … 93 95 #endif 94 96 #if PLATFORM(COCOA) 97 WallTime m_ioHIDEventTimestamp; 95 98 uint32_t m_scrollCount { 0 }; 96 99 WebCore::FloatSize m_unacceleratedScrollingDelta; -
branches/safari-612.4.2.1-branch/Source/WebKit/Shared/WebWheelEventCoalescer.cpp
r285301 r286712 79 79 auto mergedUnacceleratedScrollingDelta = a.unacceleratedScrollingDelta() + b.unacceleratedScrollingDelta(); 80 80 81 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.directionInvertedFromDevice(), b.phase(), b.momentumPhase(), b.hasPreciseScrollingDeltas(), b.scrollCount(), mergedUnacceleratedScrollingDelta, b.modifiers(), b.timestamp() );81 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.directionInvertedFromDevice(), b.phase(), b.momentumPhase(), b.hasPreciseScrollingDeltas(), b.scrollCount(), mergedUnacceleratedScrollingDelta, b.modifiers(), b.timestamp(), b.ioHIDEventTimestamp()); 82 82 #elif PLATFORM(GTK) || USE(LIBWPE) 83 83 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.phase(), b.momentumPhase(), b.granularity(), b.hasPreciseScrollingDeltas(), b.modifiers(), b.timestamp()); -
branches/safari-612.4.2.1-branch/Source/WebKit/Shared/ios/WebIOSEventFactory.mm
r278253 r286712 162 162 WebCore::FloatSize wheelTicks = delta; 163 163 wheelTicks.scale(1. / static_cast<float>(WebCore::Scrollbar::pixelsPerLineStep())); 164 164 auto timestamp = MonotonicTime::fromRawSeconds(event.timestamp).approximateWallTime(); 165 165 return { 166 166 WebKit::WebEvent::Wheel, … … 177 177 delta, 178 178 { }, 179 MonotonicTime::fromRawSeconds(event.timestamp).approximateWallTime() 179 timestamp, 180 timestamp 180 181 }; 181 182 } -
branches/safari-612.4.2.1-branch/Source/WebKit/Shared/mac/NativeWebGestureEventMac.mm
r267916 r286712 63 63 webEventTypeForNSEvent(event), 64 64 OptionSet<WebEvent::Modifier> { }, 65 WebCore::eventTimeStampSince1970(event ),65 WebCore::eventTimeStampSince1970(event.timestamp), 66 66 WebCore::IntPoint(pointForEvent(event, view)), 67 67 event.type == NSEventTypeMagnify ? event.magnification : 0, -
branches/safari-612.4.2.1-branch/Source/WebKit/Shared/mac/WebEventFactory.mm
r242325 r286712 33 33 #import <WebCore/Scrollbar.h> 34 34 #import <WebCore/WindowsKeyboardCodes.h> 35 #import <pal/spi/cg/CoreGraphicsSPI.h> 35 36 #import <pal/spi/mac/NSMenuSPI.h> 36 37 #import <wtf/ASCIICType.h> … … 354 355 int clickCount = clickCountForEvent(event); 355 356 auto modifiers = modifiersForEvent(event); 356 auto timestamp = WebCore::eventTimeStampSince1970(event );357 auto timestamp = WebCore::eventTimeStampSince1970(event.timestamp); 357 358 int eventNumber = [event eventNumber]; 358 359 int menuTypeForEvent = typeForEvent(event); … … 409 410 410 411 auto modifiers = modifiersForEvent(event); 411 auto timestamp = WebCore::eventTimeStampSince1970(event); 412 413 return WebWheelEvent(WebEvent::Wheel, WebCore::IntPoint(position), WebCore::IntPoint(globalPosition), WebCore::FloatSize(deltaX, deltaY), WebCore::FloatSize(wheelTicksX, wheelTicksY), granularity, directionInvertedFromDevice, phase, momentumPhase, hasPreciseScrollingDeltas, scrollCount, unacceleratedScrollingDelta, modifiers, timestamp); 412 auto timestamp = WebCore::eventTimeStampSince1970(event.timestamp); 413 414 auto ioHIDEventTimestamp = [](NSEvent *event) { 415 auto cgEvent = event.CGEvent; 416 if (!cgEvent) 417 return event.timestamp; 418 419 auto iohidEvent = adoptCF(CGEventCopyIOHIDEvent(cgEvent)); 420 if (!iohidEvent) 421 return event.timestamp; 422 423 auto ioHIDEventTimestamp = IOHIDEventGetTimeStamp(iohidEvent.get()); // IOEventRef timestamp is mach_absolute_time units. 424 return MonotonicTime::fromMachAbsoluteTime(ioHIDEventTimestamp).secondsSinceEpoch().seconds(); 425 }(event); 426 427 auto ioHIDEventWallTime = WebCore::eventTimeStampSince1970(ioHIDEventTimestamp); 428 429 return WebWheelEvent(WebEvent::Wheel, WebCore::IntPoint(position), WebCore::IntPoint(globalPosition), WebCore::FloatSize(deltaX, deltaY), WebCore::FloatSize(wheelTicksX, wheelTicksY), 430 granularity, directionInvertedFromDevice, phase, momentumPhase, hasPreciseScrollingDeltas, 431 scrollCount, unacceleratedScrollingDelta, modifiers, timestamp, ioHIDEventWallTime); 414 432 } 415 433 … … 429 447 bool isSystemKey = false; // SystemKey is always false on the Mac. 430 448 auto modifiers = modifiersForEvent(event); 431 auto timestamp = WebCore::eventTimeStampSince1970(event );449 auto timestamp = WebCore::eventTimeStampSince1970(event.timestamp); 432 450 433 451 // Always use 13 for Enter/Return -- we don't want to use AppKit's different character for Enter.
Note:
See TracChangeset
for help on using the changeset viewer.