Title: [181971] trunk/Source
Revision
181971
Author
[email protected]
Date
2015-03-25 14:09:18 -0700 (Wed, 25 Mar 2015)

Log Message

REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
force preview
https://bugs.webkit.org/show_bug.cgi?id=143057
-and corresponding-
rdar://problem/20251436

Reviewed by Tim Horton.

Source/WebCore:

This patch adds a value for ActionUpdated to the ImmediateActionStage enum. Now if 
m_immediateActionStage indicates that an immediate action has either begun or 
completed then we can have the same behavior.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseReleaseEvent):
* page/EventHandler.h:

Source/WebKit2:

Always call _page->immediateActionDidUpdate() so that the EventHandler’s 
ImmediateActionStage is appropriately updated.
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):

Update the EventHandler’s ImmediateActionStage.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::immediateActionDidUpdate):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (181970 => 181971)


--- trunk/Source/WebCore/ChangeLog	2015-03-25 20:59:18 UTC (rev 181970)
+++ trunk/Source/WebCore/ChangeLog	2015-03-25 21:09:18 UTC (rev 181971)
@@ -1,3 +1,20 @@
+2015-03-25  Beth Dakin  <[email protected]>
+
+        REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
+        force preview
+        https://bugs.webkit.org/show_bug.cgi?id=143057
+        -and corresponding-
+        rdar://problem/20251436
+
+        Reviewed by Tim Horton.
+
+        This patch adds a value for ActionUpdated to the ImmediateActionStage enum. Now if 
+        m_immediateActionStage indicates that an immediate action has either begun or 
+        completed then we can have the same behavior.
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMouseReleaseEvent):
+        * page/EventHandler.h:
+
 2015-03-25  Dean Jackson  <[email protected]>
 
         MediaControls: Use font with fixed number width

Modified: trunk/Source/WebCore/page/EventHandler.cpp (181970 => 181971)


--- trunk/Source/WebCore/page/EventHandler.cpp	2015-03-25 20:59:18 UTC (rev 181970)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2015-03-25 21:09:18 UTC (rev 181971)
@@ -2061,9 +2061,9 @@
     if (m_frameSetBeingResized)
         return !dispatchMouseEvent(eventNames().mouseupEvent, m_frameSetBeingResized.get(), true, m_clickCount, platformMouseEvent, false);
 
-    // If an immediate action was completed using this series of mouse events, then we should send mouseup to
+    // 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) {
+    if (m_immediateActionStage == ImmediateActionStage::ActionCompleted || m_immediateActionStage == ImmediateActionStage::ActionUpdated) {
         m_immediateActionStage = ImmediateActionStage::None;
         return !dispatchMouseEvent(eventNames().mouseupEvent, m_lastElementUnderMouse.get(), true, m_clickCount, platformMouseEvent, false);
     }

Modified: trunk/Source/WebCore/page/EventHandler.h (181970 => 181971)


--- trunk/Source/WebCore/page/EventHandler.h	2015-03-25 20:59:18 UTC (rev 181970)
+++ trunk/Source/WebCore/page/EventHandler.h	2015-03-25 21:09:18 UTC (rev 181971)
@@ -120,6 +120,7 @@
 enum class ImmediateActionStage {
     None,
     PerformedHitTest,
+    ActionUpdated,
     ActionCancelled,
     ActionCompleted
 };

Modified: trunk/Source/WebKit2/ChangeLog (181970 => 181971)


--- trunk/Source/WebKit2/ChangeLog	2015-03-25 20:59:18 UTC (rev 181970)
+++ trunk/Source/WebKit2/ChangeLog	2015-03-25 21:09:18 UTC (rev 181971)
@@ -1,3 +1,22 @@
+2015-03-25  Beth Dakin  <[email protected]>
+
+        REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
+        force preview
+        https://bugs.webkit.org/show_bug.cgi?id=143057
+        -and corresponding-
+        rdar://problem/20251436
+
+        Reviewed by Tim Horton.
+
+        Always call _page->immediateActionDidUpdate() so that the EventHandler’s 
+        ImmediateActionStage is appropriately updated.
+        * UIProcess/mac/WKImmediateActionController.mm:
+        (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
+
+        Update the EventHandler’s ImmediateActionStage.
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::immediateActionDidUpdate):
+
 2015-03-25  Antti Koivisto  <[email protected]>
 
         Separate entry decoding from validation

Modified: trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm (181970 => 181971)


--- trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm	2015-03-25 20:59:18 UTC (rev 181970)
+++ trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm	2015-03-25 21:09:18 UTC (rev 181971)
@@ -212,10 +212,9 @@
     if (immediateActionRecognizer != _immediateActionRecognizer)
         return;
 
-    if (_hitTestResult.contentPreventsDefault) {
-        _page->immediateActionDidUpdate([immediateActionRecognizer animationProgress]);
+    _page->immediateActionDidUpdate([immediateActionRecognizer animationProgress]);
+    if (_hitTestResult.contentPreventsDefault)
         return;
-    }
 
     _page->setTextIndicatorAnimationProgress([immediateActionRecognizer animationProgress]);
 }

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


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2015-03-25 20:59:18 UTC (rev 181970)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2015-03-25 21:09:18 UTC (rev 181971)
@@ -1158,6 +1158,8 @@
 
 void WebPage::immediateActionDidUpdate(float force)
 {
+    m_page->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::ActionUpdated);
+
     Element* element = m_lastActionMenuHitTestResult.innerElement();
     if (!element)
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to