Title: [291886] trunk
Revision
291886
Author
[email protected]
Date
2022-03-25 13:54:28 -0700 (Fri, 25 Mar 2022)

Log Message

`PointerEvent.movementX` always 0 (breaks https://noisecraft.app/)
https://bugs.webkit.org/show_bug.cgi?id=220194
<rdar://problem/72814440>

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt:
This change causes the test to progress further than before, but there still appear to be
other issues elsewhere, so adjust the expected output to reflect that.

Source/WebCore:

Test: pointer-lock/pointermove-movement-delta.html

* dom/PointerEvent.cpp:
(WebCore::PointerEvent::PointerEvent):
Also pass along the movement delta in the constructor that takes a `MouseEvent`.

* dom/MouseEvent.h:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
Require that all constructors that aren't invoked from JS always provide a movement delta.

* dom/MouseRelatedEvent.h:
(WebCore::MouseRelatedEvent::movementX const):
(WebCore::MouseRelatedEvent::movementY const):
Expose these methods even when `!ENABLE(POINTER_LOCK)` so that they can be called without
the callsite having to also have a `#if`.

* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchDragEvent):
Pass along the movement delta even when `!ENABLE(POINTER_LOCK)`.

Tools:

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseMoveToX:Y:]):
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseMoveTo):
On macOS, the screen's origin is the bottom-left corner, so we need to flip the `deltaY`.

LayoutTests:

* pointer-lock/pointermove-movement-delta.html: Added.
* pointer-lock/pointermove-movement-delta-expected.txt: Added.

* pointer-lock/mouse-event-delivery-expected.txt: Added.
On macOS, the screen's origin is the bottom-left corner, so we need to flip the `deltaY`.

* platform/gtk/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt: Added.
This change causes the test to progress further than before, but there still appear to be
other issues elsewhere, so adjust the expected output to reflect that.

* platform/mac-wk1/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (291885 => 291886)


