Infinite recursion in _clearImmediateActionState
[WebKit-https.git] / Source / WebKit / mac / WebView / WebImmediateActionController.mm
index da583f08108bc8a2ff4fceb487d1d206774f3d39..92bd692d5041d11dda1fe305d62be3b5a23d4f36 100644 (file)
@@ -110,6 +110,14 @@ using namespace WebCore;
 - (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;