Title: [188990] trunk/Source
Revision
188990
Author
bda...@apple.com
Date
2015-08-26 14:51:12 -0700 (Wed, 26 Aug 2015)

Log Message

REGRESSION: Safari navigates after a cancelled force click
https://bugs.webkit.org/show_bug.cgi?id=148491
-and corresponding-
rdar://problem/22394323

Reviewed by Tim Horton.

Source/WebCore:

This regression was introduced on El Capitan because AppKit sends ‘cancel’ to 
gesture recognizer BEFORE it sends the mouseUp. So the ImmediateActionStage needs 
to track whether a cancel happened after updates or without any updates since they 
signify different things. 

Don’t perform default behaviors when the stage is ActionCancelledAfterUpdate.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseReleaseEvent):

New possible stages, and new getter for the current stage.
* page/EventHandler.h:
(WebCore::EventHandler::immediateActionStage):

Source/WebKit/mac:

Use the current stage to determine which type of cancel this is.
* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController immediateActionRecognizerDidCancelAnimation:]):

Source/WebKit2:

Use the current stage to determine which type of cancel this is.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::immediateActionDidCancel):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (188989 => 188990)


--- trunk/Source/WebCore/ChangeLog	2015-08-26 21:37:43 UTC (rev 188989)
+++ trunk/Source/WebCore/ChangeLog	2015-08-26 21:51:12 UTC (rev 188990)
@@ -1,3 +1,25 @@
+2015-08-26  Beth Dakin  <bda...@apple.com>
+
+        REGRESSION: Safari navigates after a cancelled force click
+        https://bugs.webkit.org/show_bug.cgi?id=148491
+        -and corresponding-
+        rdar://problem/22394323
+
+        Reviewed by Tim Horton.
+
+        This regression was introduced on El Capitan because AppKit sends ‘cancel’ to 
+        gesture recognizer BEFORE it sends the mouseUp. So the ImmediateActionStage needs 
+        to track whether a cancel happened after updates or without any updates since they 
+        signify different things. 
+
+        Don’t perform default behaviors when the stage is ActionCancelledAfterUpdate.
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMouseReleaseEvent):
+
+        New possible stages, and new getter for the current stage.
+        * page/EventHandler.h:
+        (WebCore::EventHandler::immediateActionStage):
+
 2015-08-26  Anders Carlsson  <ander...@apple.com>
 
         Fix failing tests.

Modified: trunk/Source/WebCore/page/EventHandler.cpp (188989 => 188990)


--- trunk/Source/WebCore/page/EventHandler.cpp	2015-08-26 21:37:43 UTC (rev 188989)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2015-08-26 21:51:12 UTC (rev 188990)
@@ -2101,7 +2101,7 @@
 
     // If an immediate action began or was completed using this series of mouse events, then we should send mouseup to
     // the DOM and return now so that we don't perform our own default behaviors.
-    if (m_immediateActionStage == ImmediateActionStage::ActionCompleted || m_immediateActionStage == ImmediateActionStage::ActionUpdated) {
+    if (m_immediateActionStage == ImmediateActionStage::ActionCompleted || m_immediateActionStage == ImmediateActionStage::ActionUpdated || m_immediateActionStage == ImmediateActionStage::ActionCancelledAfterUpdate) {
         m_immediateActionStage = ImmediateActionStage::None;
         return !dispatchMouseEvent(eventNames().mouseupEvent, m_lastElementUnderMouse.get(), true, m_clickCount, platformMouseEvent, false);
     }

Modified: trunk/Source/WebCore/page/EventHandler.h (188989 => 188990)


--- trunk/Source/WebCore/page/EventHandler.h	2015-08-26 21:37:43 UTC (rev 188989)
+++ trunk/Source/WebCore/page/EventHandler.h	2015-08-26 21:51:12 UTC (rev 188990)
@@ -121,7 +121,8 @@
     None,
     PerformedHitTest,
     ActionUpdated,
-    ActionCancelled,
+    ActionCancelledWithoutUpdate,
+    ActionCancelledAfterUpdate,
     ActionCompleted
 };
 