--- trunk/LayoutTests/ChangeLog	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/LayoutTests/ChangeLog	2022-03-25 20:54:28 UTC (rev 291886)
@@ -1,3 +1,23 @@
+2022-03-25  Devin Rousso  <[email protected]>
+
+        `PointerEvent.movementX` always 0 (breaks https://noisecraft.app/)
+        https://bugs.webkit.org/show_bug.cgi?id=220194
+        <rdar://problem/72814440>
+
+        Reviewed by Simon Fraser.
+
+        * pointer-lock/pointermove-movement-delta.html: Added.
+        * pointer-lock/pointermove-movement-delta-expected.txt: Added.
+
+        * pointer-lock/mouse-event-delivery-expected.txt: Added.
+        On macOS, the screen's origin is the bottom-left corner, so we need to flip the `deltaY`.
+
+        * platform/gtk/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt: Added.
+        This change causes the test to progress further than before, but there still appear to be
+        other issues elsewhere, so adjust the expected output to reflect that.
+
+        * platform/mac-wk1/TestExpectations:
+
 2022-03-25  Simon Fraser  <[email protected]>
 
         Unreviewed cleanup.

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (291885 => 291886)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-25 20:54:28 UTC (rev 291886)
@@ -1,3 +1,15 @@
+2022-03-25  Devin Rousso  <[email protected]>
+
+        `PointerEvent.movementX` always 0 (breaks https://noisecraft.app/)
+        https://bugs.webkit.org/show_bug.cgi?id=220194
+        <rdar://problem/72814440>
+
+        Reviewed by Simon Fraser.
+
+        * web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt:
+        This change causes the test to progress further than before, but there still appear to be
+        other issues elsewhere, so adjust the expected output to reflect that.
+
 2022-03-25  Alex Christensen  <[email protected]>
 
         Add css-typed-om color IDL skeletons

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt (291885 => 291886)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt	2022-03-25 20:54:28 UTC (rev 291886)
@@ -12,5 +12,5 @@
 Test passes if the proper behavior of the events is observed.
 
 
-FAIL mouse pointerevent movementX/Y with pointerlock test assert_equals: expected 0 but got 10
+FAIL mouse pointerevent movementX/Y with pointerlock test assert_equals: expected -9991 but got -9981
 

Copied: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt (from rev 291885, trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt) (0 => 291886)


--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt	2022-03-25 20:54:28 UTC (rev 291886)
@@ -0,0 +1,16 @@
+Pointer Events movement with pointerlock test
+
+Follow the test instructions with mouse. If you don't have the device skip it.
+
+Test Description: This test checks pointerevent movementX/Y value with pointerlock. It checks whether movement X/Y matches event.screenX/Y - last_event.screenX/Y when pointer is not locked; And if pointermove.movementX/Y matches mousemove.movementX/Y when pointer is locked.
+Move the mouse inside the green rectangle.
+Click left button on the green rectangle.(Enter pointerlock)
+Move the mouse around.
+Click left button again
+Move the mouse inside the green rectangle.
+Click left button again to end the test.
+Test passes if the proper behavior of the events is observed.
+
+
+FAIL mouse pointerevent movementX/Y with pointerlock test assert_equals: expected 9 but got 19
+

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (291885 => 291886)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2022-03-25 20:54:28 UTC (rev 291886)
@@ -1132,6 +1132,7 @@
 webkit.org/b/195098 pointerevents/mouse/over-enter-out-leave.html [ Failure ]
 webkit.org/b/195098 pointerevents/mouse/pointer-capture.html [ Failure ]
 webkit.org/b/195098 pointerevents/mouse/pointer-events-before-mouse-events.html [ Failure ]
+webkit.org/b/195098 pointer-lock/pointermove-movement-delta.html [ Failure ]
 
 webkit.org/b/196915 [ Debug ] inspector/timeline/timeline-recording.html [ Pass Failure ]
 

Modified: trunk/LayoutTests/pointer-lock/mouse-event-delivery-expected.txt (291885 => 291886)


--- trunk/LayoutTests/pointer-lock/mouse-event-delivery-expected.txt	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/LayoutTests/pointer-lock/mouse-event-delivery-expected.txt	2022-03-25 20:54:28 UTC (rev 291886)
@@ -9,8 +9,8 @@
 PASS event type: wheel, target: target1, received on: target1
 PASS event type: wheel, target: target1, received on: body
      With a lock in place move the mouse.
-PASS event type: mousemove, movementX: 25, movementY: -30, target: target1, received on: target1
-PASS event type: mousemove, movementX: 25, movementY: -30, target: target1, received on: body
+PASS event type: mousemove, movementX: 25, movementY: 30, target: target1, received on: target1
+PASS event type: mousemove, movementX: 25, movementY: 30, target: target1, received on: body
      With a lock in place send a click.
 PASS event type: mousedown, target: target1, received on: target1
 PASS event type: mousedown, target: target1, received on: body

Added: trunk/LayoutTests/pointer-lock/pointermove-movement-delta-expected.txt (0 => 291886)


--- trunk/LayoutTests/pointer-lock/pointermove-movement-delta-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/pointer-lock/pointermove-movement-delta-expected.txt	2022-03-25 20:54:28 UTC (rev 291886)
@@ -0,0 +1,3 @@
+
+PASS Testing the movementX and movementY properties of a pointer event triggered by a mouse.
+

Added: trunk/LayoutTests/pointer-lock/pointermove-movement-delta.html (0 => 291886)


--- trunk/LayoutTests/pointer-lock/pointermove-movement-delta.html	                        (rev 0)
+++ trunk/LayoutTests/pointer-lock/pointermove-movement-delta.html	2022-03-25 20:54:28 UTC (rev 291886)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script>
+
+"use strict";
+
+target_test((target, test) => {
+    eventSender.mouseMoveTo(100, 100);
+
+    target.addEventListener("pointermove", (event) => {
+        assert_equals(event.x, 150, "The x property value is as expected.");
+        assert_equals(event.y, 150, "The y property value is as expected.");
+
+        assert_equals(event.movementX, 50, "The movementX property value is as expected.");
+        assert_equals(event.movementY, 50, "The movementY property value is as expected.");
+
+        test.done();
+    });
+
+    eventSender.mouseMoveTo(150, 150);
+}, "Testing the movementX and movementY properties of a pointer event triggered by a mouse.");
+
+</script>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (291885 => 291886)


--- trunk/Source/WebCore/ChangeLog	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/Source/WebCore/ChangeLog	2022-03-25 20:54:28 UTC (rev 291886)
@@ -1,3 +1,33 @@
+2022-03-25  Devin Rousso  <[email protected]>
+
+        `PointerEvent.movementX` always 0 (breaks https://noisecraft.app/)
+        https://bugs.webkit.org/show_bug.cgi?id=220194
+        <rdar://problem/72814440>
+
+        Reviewed by Simon Fraser.
+
+        Test: pointer-lock/pointermove-movement-delta.html
+
+        * dom/PointerEvent.cpp:
+        (WebCore::PointerEvent::PointerEvent):
+        Also pass along the movement delta in the constructor that takes a `MouseEvent`.
+
+        * dom/MouseEvent.h:
+        * dom/MouseEvent.cpp:
+        (WebCore::MouseEvent::create):
+        (WebCore::MouseEvent::MouseEvent):
+        Require that all constructors that aren't invoked from JS always provide a movement delta.
+
+        * dom/MouseRelatedEvent.h:
+        (WebCore::MouseRelatedEvent::movementX const):
+        (WebCore::MouseRelatedEvent::movementY const):
+        Expose these methods even when `!ENABLE(POINTER_LOCK)` so that they can be called without
+        the callsite having to also have a `#if`.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::dispatchDragEvent):
+        Pass along the movement delta even when `!ENABLE(POINTER_LOCK)`.
+
 2022-03-25  Chris Dumez  <[email protected]>
 
         Drop duplicate isFiringEventListeners check in Node wrappers' isReachableFromOpaqueRoots()

Modified: trunk/Source/WebCore/dom/MouseEvent.cpp (291885 => 291886)


--- trunk/Source/WebCore/dom/MouseEvent.cpp	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/Source/WebCore/dom/MouseEvent.cpp	2022-03-25 20:54:28 UTC (rev 291886)
@@ -56,12 +56,7 @@
     auto isComposed = !isMouseEnterOrLeave ? IsComposed::Yes : IsComposed::No;
 
     return MouseEvent::create(eventType, canBubble, isCancelable, isComposed, event.timestamp().approximateMonotonicTime(), WTFMove(view), detail,
-        event.globalPosition(), event.position(),
-#if ENABLE(POINTER_LOCK)
-        event.movementDelta(),
-#else
-        { },
-#endif
+        event.globalPosition(), event.position(), event.movementDelta(),
         event.modifiers(), event.button(), event.buttons(), relatedTarget, event.force(), event.syntheticClickType());
 }
 
@@ -77,7 +72,7 @@
     int screenX, int screenY, int clientX, int clientY, OptionSet<Modifier> modifiers, short button, unsigned short buttons,
     unsigned short syntheticClickType, EventTarget* relatedTarget)
 {
-    return adoptRef(*new MouseEvent(eventType, canBubble, isCancelable, isComposed, WTFMove(view), detail, { screenX, screenY }, { clientX, clientY }, modifiers, button, buttons, syntheticClickType, relatedTarget));
+    return adoptRef(*new MouseEvent(eventType, canBubble, isCancelable, isComposed, WTFMove(view), detail, { screenX, screenY }, { clientX, clientY }, { }, modifiers, button, buttons, syntheticClickType, relatedTarget));
 }
 
 MouseEvent::MouseEvent() = default;
