iBooks immediate action blacklist should not even create the gesture recognizer
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Feb 2015 22:15:44 +0000 (22:15 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Feb 2015 22:15:44 +0000 (22:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=141768
-and corresponding-
rdar://problem/19806770

Reviewed by Tim Horton.

Move the runtime-application check to the point where the gesture recognizer is
created so that we can avoid doing so.
* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:processPool:configuration:webView:]):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _updateImmediateActionItem]):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm

index 7bd9e14..818b5d8 100644 (file)
@@ -1,3 +1,19 @@
+2015-02-18  Beth Dakin  <bdakin@apple.com>
+
+        iBooks immediate action blacklist should not even create the gesture recognizer
+        https://bugs.webkit.org/show_bug.cgi?id=141768
+        -and corresponding-
+        rdar://problem/19806770
+
+        Reviewed by Tim Horton.
+
+        Move the runtime-application check to the point where the gesture recognizer is 
+        created so that we can avoid doing so.
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView initWithFrame:processPool:configuration:webView:]):
+        * UIProcess/mac/WKImmediateActionController.mm:
+        (-[WKImmediateActionController _updateImmediateActionItem]):
+
 2015-02-18  Chris Dumez  <cdumez@apple.com>
 
         Access FontCache global instance via singleton() static member function
index 24eb5f6..2a3384e 100644 (file)
@@ -95,6 +95,7 @@
 #import <WebCore/PlatformEventFactoryMac.h>
 #import <WebCore/PlatformScreen.h>
 #import <WebCore/Region.h>
+#import <WebCore/RuntimeApplicationChecks.h>
 #import <WebCore/SharedBuffer.h>
 #import <WebCore/SoftLinking.h>
 #import <WebCore/TextAlternativeWithRange.h>
@@ -3634,7 +3635,9 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
         self._actionMenu.autoenablesItems = NO;
     }
 
-    if (Class gestureClass = NSClassFromString(@"NSImmediateActionGestureRecognizer")) {
+    // FIXME: We should not permanently disable this for iBooks. rdar://problem/19585689
+    Class gestureClass = NSClassFromString(@"NSImmediateActionGestureRecognizer");
+    if (gestureClass && !applicationIsIBooks()) {
         _data->_immediateActionGestureRecognizer = adoptNS([(NSImmediateActionGestureRecognizer *)[gestureClass alloc] initWithTarget:nil action:NULL]);
         _data->_immediateActionController = adoptNS([[WKImmediateActionController alloc] initWithPage:*_data->_page view:self recognizer:_data->_immediateActionGestureRecognizer.get()]);
         [_data->_immediateActionGestureRecognizer setDelegate:_data->_immediateActionController.get()];
index 72c357a..191062a 100644 (file)
@@ -40,7 +40,6 @@
 #import <WebCore/NSMenuSPI.h>
 #import <WebCore/NSPopoverSPI.h>
 #import <WebCore/QuickLookMacSPI.h>
-#import <WebCore/RuntimeApplicationChecks.h>
 #import <WebCore/SoftLinking.h>
 #import <WebCore/URL.h>
 
@@ -284,8 +283,7 @@ using namespace WebKit;
     RefPtr<WebHitTestResult> hitTestResult = [self _webHitTestResult];
     id customClientAnimationController = [_wkView _immediateActionAnimationControllerForHitTestResult:toAPI(hitTestResult.get()) withType:_type userData:toAPI(_userData.get())];
 
-    // FIXME: We should not permanently disable this for iBooks. rdar://problem/19585689
-    if (customClientAnimationController == [NSNull null] || applicationIsIBooks()) {
+    if (customClientAnimationController == [NSNull null]) {
         [self _cancelImmediateAction];
         return;
     }