Unreviewed, rollout r211235 Pointer lock events should be delivered directly to the...
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2017 18:18:46 +0000 (18:18 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2017 18:18:46 +0000 (18:18 +0000)
The LayoutTest for this change is frequently failing.

Source/WebCore:

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::handleMouseForceEvent):
(WebCore::EventHandler::handleWheelEvent):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::isLocked): Deleted.
(WebCore::PointerLockController::dispatchLockedWheelEvent): Deleted.
* page/PointerLockController.h:

LayoutTests:

* platform/mac/TestExpectations:
* pointer-lock/mouse-event-delivery-expected.txt:
* pointer-lock/mouse-event-delivery.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211375 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac/TestExpectations
LayoutTests/pointer-lock/mouse-event-delivery-expected.txt
LayoutTests/pointer-lock/mouse-event-delivery.html
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/PointerLockController.cpp
Source/WebCore/page/PointerLockController.h

index da5916c..7b74686 100644 (file)
@@ -1,3 +1,13 @@
+2017-01-30  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rollout r211235 Pointer lock events should be delivered directly to the target element.
+
+        The LayoutTest for this change is frequently failing.
+
+        * platform/mac/TestExpectations:
+        * pointer-lock/mouse-event-delivery-expected.txt:
+        * pointer-lock/mouse-event-delivery.html:
+
 2017-01-30  Antoine Quint  <graouts@apple.com>
 
         LayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html is flaky
index f1e4c65..0030f20 100644 (file)
@@ -280,6 +280,7 @@ fast/events/platform-wheelevent-paging-y-in-scrolling-page.html
 # Pointer Lock can only check some of the API at the moment.
 pointer-lock/bug90391-move-then-window-open-crash.html
 pointer-lock/locked-element-iframe-removed-from-dom.html
+pointer-lock/mouse-event-delivery.html
 pointer-lock/pointerlockchange-event-on-lock-lost.html
 pointer-lock/pointerlockchange-pointerlockerror-events.html
 pointer-lock/pointerlockelement-null-when-pending.html
index 7f5459c..7565e9f 100644 (file)
@@ -5,17 +5,11 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 PASS document.onpointerlockchange event received.
 PASS document.pointerLockElement is targetdiv1
-     With a lock in place send a wheel event.
-PASS event type: wheel, target: target1, received on: target1
-PASS event type: wheel, 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
 PASS document.onpointerlockchange event received.
 PASS document.pointerLockElement is targetdiv2
-     With a lock in place send a wheel event.
-PASS event type: wheel, target: target2, received on: target2
-PASS event type: wheel, target: target2, received on: body
      With a lock in place send a click.
 PASS event type: mousedown, target: target2, received on: target2
 PASS event type: mousedown, target: target2, received on: body
index 4d0799b..e5b9c49 100644 (file)
             // doNextStep() called by onpointerlockchange handler.
         },
         function () {
-            debug("     With a lock in place send a wheel event.")
-            targetdiv1.onwheel = eventExpected;
-            targetdiv2.onwheel = eventNotExpected;
-            document.body.onwheel = eventExpected;
-            if (window.eventSender) {
-                window.eventSender.mouseMoveTo(20,20);
-                window.eventSender.leapForward(1000);
-                window.eventSender.mouseScrollBy(0,10);
-            }
-            doNextStep();
-        },
-        function () {
             debug("     With a lock in place send a click.")
             targetdiv1.onmousedown = eventExpected;
             targetdiv2.onmousedown = eventNotExpected;
             // doNextStep() called by onpointerlockchange handler.
         },
         function () {
-            debug("     With a lock in place send a wheel event.")
-            targetdiv1.onwheel = eventNotExpected;
-            targetdiv2.onwheel = eventExpected;
-            document.body.onwheel = eventExpected;
-            if (window.eventSender) {
-                window.eventSender.leapForward(1000);
-                window.eventSender.mouseScrollBy(0,10);
-            }
-            doNextStep();
-        },
-        function () {
             debug("     With a lock in place send a click.")
             targetdiv1.onmousedown = eventNotExpected;
             targetdiv2.onmousedown = eventExpected;
index c8ebe00..e3d39ca 100644 (file)
@@ -1,3 +1,21 @@
+2017-01-30  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rollout r211235 Pointer lock events should be delivered directly to the target element.
+
+        The LayoutTest for this change is frequently failing.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMousePressEvent):
+        (WebCore::EventHandler::handleMouseDoubleClickEvent):
+        (WebCore::EventHandler::handleMouseMoveEvent):
+        (WebCore::EventHandler::handleMouseReleaseEvent):
+        (WebCore::EventHandler::handleMouseForceEvent):
+        (WebCore::EventHandler::handleWheelEvent):
+        * page/PointerLockController.cpp:
+        (WebCore::PointerLockController::isLocked): Deleted.
+        (WebCore::PointerLockController::dispatchLockedWheelEvent): Deleted.
+        * page/PointerLockController.h:
+
 2017-01-30  Antoine Quint  <graouts@apple.com>
 
         LayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html is flaky
index 5041c55..ee4e772 100644 (file)
@@ -1622,13 +1622,6 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& platformMouse
         return true;
     }
 
-#if ENABLE(POINTER_LOCK)
-    if (m_frame.page()->pointerLockController().isLocked()) {
-        m_frame.page()->pointerLockController().dispatchLockedMouseEvent(platformMouseEvent, eventNames().mousedownEvent);
-        return true;
-    }
-#endif
-
     if (m_frame.mainFrame().pageOverlayController().handleMouseEvent(platformMouseEvent))
         return true;
 