@@ -313,6 +314,7 @@
     bool isHandlingWheelEvent() const { return m_isHandlingWheelEvent; }
 
     WEBCORE_EXPORT void setImmediateActionStage(ImmediateActionStage stage);
+    WEBCORE_EXPORT ImmediateActionStage immediateActionStage() const { return m_immediateActionStage; }
 
 private:
 #if ENABLE(DRAG_SUPPORT)

Modified: trunk/Source/WebKit/mac/ChangeLog (188989 => 188990)


--- trunk/Source/WebKit/mac/ChangeLog	2015-08-26 21:37:43 UTC (rev 188989)
+++ trunk/Source/WebKit/mac/ChangeLog	2015-08-26 21:51:12 UTC (rev 188990)
@@ -1,3 +1,16 @@
+2015-08-26  Beth Dakin  <bda...@apple.com>
+
+        REGRESSION: Safari navigates after a cancelled force click
+        https://bugs.webkit.org/show_bug.cgi?id=148491
+        -and corresponding-
+        rdar://problem/22394323
+
+        Reviewed by Tim Horton.
+
+        Use the current stage to determine which type of cancel this is.
+        * WebView/WebImmediateActionController.mm:
+        (-[WebImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
+
 2015-08-26  Tim Horton  <timothy_hor...@apple.com>
 
         Layout Test platform/mac/fast/events/content-inset-hit-testing-in-frame.html is flaky

Modified: trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm (188989 => 188990)


--- trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm	2015-08-26 21:37:43 UTC (rev 188989)
+++ trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm	2015-08-26 21:51:12 UTC (rev 188990)
@@ -210,8 +210,13 @@
         return;
 
     Frame* coreFrame = core([[[[_webView _selectedOrMainFrame] frameView] documentView] _frame]);
-    if (coreFrame)
-        coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelled);
+    if (coreFrame) {
+        ImmediateActionStage lastStage = coreFrame->eventHandler().immediateActionStage();
+        if (lastStage == ImmediateActionStage::ActionUpdated)
+            coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelledAfterUpdate);
+        else
+            coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelledWithoutUpdate);
+    }
 
     [_webView _setTextIndicatorAnimationProgress:0];
     [self _clearImmediateActionState];

Modified: trunk/Source/WebKit2/ChangeLog (188989 => 188990)


--- trunk/Source/WebKit2/ChangeLog	2015-08-26 21:37:43 UTC (rev 188989)
+++ trunk/Source/WebKit2/ChangeLog	2015-08-26 21:51:12 UTC (rev 188990)
@@ -1,3 +1,16 @@
+2015-08-26  Beth Dakin  <bda...@apple.com>
+
+        REGRESSION: Safari navigates after a cancelled force click
+        https://bugs.webkit.org/show_bug.cgi?id=148491
+        -and corresponding-
+        rdar://problem/22394323
+
+        Reviewed by Tim Horton.
+
+        Use the current stage to determine which type of cancel this is.
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::immediateActionDidCancel):
+
 2015-08-26  Eric Carlson  <eric.carl...@apple.com>
 
         Media Session: make MediaSessionMetadata a class

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (188989 => 188990)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2015-08-26 21:37:43 UTC (rev 188989)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2015-08-26 21:51:12 UTC (rev 188990)
@@ -1208,7 +1208,11 @@
 
 void WebPage::immediateActionDidCancel()
 {
-    m_page->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelled);
+    ImmediateActionStage lastStage = m_page->mainFrame().eventHandler().immediateActionStage();
+    if (lastStage == ImmediateActionStage::ActionUpdated)
+        m_page->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelledAfterUpdate);
+    else
+        m_page->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelledWithoutUpdate);
 }
 
 void WebPage::immediateActionDidComplete()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to