Title: [229437] trunk/Source/WebKit
- Revision
- 229437
- Author
- [email protected]
- Date
- 2018-03-08 15:07:30 -0800 (Thu, 08 Mar 2018)
Log Message
[Extra zoom mode] Support resigning first responder status when focusing a form control
https://bugs.webkit.org/show_bug.cgi?id=183477
<rdar://problem/38225994>
Reviewed by Tim Horton.
Currently, when presenting an input view controller in extra zoom mode, if the web view loses first responder
status, we will blur the focused element, which dismisses all focused form control UI. For certain types of form
controls, this prevents the user from using key pieces of functionality.
To address this, disconnect the notion of first responder status from DOM element focus while the form control
overlay is shown. Later, when the active input session ends, if the web content view was first responder before
upon focusing the element, restore first responder status on the web view. This extra tweak is needed to ensure
that certain UI affordances which require first responder status on the web view continue to work after
interacting with a form control that changes the first responder.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView presentFocusedFormControlViewController:]):
(-[WKContentView dismissFocusedFormControlViewController:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (229436 => 229437)
--- trunk/Source/WebKit/ChangeLog 2018-03-08 22:58:23 UTC (rev 229436)
+++ trunk/Source/WebKit/ChangeLog 2018-03-08 23:07:30 UTC (rev 229437)
@@ -1,3 +1,26 @@
+2018-03-08 Wenson Hsieh <[email protected]>
+
+ [Extra zoom mode] Support resigning first responder status when focusing a form control
+ https://bugs.webkit.org/show_bug.cgi?id=183477
+ <rdar://problem/38225994>
+
+ Reviewed by Tim Horton.
+
+ Currently, when presenting an input view controller in extra zoom mode, if the web view loses first responder
+ status, we will blur the focused element, which dismisses all focused form control UI. For certain types of form
+ controls, this prevents the user from using key pieces of functionality.
+
+ To address this, disconnect the notion of first responder status from DOM element focus while the form control
+ overlay is shown. Later, when the active input session ends, if the web content view was first responder before
+ upon focusing the element, restore first responder status on the web view. This extra tweak is needed to ensure
+ that certain UI affordances which require first responder status on the web view continue to work after
+ interacting with a form control that changes the first responder.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView presentFocusedFormControlViewController:]):
+ (-[WKContentView dismissFocusedFormControlViewController:]):
+
2018-03-08 John Wilander <[email protected]>
Resource Load Statistics: Revert defaults read of zero values
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (229436 => 229437)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-03-08 22:58:23 UTC (rev 229436)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-03-08 23:07:30 UTC (rev 229437)
@@ -255,6 +255,8 @@
RetainPtr<WKNumberPadViewController> _numberPadViewController;
RetainPtr<WKSelectMenuViewController> _selectMenuViewController;
RetainPtr<WKTimePickerViewController> _timePickerViewController;
+
+ BOOL _shouldRestoreFirstResponderStatusAfterLosingFocus;
#endif
}
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (229436 => 229437)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-03-08 22:58:23 UTC (rev 229436)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-03-08 23:07:30 UTC (rev 229437)
@@ -4205,6 +4205,9 @@
if (_focusedFormControlViewController)
return;
+ ++_webView->_activeFocusedStateRetainCount;
+ _shouldRestoreFirstResponderStatusAfterLosingFocus = self.isFirstResponder;
+
_focusedFormControlViewController = adoptNS([[WKFocusedFormControlViewController alloc] init]);
[_focusedFormControlViewController setDelegate:self];
[[UIViewController _viewControllerForFullScreenPresentationFromView:self] presentViewController:_focusedFormControlViewController.get() animated:animated completion:nil];
@@ -4225,6 +4228,13 @@
if (!_focusedFormControlViewController)
return;
+ --_webView->_activeFocusedStateRetainCount;
+
+ if (_shouldRestoreFirstResponderStatusAfterLosingFocus && !self.isFirstResponder) {
+ _shouldRestoreFirstResponderStatusAfterLosingFocus = NO;
+ [self becomeFirstResponder];
+ }
+
[_focusedFormControlViewController dismissViewControllerAnimated:animated completion:nil];
_focusedFormControlViewController = nil;
[self setInputDelegate:nil];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes