Changeset 228605 in webkit
- Timestamp:
- Feb 18, 2018 9:51:49 AM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r228602 r228605 1 2018-02-18 Reza Abbasian <rabbasian@apple.com> 2 3 Set the appropriate AutoFill context for suggested passwords. 4 https://bugs.webkit.org/show_bug.cgi?id=182718 5 <rdar://problem/36326863> 6 7 Reviewed by Wenson Hsieh and Tim Horton. 8 9 Before starting the input session, call the new delegate to query if AutoFill password suggestion assistance 10 is required for the focused element. 11 12 * UIProcess/API/Cocoa/_WKFormInputSession.h: 13 * UIProcess/API/Cocoa/_WKInputDelegate.h: 14 Introduce a new delegate to be called before starting an input session to query if AutoFill password suggestion 15 assistance is required for the focused element. 16 * UIProcess/ios/WKContentViewInteraction.h: 17 * UIProcess/ios/WKContentViewInteraction.mm: 18 (-[WKFormInputSession initWithContentView:focusedElementInfo:requiresStrongPasswordAssistance:]): 19 (-[WKFormInputSession requiresStrongPasswordAssistance]): 20 (-[WKContentView cleanupInteraction]): 21 (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): 22 Call the delegate to find out if AutoFill suggested password assistance is required. 23 (-[WKContentView _stopAssistingNode]): 24 (-[WKContentView _autofillContext]): If the first responder is a password element and requires 25 assistance for AutoFill suggested password, set the appropriate AutoFill context. 26 (-[WKFormInputSession initWithContentView:focusedElementInfo:]): Deleted. 27 1 28 2018-02-17 Wenson Hsieh <wenson_hsieh@apple.com> 2 29 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKFormInputSession.h
r205559 r228605 45 45 @property (nonatomic) BOOL accessoryViewShouldNotShow WK_API_AVAILABLE(ios(10.0)); 46 46 @property (nonatomic) BOOL forceSecureTextEntry WK_API_AVAILABLE(ios(10.0)); 47 @property (nonatomic, readonly) BOOL requiresStrongPasswordAssistance WK_API_AVAILABLE(ios(WK_IOS_TBA)); 47 48 #endif 48 49 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInputDelegate.h
r206084 r228605 46 46 - (void)_webView:(WKWebView *)webView accessoryViewCustomButtonTappedInFormInputSession:(id <_WKFormInputSession>)inputSession; 47 47 - (void)_webView:(WKWebView *)webView insertTextSuggestion:(UITextSuggestion *)suggestion inInputSession:(id <_WKFormInputSession>)inputSession WK_API_AVAILABLE(ios(10.0)); 48 - (BOOL)_webView:(WKWebView *)webView focusRequiresStrongPasswordAssistance:(id <_WKFocusedElementInfo>)info WK_API_AVAILABLE(ios(WK_IOS_TBA)); 48 49 #endif 49 50 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r228557 r228605 237 237 BOOL _isChangingFocus; 238 238 239 BOOL _focusRequiresStrongPasswordAssistance; 240 239 241 #if ENABLE(DATA_INTERACTION) 240 242 WebKit::DragDropInteractionState _dragDropInteractionState; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r228602 r228605 277 277 @interface WKFormInputSession : NSObject <_WKFormInputSession> 278 278 279 - (instancetype)initWithContentView:(WKContentView *)view focusedElementInfo:(WKFocusedElementInfo *)elementInfo ;279 - (instancetype)initWithContentView:(WKContentView *)view focusedElementInfo:(WKFocusedElementInfo *)elementInfo requiresStrongPasswordAssistance:(BOOL)requiresStrongPasswordAssistance; 280 280 - (void)invalidate; 281 281 … … 289 289 BOOL _accessoryViewShouldNotShow; 290 290 BOOL _forceSecureTextEntry; 291 } 292 293 - (instancetype)initWithContentView:(WKContentView *)view focusedElementInfo:(WKFocusedElementInfo *)elementInfo 291 BOOL _requiresStrongPasswordAssistance; 292 } 293 294 - (instancetype)initWithContentView:(WKContentView *)view focusedElementInfo:(WKFocusedElementInfo *)elementInfo requiresStrongPasswordAssistance:(BOOL)requiresStrongPasswordAssistance 294 295 { 295 296 if (!(self = [super init])) … … 298 299 _contentView = view; 299 300 _focusedElementInfo = elementInfo; 301 _requiresStrongPasswordAssistance = requiresStrongPasswordAssistance; 300 302 301 303 return self; … … 384 386 _suggestions = adoptNS([suggestions copy]); 385 387 [suggestionDelegate setSuggestions:suggestions]; 388 } 389 390 - (BOOL)requiresStrongPasswordAssistance 391 { 392 return _requiresStrongPasswordAssistance; 386 393 } 387 394 … … 660 667 [_highlightView removeFromSuperview]; 661 668 _outstandingPositionInformationRequest = std::nullopt; 669 670 _focusRequiresStrongPasswordAssistance = NO; 662 671 663 672 if (_interactionViewsContainerView) { … … 4023 4032 return; 4024 4033 4034 _focusRequiresStrongPasswordAssistance = NO; 4035 if ([inputDelegate respondsToSelector:@selector(_webView:focusRequiresStrongPasswordAssistance:)]) 4036 _focusRequiresStrongPasswordAssistance = [inputDelegate _webView:_webView focusRequiresStrongPasswordAssistance:focusedElementInfo.get()]; 4037 4025 4038 BOOL editableChanged = [self setIsEditable:YES]; 4026 4039 _assistedNodeInformation = information; … … 4066 4079 4067 4080 if ([inputDelegate respondsToSelector:@selector(_webView:didStartInputSession:)]) { 4068 _formInputSession = adoptNS([[WKFormInputSession alloc] initWithContentView:self focusedElementInfo:focusedElementInfo.get() ]);4081 _formInputSession = adoptNS([[WKFormInputSession alloc] initWithContentView:self focusedElementInfo:focusedElementInfo.get() requiresStrongPasswordAssistance:_focusRequiresStrongPasswordAssistance]); 4069 4082 [inputDelegate _webView:_webView didStartInputSession:_formInputSession.get()]; 4070 4083 } … … 4082 4095 _assistedNodeInformation.elementType = InputType::None; 4083 4096 _inputPeripheral = nil; 4097 _focusRequiresStrongPasswordAssistance = NO; 4084 4098 4085 4099 [self _stopAssistingKeyboard]; … … 5106 5120 - (NSDictionary *)_autofillContext 5107 5121 { 5108 if (_assistedNodeInformation.elementType == InputType::None || !_assistedNodeInformation.acceptsAutofilledLoginCredentials) 5122 BOOL provideStrongPasswordAssistance = _focusRequiresStrongPasswordAssistance && _assistedNodeInformation.elementType == InputType::Password; 5123 if (_assistedNodeInformation.elementType == InputType::None || (!_assistedNodeInformation.acceptsAutofilledLoginCredentials && !provideStrongPasswordAssistance)) 5109 5124 return nil; 5110 5125 5126 if (provideStrongPasswordAssistance) 5127 return @{ @"_automaticPasswordKeyboard" : @YES }; 5128 5111 5129 NSURL *platformURL = _assistedNodeInformation.representingPageURL; 5112 if ( !platformURL)5113 return nil;5114 5115 return @{ @"_WebViewURL" : platformURL };5130 if (platformURL) 5131 return @{ @"_WebViewURL" : platformURL }; 5132 5133 return nil; 5116 5134 } 5117 5135
Note: See TracChangeset
for help on using the changeset viewer.