Don't create UIWebFormAccessory if we don't require accessory view.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Jul 2015 01:08:19 +0000 (01:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Jul 2015 01:08:19 +0000 (01:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147283

Don't try to intialize _formAccessoryView if requiresAccessoryView returns false since we don't
need it yet.

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2015-07-24
Reviewed by Dan Bernstein.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView inputAccessoryView]):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm

index eca585f..90db453 100644 (file)
@@ -1,3 +1,16 @@
+2015-07-24  Yongjun Zhang  <yongjun_zhang@apple.com>
+
+        Don't create UIWebFormAccessory if we don't require accessory view.
+        https://bugs.webkit.org/show_bug.cgi?id=147283
+
+        Don't try to intialize _formAccessoryView if requiresAccessoryView returns false since we don't
+        need it yet.
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView inputAccessoryView]):
+
 2015-07-24  Anders Carlsson  <andersca@apple.com>
 
         WKWebsiteDataStore remove methods don't properly delete cookies
index f1b600e..0279e58 100644 (file)
@@ -1259,6 +1259,9 @@ static void cancelPotentialTapIfNecessary(WKContentView* contentView)
 
 - (UIView *)inputAccessoryView
 {
+    if (![self requiresAccessoryView])
+        return nil;
+
     if (!_formAccessoryView) {
 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000
         if ([UIWebFormAccessory instancesRespondToSelector:@selector(initWithInputAssistantItem:)])
@@ -1269,9 +1272,6 @@ static void cancelPotentialTapIfNecessary(WKContentView* contentView)
         [_formAccessoryView setDelegate:self];
     }
 
-    if (![self requiresAccessoryView])
-        return nil;
-    
     return _formAccessoryView.get();
 }