@@ -97,9 +92,9 @@
 }
 
 MouseEvent::MouseEvent(const AtomString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed,
-    RefPtr<WindowProxy>&& view, int detail, const IntPoint& screenLocation, const IntPoint& clientLocation,
+    RefPtr<WindowProxy>&& view, int detail, const IntPoint& screenLocation, const IntPoint& clientLocation, const IntPoint& movementDelta,
     OptionSet<Modifier> modifiers, short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget)
-    : MouseRelatedEvent(eventType, canBubble, isCancelable, isComposed, MonotonicTime::now(), WTFMove(view), detail, screenLocation, { }, { }, modifiers, IsSimulated::No)
+    : MouseRelatedEvent(eventType, canBubble, isCancelable, isComposed, MonotonicTime::now(), WTFMove(view), detail, screenLocation, { }, movementDelta, modifiers, IsSimulated::No)
     , m_button(button == -2 ? 0 : button)
     , m_buttons(buttons)
     , m_syntheticClickType(button == -2 ? 0 : syntheticClickType)

Modified: trunk/Source/WebCore/dom/MouseEvent.h (291885 => 291886)


--- trunk/Source/WebCore/dom/MouseEvent.h	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/Source/WebCore/dom/MouseEvent.h	2022-03-25 20:54:28 UTC (rev 291886)
@@ -93,7 +93,7 @@
         EventTarget* relatedTarget, double force, unsigned short syntheticClickType, IsSimulated, IsTrusted);
 
     MouseEvent(const AtomString& type, CanBubble, IsCancelable, IsComposed, RefPtr<WindowProxy>&&, int detail,
-        const IntPoint& screenLocation, const IntPoint& clientLocation, OptionSet<Modifier>, short button, unsigned short buttons,
+        const IntPoint& screenLocation, const IntPoint& clientLocation, const IntPoint& movementDelta, OptionSet<Modifier>, short button, unsigned short buttons,
         unsigned short syntheticClickType, EventTarget* relatedTarget);
 
     MouseEvent(const AtomString& type, const MouseEventInit&);

