Changeset 243302 in webkit
- Timestamp:
- Mar 21, 2019, 11:14:57 AM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/ios/WKContentViewInteraction.mm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r243292 r243302 1 2019-03-21 Daniel Bates <dabates@apple.com> 2 3 [iOS] Inline -_ensureFormAccessoryView into -formAccessoryView and have -_updateAccessory ensure we have a form accessory 4 https://bugs.webkit.org/show_bug.cgi?id=196021 5 6 Reviewed by Wenson Hsieh. 7 8 Every caller of -_ensureFormAccessoryView, except -formAccessoryView, immediately follows the call 9 with a call to -_updateAccessory. Let's just have -_updateAccessory ensure we have a form accessory 10 view and inline the implementation of -_ensureFormAccessoryView into -formAccessoryView so we can 11 remove one method. 12 13 * UIProcess/ios/WKContentViewInteraction.mm: 14 (-[WKContentView inputView]): Remove call to -_ensureFormAccessoryView, -_updateAccessory will do 15 the equivalent work for us. 16 (-[WKContentView formAccessoryView]): Moved implementation of -_ensureFormAccessoryView into here. 17 (-[WKContentView _updateAccessory]): Call self.formAccessoryView to ensure we have a form accessory view. 18 (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): 19 Remove call to -_ensureFormAccessoryView, -_updateAccessory will do 20 the equivalent work for us. 21 (-[WKContentView _ensureFormAccessoryView]): Deleted. 22 1 23 2019-03-21 Shawn Roberts <sroberts@apple.com> 2 24 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r243221 r243302 1666 1666 // rotation, when a select element is focused. See <https://webkit.org/b/192878> for more information. 1667 1667 [self _zoomToRevealFocusedElement]; 1668 [self _ensureFormAccessoryView];1669 1668 [self _updateAccessory]; 1670 1669 } … … 2475 2474 { 2476 2475 return [super inputAssistantItem]; 2477 }2478 2479 - (void)_ensureFormAccessoryView2480 {2481 if (_formAccessoryView)2482 return;2483 2484 _formAccessoryView = adoptNS([[UIWebFormAccessory alloc] initWithInputAssistantItem:self.inputAssistantItem]);2485 [_formAccessoryView setDelegate:self];2486 2476 } 2487 2477 … … 3785 3775 } 3786 3776 3777 - (UIWebFormAccessory *)formAccessoryView 3778 { 3779 if (_formAccessoryView) 3780 return _formAccessoryView.get(); 3781 _formAccessoryView = adoptNS([[UIWebFormAccessory alloc] initWithInputAssistantItem:self.inputAssistantItem]); 3782 [_formAccessoryView setDelegate:self]; 3783 return _formAccessoryView.get(); 3784 } 3785 3787 3786 - (void)_updateAccessory 3788 3787 { 3789 [_formAccessoryView setNextEnabled:_focusedElementInformation.hasNextNode]; 3790 [_formAccessoryView setPreviousEnabled:_focusedElementInformation.hasPreviousNode]; 3788 auto* accessoryView = self.formAccessoryView; // Creates one, if needed. 3789 3790 [accessoryView setNextEnabled:_focusedElementInformation.hasNextNode]; 3791 [accessoryView setPreviousEnabled:_focusedElementInformation.hasPreviousNode]; 3791 3792 3792 3793 if (currentUserInterfaceIdiomIsPad()) { 3793 [ _formAccessoryView setClearVisible:NO];3794 [accessoryView setClearVisible:NO]; 3794 3795 return; 3795 3796 } … … 3800 3801 case WebKit::InputType::DateTimeLocal: 3801 3802 case WebKit::InputType::Time: 3802 [ _formAccessoryView setClearVisible:YES];3803 [accessoryView setClearVisible:YES]; 3803 3804 return; 3804 3805 default: 3805 [ _formAccessoryView setClearVisible:NO];3806 [accessoryView setClearVisible:NO]; 3806 3807 return; 3807 3808 } … … 4796 4797 } 4797 4798 4798 - (UIWebFormAccessory *)formAccessoryView4799 {4800 [self _ensureFormAccessoryView];4801 return _formAccessoryView.get();4802 }4803 4804 4799 static bool shouldDeferZoomingToSelectionWhenRevealingFocusedElement(WebKit::InputType type) 4805 4800 { … … 4987 4982 [self _zoomToRevealFocusedElement]; 4988 4983 4989 [self _ensureFormAccessoryView];4990 4984 [self _updateAccessory]; 4991 4985
Note:
See TracChangeset
for help on using the changeset viewer.