Title: [208094] trunk/Tools
Revision
208094
Author
wenson_hs...@apple.com
Date
2016-10-28 19:07:31 -0700 (Fri, 28 Oct 2016)

Log Message

Unreviewed, fix the iOS build after r208090.

Use soft-linking as needed in UIScriptControllerIOS.mm.

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::waitForTextPredictionsViewAndSelectCandidateAtIndex):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (208093 => 208094)


--- trunk/Tools/ChangeLog	2016-10-29 01:42:31 UTC (rev 208093)
+++ trunk/Tools/ChangeLog	2016-10-29 02:07:31 UTC (rev 208094)
@@ -1,5 +1,14 @@
 2016-10-28  Wenson Hsieh  <wenson_hs...@apple.com>
 
+        Unreviewed, fix the iOS build after r208090.
+
+        Use soft-linking as needed in UIScriptControllerIOS.mm.
+
+        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+        (WTR::UIScriptController::waitForTextPredictionsViewAndSelectCandidateAtIndex):
+
+2016-10-28  Wenson Hsieh  <wenson_hs...@apple.com>
+
         iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
         https://bugs.webkit.org/show_bug.cgi?id=164077
         <rdar://problem/28987810>

Modified: trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (208093 => 208094)


--- trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm	2016-10-29 01:42:31 UTC (rev 208093)
+++ trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm	2016-10-29 02:07:31 UTC (rev 208094)
@@ -38,9 +38,13 @@
 #import <_javascript_Core/OpaqueJSString.h>
 #import <UIKit/UIKit.h>
 #import <WebCore/FloatRect.h>
+#import <WebCore/SoftLinking.h>
 #import <WebKit/WKWebViewPrivate.h>
 #import <WebKit/WebKit.h>
 
+SOFT_LINK_FRAMEWORK(UIKit)
+SOFT_LINK_CLASS_OPTIONAL(UIKit, UIKeyboardPredictionView)
+
 namespace WTR {
 
 void UIScriptController::doAsyncTask(JSValueRef callback)
@@ -272,7 +276,7 @@
 void UIScriptController::waitForTextPredictionsViewAndSelectCandidateAtIndex(long index, unsigned callbackID, float interval)
 {
 #if USE(APPLE_INTERNAL_SDK)
-    if (![UIKeyboardPredictionView activeInstance].hasPredictions) {
+    if (![[getUIKeyboardPredictionViewClass() activeInstance] hasPredictions]) {
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, interval * NSEC_PER_SEC), dispatch_get_main_queue(), ^() {
             waitForTextPredictionsViewAndSelectCandidateAtIndex(index, callbackID, interval);
         });
@@ -280,10 +284,10 @@
     }
 
     PlatformWKView webView = TestController::singleton().mainWebView()->platformView();
-    CGRect predictionViewFrame = [UIKeyboardPredictionView activeInstance].frame;
+    CGRect predictionViewFrame = [[getUIKeyboardPredictionViewClass() activeInstance] frame];
     // This assumes there are 3 predicted text cells of equal width, which is the case on iOS.
     float offsetX = (index * 2 + 1) * CGRectGetWidth(predictionViewFrame) / 6;
-    float offsetY = CGRectGetHeight(webView.window.frame) - CGRectGetHeight([UIKeyboardPredictionView activeInstance].superview.frame) + CGRectGetHeight(predictionViewFrame) / 2;
+    float offsetY = CGRectGetHeight(webView.window.frame) - CGRectGetHeight([[[getUIKeyboardPredictionViewClass() activeInstance] superview] frame]) + CGRectGetHeight(predictionViewFrame) / 2;
     [[HIDEventGenerator sharedHIDEventGenerator] tap:CGPointMake(offsetX, offsetY) completionBlock:^{
         if (m_context)
             m_context->asyncTaskComplete(callbackID);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to