Changeset 223647 in webkit
- Timestamp:
- Oct 18, 2017 6:39:14 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r223644 r223647 1 2017-10-18 Chelsea Pugh <cpugh@apple.com> 2 3 [iOS] Use new class name from UIKit when checking UITextSuggestion type 4 https://bugs.webkit.org/show_bug.cgi?id=178416 5 <rdar://problem/35010840> 6 7 Reviewed by Tim Horton. 8 9 Here we start using UITextAutofillSuggestion instead of the old name that was being used for 10 AutoFill text suggestions. 11 12 * Platform/spi/ios/UIKitSPI.h: 13 * UIProcess/ios/WKContentViewInteraction.mm: 14 (-[WKContentView insertTextSuggestion:]): Use UITextAutofillSuggestion when checking the class 15 and when casting instead of UIKeyboardLoginCredentialsSuggestion. 16 1 17 2017-10-17 Jiewen Tan <jiewen_tan@apple.com> 2 18 -
trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h
r223017 r223647 955 955 @end 956 956 957 #if __has_include(<UIKit/UI KeyboardLoginCredentialsSuggestion.h>)958 #import <UIKit/UI KeyboardLoginCredentialsSuggestion.h>957 #if __has_include(<UIKit/UITextAutofillSuggestion.h>) 958 #import <UIKit/UITextAutofillSuggestion.h> 959 959 #else 960 @interface UI KeyboardLoginCredentialsSuggestion : UITextSuggestion960 @interface UITextAutofillSuggestion : UITextSuggestion 961 961 @property (nonatomic, assign) NSString *username; 962 962 @property (nonatomic, assign) NSString *password; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r223261 r223647 2986 2986 { 2987 2987 // FIXME: Replace NSClassFromString with actual class as soon as UIKit submitted the new class into the iOS SDK. 2988 if ([textSuggestion isKindOfClass:NSClassFromString(@"UI KeyboardLoginCredentialsSuggestion")]) {2989 _page->autofillLoginCredentials([(UI KeyboardLoginCredentialsSuggestion *)textSuggestion username], [(UIKeyboardLoginCredentialsSuggestion *)textSuggestion password]);2988 if ([textSuggestion isKindOfClass:NSClassFromString(@"UITextAutofillSuggestion")]) { 2989 _page->autofillLoginCredentials([(UITextAutofillSuggestion *)textSuggestion username], [(UITextAutofillSuggestion *)textSuggestion password]); 2990 2990 return; 2991 2991 } -
trunk/Tools/ChangeLog
r223643 r223647 1 2017-10-18 Chelsea Pugh <cpugh@apple.com> 2 3 [iOS] Use new class name from UIKit when checking UITextSuggestion type 4 https://bugs.webkit.org/show_bug.cgi?id=178416 5 6 Reviewed by Tim Horton. 7 8 This updates our test using/mocking out UITextAutofillSuggestion instead of UIKeyboardLoginCredentialsSuggestion. 9 10 * TestWebKitAPI/Tests/ios/WKWebViewAutofillTests.mm: 11 (-[UITextAutofillSuggestion initWithUsername:password:]): Copied from UIKit's implementation. This will serve as 12 a mock of this method for builds not containingit. 13 (+[UITextAutofillSuggestion autofillSuggestionWithUsername:password:]): Ditto. 14 (TestWebKitAPI::TEST): Use +[UITextAutofillSuggestion autofillSuggestionWithUsername:password:] inline instead of 15 helper function for creating a new suggestion. 16 (newUIKeyboardLoginCredentialsSuggestion): Deleted. 17 18 * TestWebKitAPI/ios/UIKitSPI.h: 19 1 20 2017-10-18 Fujii Hironori <Hironori.Fujii@sony.com> 2 21 -
trunk/Tools/TestWebKitAPI/Tests/ios/WKWebViewAutofillTests.mm
r222991 r223647 36 36 #import <wtf/BlockPtr.h> 37 37 38 #if !__has_include(<UIKit/UI KeyboardLoginCredentialsSuggestion.h>)38 #if !__has_include(<UIKit/UITextAutofillSuggestion.h>) 39 39 // FIXME: This can be safely removed once <rdar://problem/34583628> lands in the SDK. 40 @implementation UIKeyboardLoginCredentialsSuggestion 40 @implementation UITextAutofillSuggestion 41 - (instancetype)initWithUsername:(NSString *)username password:(NSString *)password 42 { 43 self = [super init]; 44 if (self) { 45 _username = username; 46 _password = password; 47 } 48 return self; 49 } 50 51 + (instancetype)autofillSuggestionWithUsername:(NSString *)username password:(NSString *)password 52 { 53 return [[self alloc] initWithUsername:username password:password]; 54 } 41 55 @end 42 56 #endif 43 44 static UIKeyboardLoginCredentialsSuggestion *newUIKeyboardLoginCredentialsSuggestion(NSString *username, NSString *password)45 {46 UIKeyboardLoginCredentialsSuggestion *suggestion = [UIKeyboardLoginCredentialsSuggestion new];47 suggestion.username = username;48 suggestion.password = password;49 return suggestion;50 }51 57 52 58 typedef UIView <UITextInputTraits_Private_Proposed_SPI_34583628> AutofillInputView; … … 120 126 EXPECT_TRUE([webView textInputHasAutofillContext]); 121 127 122 auto credentialSuggestion = adoptNS(newUIKeyboardLoginCredentialsSuggestion(@"frederik", @"famos"));123 [[webView _autofillInputView] insertTextSuggestion:credentialSuggestion .get()];128 auto credentialSuggestion = [UITextAutofillSuggestion autofillSuggestionWithUsername:@"frederik" password:@"famos"]; 129 [[webView _autofillInputView] insertTextSuggestion:credentialSuggestion]; 124 130 125 131 EXPECT_WK_STREQ("famos", [webView stringByEvaluatingJavaScript:@"password.value"]); … … 139 145 EXPECT_TRUE([webView textInputHasAutofillContext]); 140 146 141 auto credentialSuggestion = adoptNS(newUIKeyboardLoginCredentialsSuggestion(@"frederik", @"famos"));142 [[webView _autofillInputView] insertTextSuggestion:credentialSuggestion .get()];147 auto credentialSuggestion = [UITextAutofillSuggestion autofillSuggestionWithUsername:@"frederik" password:@"famos"]; 148 [[webView _autofillInputView] insertTextSuggestion:credentialSuggestion]; 143 149 144 150 EXPECT_WK_STREQ("frederik", [webView stringByEvaluatingJavaScript:@"user.value"]); … … 167 173 EXPECT_TRUE([webView textInputHasAutofillContext]); 168 174 169 auto credentialSuggestion = adoptNS(newUIKeyboardLoginCredentialsSuggestion(@"frederik", @"famos"));170 [[webView _autofillInputView] insertTextSuggestion:credentialSuggestion .get()];175 auto credentialSuggestion = [UITextAutofillSuggestion autofillSuggestionWithUsername:@"frederik" password:@"famos"]; 176 [[webView _autofillInputView] insertTextSuggestion:credentialSuggestion]; 171 177 172 178 EXPECT_WK_STREQ("famos", [webView stringByEvaluatingJavaScript:@"password.value"]); -
trunk/Tools/TestWebKitAPI/ios/UIKitSPI.h
r223012 r223647 74 74 @end 75 75 76 #if __has_include(<UIKit/UI KeyboardLoginCredentialsSuggestion.h>)76 #if __has_include(<UIKit/UITextAutofillSuggestion.h>) 77 77 // FIXME: Move this import under USE(APPLE_INTERNAL_SDK) once <rdar://problem/34583628> lands in the SDK. 78 #import <UIKit/UIKeyboardLoginCredentialsSuggestion.h> 78 #import <UIKit/UITextAutofillSuggestion.h> 79 @interface UITextAutofillSuggestion () 80 + (instancetype)autofillSuggestionWithUsername:(NSString *)username password:(NSString *)password; 81 @end 79 82 #else 80 @interface UI KeyboardLoginCredentialsSuggestion : UITextSuggestion83 @interface UITextAutofillSuggestion : UITextSuggestion 81 84 @property (nonatomic, assign) NSString *username; 82 85 @property (nonatomic, assign) NSString *password; 86 + (instancetype)autofillSuggestionWithUsername:(NSString *)username password:(NSString *)password; 83 87 @end 84 88 #endif
Note: See TracChangeset
for help on using the changeset viewer.