Infinite recursion in _clearImmediateActionState
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jan 2015 19:42:03 +0000 (19:42 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jan 2015 19:42:03 +0000 (19:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140807
<rdar://problem/19571601>

Reviewed by Anders Carlsson.

* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _clearImmediateActionState]):
Clear _hasActivatedActionContext before calling didUseActions, because
didUseActions can call _clearImmediateActionState.

* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _clearImmediateActionState]):
Use this opportunity to bring identical code to WebKit1, to avoid
getting DataDetectors stuck when an immediate action is canceled.

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebImmediateActionController.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm

index 7dcfd58e5b24de8c40d4e8cc6037005375b6db87..7d8b2350d348e4b5d46e3502e3a47d1056586644 100644 (file)
@@ -1,3 +1,16 @@
+2015-01-23  Timothy Horton  <timothy_horton@apple.com>
+
+        Infinite recursion in _clearImmediateActionState
+        https://bugs.webkit.org/show_bug.cgi?id=140807
+        <rdar://problem/19571601>
+
+        Reviewed by Anders Carlsson.
+
+        * WebView/WebImmediateActionController.mm:
+        (-[WebImmediateActionController _clearImmediateActionState]):
+        Use this opportunity to bring identical code to WebKit1, to avoid
+        getting DataDetectors stuck when an immediate action is canceled.
+
 2015-01-22  Ryosuke Niwa  <rniwa@webkit.org>
 
         Add a build flag for ES6 class syntax
 2015-01-22  Ryosuke Niwa  <rniwa@webkit.org>
 
         Add a build flag for ES6 class syntax
index da583f08108bc8a2ff4fceb487d1d206774f3d39..92bd692d5041d11dda1fe305d62be3b5a23d4f36 100644 (file)
@@ -110,6 +110,14 @@ using namespace WebCore;
 - (void)_clearImmediateActionState
 {
     [_webView _clearTextIndicator];
 - (void)_clearImmediateActionState
 {
     [_webView _clearTextIndicator];
+    DDActionsManager *actionsManager = [getDDActionsManagerClass() sharedManager];
+    if ([actionsManager respondsToSelector:@selector(requestBubbleClosureUnanchorOnFailure:)])
+        [actionsManager requestBubbleClosureUnanchorOnFailure:YES];
+
+    if (_currentActionContext && _hasActivatedActionContext) {
+        _hasActivatedActionContext = NO;
+        [getDDActionsManagerClass() didUseActions];
+    }
 
     _type = WebImmediateActionNone;
     _currentActionContext = nil;
 
     _type = WebImmediateActionNone;
     _currentActionContext = nil;
index 42361771c7acb42f773cf3348d981aa9ea7bf9ac..d83b7a97627876fcdabfaa37722f0ade705654b8 100644 (file)
@@ -1,3 +1,16 @@
+2015-01-23  Timothy Horton  <timothy_horton@apple.com>
+
+        Infinite recursion in _clearImmediateActionState
+        https://bugs.webkit.org/show_bug.cgi?id=140807
+        <rdar://problem/19571601>
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/mac/WKImmediateActionController.mm:
+        (-[WKImmediateActionController _clearImmediateActionState]):
+        Clear _hasActivatedActionContext before calling didUseActions, because
+        didUseActions can call _clearImmediateActionState.
+
 2015-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Add initial database process support
 2015-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Add initial database process support
index 082bd0c4b1ed5f203d25c4183509dd0da2ff5420..8ac5ab0f61b273be98a185fc97cfc028bead6da7 100644 (file)
@@ -117,8 +117,8 @@ using namespace WebKit;
     _page->clearTextIndicator();
 
     if (_currentActionContext && _hasActivatedActionContext) {
     _page->clearTextIndicator();
 
     if (_currentActionContext && _hasActivatedActionContext) {
-        [getDDActionsManagerClass() didUseActions];
         _hasActivatedActionContext = NO;
         _hasActivatedActionContext = NO;
+        [getDDActionsManagerClass() didUseActions];
     }
 
     _state = ImmediateActionState::None;
     }
 
     _state = ImmediateActionState::None;