Modified: trunk/Source/WebCore/dom/MouseRelatedEvent.cpp (291885 => 291886)


--- trunk/Source/WebCore/dom/MouseRelatedEvent.cpp	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/Source/WebCore/dom/MouseRelatedEvent.cpp	2022-03-25 20:54:28 UTC (rev 291886)
@@ -41,14 +41,9 @@
     const IntPoint& screenLocation, const IntPoint& windowLocation, const IntPoint& movementDelta, OptionSet<Modifier> modifiers, IsSimulated isSimulated, IsTrusted isTrusted)
     : UIEventWithKeyState(eventType, canBubble, isCancelable, isComposed, timestamp, WTFMove(view), detail, modifiers, isTrusted)
     , m_screenLocation(screenLocation)
-#if ENABLE(POINTER_LOCK)
     , m_movementDelta(movementDelta)
-#endif
     , m_isSimulated(isSimulated == IsSimulated::Yes)
 {
-#if !ENABLE(POINTER_LOCK)
-    UNUSED_PARAM(movementDelta);
-#endif
     init(m_isSimulated, windowLocation);
 }
 
@@ -61,9 +56,7 @@
 MouseRelatedEvent::MouseRelatedEvent(const AtomString& eventType, const MouseRelatedEventInit& initializer, IsTrusted isTrusted)
     : UIEventWithKeyState(eventType, initializer)
     , m_screenLocation(IntPoint(initializer.screenX, initializer.screenY))
-#if ENABLE(POINTER_LOCK)
     , m_movementDelta(IntPoint(0, 0))
-#endif
 {
     ASSERT_UNUSED(isTrusted, isTrusted == IsTrusted::No);
     init(false, IntPoint(0, 0));

Modified: trunk/Source/WebCore/dom/MouseRelatedEvent.h (291885 => 291886)


--- trunk/Source/WebCore/dom/MouseRelatedEvent.h	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/Source/WebCore/dom/MouseRelatedEvent.h	2022-03-25 20:54:28 UTC (rev 291886)
@@ -48,10 +48,9 @@
     const IntPoint& screenLocation() const { return m_screenLocation; }
     int clientX() const { return m_clientLocation.x(); }
     int clientY() const { return m_clientLocation.y(); }
-#if ENABLE(POINTER_LOCK)
     int movementX() const { return m_movementDelta.x(); }
     int movementY() const { return m_movementDelta.y(); }
-#endif
+
     const LayoutPoint& clientLocation() const { return m_clientLocation; }
     int layerX() override;
     int layerY() override;
@@ -95,9 +94,7 @@
     // Expose these so MouseEvent::initMouseEvent can set them.
     IntPoint m_screenLocation;
     LayoutPoint m_clientLocation;
-#if ENABLE(POINTER_LOCK)
     LayoutPoint m_movementDelta;
-#endif
 
 private:
     void init(bool isSimulated, const IntPoint&);

Modified: trunk/Source/WebCore/dom/PointerEvent.cpp (291885 => 291886)


--- trunk/Source/WebCore/dom/PointerEvent.cpp	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/Source/WebCore/dom/PointerEvent.cpp	2022-03-25 20:54:28 UTC (rev 291886)
@@ -92,7 +92,7 @@
 }
 
 PointerEvent::PointerEvent(const AtomString& type, short button, const MouseEvent& mouseEvent, PointerID pointerId, const String& pointerType)
-    : MouseEvent(type, typeCanBubble(type), typeIsCancelable(type), typeIsComposed(type), mouseEvent.view(), mouseEvent.detail(), mouseEvent.screenLocation(), { mouseEvent.clientX(), mouseEvent.clientY() }, mouseEvent.modifierKeys(), button, mouseEvent.buttons(), mouseEvent.syntheticClickType(), mouseEvent.relatedTarget())
+    : MouseEvent(type, typeCanBubble(type), typeIsCancelable(type), typeIsComposed(type), mouseEvent.view(), mouseEvent.detail(), mouseEvent.screenLocation(), { mouseEvent.clientX(), mouseEvent.clientY() }, { mouseEvent.movementX(), mouseEvent.movementY() }, mouseEvent.modifierKeys(), button, mouseEvent.buttons(), mouseEvent.syntheticClickType(), mouseEvent.relatedTarget())
     , m_pointerId(pointerId)
     , m_pointerType(pointerType)
     , m_isPrimary(true)