@@ -1769,13 +1762,6 @@ bool EventHandler::handleMouseDoubleClickEvent(const PlatformMouseEvent& platfor
 
     UserGestureIndicator gestureIndicator(ProcessingUserGesture, m_frame.document());
 
-#if ENABLE(POINTER_LOCK)
-    if (m_frame.page()->pointerLockController().isLocked()) {
-        m_frame.page()->pointerLockController().dispatchLockedMouseEvent(platformMouseEvent, eventNames().mouseupEvent);
-        return true;
-    }
-#endif
-
     // We get this instead of a second mouse-up 
     m_mousePressed = false;
     setLastKnownMousePosition(platformMouseEvent);
@@ -1870,14 +1856,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& platformMouseE
 
     Ref<Frame> protectedFrame(m_frame);
     RefPtr<FrameView> protector(m_frame.view());
-
-#if ENABLE(POINTER_LOCK)
-    if (m_frame.page()->pointerLockController().isLocked()) {
-        m_frame.page()->pointerLockController().dispatchLockedMouseEvent(platformMouseEvent, eventNames().mousemoveEvent);
-        return true;
-    }
-#endif
-
+    
     setLastKnownMousePosition(platformMouseEvent);
 
     if (m_hoverTimer.isActive())
@@ -2011,13 +1990,6 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& platformMou
 
     m_frame.selection().setCaretBlinkingSuspended(false);
 
-#if ENABLE(POINTER_LOCK)
-    if (m_frame.page()->pointerLockController().isLocked()) {
-        m_frame.page()->pointerLockController().dispatchLockedMouseEvent(platformMouseEvent, eventNames().mouseupEvent);
-        return true;
-    }
-#endif
-
     if (m_frame.mainFrame().pageOverlayController().handleMouseEvent(platformMouseEvent))
         return true;
 
@@ -2096,17 +2068,6 @@ bool EventHandler::handleMouseForceEvent(const PlatformMouseEvent& event)
     Ref<Frame> protectedFrame(m_frame);
     RefPtr<FrameView> protector(m_frame.view());
 
-#if ENABLE(POINTER_LOCK)
-    if (m_frame.page()->pointerLockController().isLocked()) {
-        m_frame.page()->pointerLockController().dispatchLockedMouseEvent(event, eventNames().webkitmouseforcechangedEvent);
-        if (event.type() == PlatformEvent::MouseForceDown)
-            m_frame.page()->pointerLockController().dispatchLockedMouseEvent(event, eventNames().webkitmouseforcedownEvent);
-        if (event.type() == PlatformEvent::MouseForceUp)
-            m_frame.page()->pointerLockController().dispatchLockedMouseEvent(event, eventNames().webkitmouseforceupEvent);
-        return true;
-    }
-#endif
-
     setLastKnownMousePosition(event);
 
     HitTestRequest::HitTestRequestType hitType = HitTestRequest::DisallowUserAgentShadowContent | HitTestRequest::Active;
@@ -2712,13 +2673,6 @@ bool EventHandler::handleWheelEvent(const PlatformWheelEvent& event)
     if (!view)
         return false;
 
-#if ENABLE(POINTER_LOCK)
-    if (m_frame.page()->pointerLockController().isLocked()) {
-        m_frame.page()->pointerLockController().dispatchLockedWheelEvent(event);
-        return true;
-    }
-#endif
-
     m_isHandlingWheelEvent = true;
     setFrameWasScrolledByUser();
 
index 5379246..31cc659 100644 (file)
@@ -123,11 +123,6 @@ void PointerLockController::documentDetached(Document& document)
     }
 }
 
-bool PointerLockController::isLocked() const
-{
-    return m_element && !m_lockPending;
-}
-
 bool PointerLockController::lockPending() const
 {
     return m_lockPending;
@@ -180,14 +175,6 @@ void PointerLockController::dispatchLockedMouseEvent(const PlatformMouseEvent& e
         m_element->dispatchMouseEvent(event, eventNames().clickEvent, event.clickCount());
 }
 
-void PointerLockController::dispatchLockedWheelEvent(const PlatformWheelEvent& event)
-{
-    if (!m_element || !m_element->document().frame())
-        return;
-
-    m_element->dispatchWheelEvent(event);
-}
-
 void PointerLockController::clearElement()
 {
     m_lockPending = false;
index 5021ae9..13d161f 100644 (file)
@@ -35,7 +35,6 @@ class Element;
 class Document;
 class Page;
 class PlatformMouseEvent;
-class PlatformWheelEvent;
 class VoidCallback;
 
 class PointerLockController {
@@ -49,7 +48,6 @@ public:
     void requestPointerUnlockAndForceCursorVisible();
     void elementRemoved(Element&);
     void documentDetached(Document&);
-    bool isLocked() const;
     WEBCORE_EXPORT bool lockPending() const;
     WEBCORE_EXPORT Element* element() const;
 
@@ -57,7 +55,6 @@ public:
     WEBCORE_EXPORT void didNotAcquirePointerLock();
     WEBCORE_EXPORT void didLosePointerLock();
     void dispatchLockedMouseEvent(const PlatformMouseEvent&, const AtomicString& eventType);
-    void dispatchLockedWheelEvent(const PlatformWheelEvent&);
 
 private:
     void clearElement();