@@ -100,7 +100,7 @@
 }
 
 PointerEvent::PointerEvent(const AtomString& type, PointerID pointerId, const String& pointerType, IsPrimary isPrimary)
-    : MouseEvent(type, typeCanBubble(type), typeIsCancelable(type), typeIsComposed(type), nullptr, 0, { }, { }, { }, 0, 0, 0, nullptr)
+    : MouseEvent(type, typeCanBubble(type), typeIsCancelable(type), typeIsComposed(type), nullptr, 0, { }, { }, { }, { }, 0, 0, 0, nullptr)
     , m_pointerId(pointerId)
     , m_pointerType(pointerType)
     , m_isPrimary(isPrimary == IsPrimary::Yes)

Modified: trunk/Source/WebCore/page/EventHandler.cpp (291885 => 291886)


--- trunk/Source/WebCore/page/EventHandler.cpp	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2022-03-25 20:54:28 UTC (rev 291886)
@@ -2270,12 +2270,7 @@
 
     auto dragEvent = DragEvent::create(eventType, Event::CanBubble::Yes, Event::IsCancelable::Yes, Event::IsComposed::Yes,
         event.timestamp().approximateMonotonicTime(), &m_frame.windowProxy(), 0,
-        event.globalPosition(), event.position(),
-#if ENABLE(POINTER_LOCK)
-        event.movementDelta(),
-#else
-        { },
-#endif
+        event.globalPosition(), event.position(), event.movementDelta(),
         event.modifiers(), 0, 0, nullptr, event.force(), NoTap, &dataTransfer);
 
     dragTarget.dispatchEvent(dragEvent);

Modified: trunk/Tools/ChangeLog (291885 => 291886)


--- trunk/Tools/ChangeLog	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/Tools/ChangeLog	2022-03-25 20:54:28 UTC (rev 291886)
@@ -1,3 +1,17 @@
+2022-03-25  Devin Rousso  <[email protected]>
+
+        `PointerEvent.movementX` always 0 (breaks https://noisecraft.app/)
+        https://bugs.webkit.org/show_bug.cgi?id=220194
+        <rdar://problem/72814440>
+
+        Reviewed by Simon Fraser.
+
+        * DumpRenderTree/mac/EventSendingController.mm:
+        (-[EventSendingController mouseMoveToX:Y:]):
+        * WebKitTestRunner/mac/EventSenderProxy.mm:
+        (WTR::EventSenderProxy::mouseMoveTo):
+        On macOS, the screen's origin is the bottom-left corner, so we need to flip the `deltaY`.
+
 2022-03-25  J Pascoe  <[email protected]>
 
         [WebAuthn] Maintain last modification time separate from last used time for platform credentials

Modified: trunk/Tools/DumpRenderTree/mac/EventSendingController.mm (291885 => 291886)


--- trunk/Tools/DumpRenderTree/mac/EventSendingController.mm	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/Tools/DumpRenderTree/mac/EventSendingController.mm	2022-03-25 20:54:28 UTC (rev 291886)
@@ -766,7 +766,7 @@
                                         pressure:0.0]);
     CGEventRef cgEvent = [event CGEvent];
     CGEventSetIntegerValueField(cgEvent, kCGMouseEventDeltaX, newMousePosition.x - lastMousePosition.x);
-    CGEventSetIntegerValueField(cgEvent, kCGMouseEventDeltaY, newMousePosition.y - lastMousePosition.y);
+    CGEventSetIntegerValueField(cgEvent, kCGMouseEventDeltaY, -1 * (newMousePosition.y - lastMousePosition.y));
     event = retainPtr([NSEvent eventWithCGEvent:cgEvent]);
     lastMousePosition = newMousePosition;
 #else

Modified: trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm (291885 => 291886)


--- trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm	2022-03-25 20:51:44 UTC (rev 291885)
+++ trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm	2022-03-25 20:54:28 UTC (rev 291886)
@@ -601,7 +601,7 @@
 
     CGEventRef cgEvent = event.CGEvent;
     CGEventSetIntegerValueField(cgEvent, kCGMouseEventDeltaX, newMousePosition.x - m_position.x);
-    CGEventSetIntegerValueField(cgEvent, kCGMouseEventDeltaY, newMousePosition.y - m_position.y);
+    CGEventSetIntegerValueField(cgEvent, kCGMouseEventDeltaY, -1 * (newMousePosition.y - m_position.y));
     event = [NSEvent eventWithCGEvent:cgEvent];
     m_position.x = newMousePosition.x;
     m_position.y = newMousePosition.y;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to