REOPENED 200902
[iOS] Should show input view when became first responder if keyboard was showing when the view was resigned
https://bugs.webkit.org/show_bug.cgi?id=200902
Summary [iOS] Should show input view when became first responder if keyboard was show...
Daniel Bates
Reported 2019-08-19 16:32:33 PDT
We should remember whether the keyboard is showing when the view resigns first responder so that we can show the keyboard (again) when the view becomes first responder. On a iPad without a hardware keyboard, this makes the experience more pleasant when switching back and forth between a tab with a focused editable elements, say like a Google Docs document, and another tab.
Attachments
Work-in-progress (21.13 KB, patch)
2019-08-19 16:34 PDT, Daniel Bates
no flags
Patch and layout tests (30.47 KB, patch)
2019-08-20 11:04 PDT, Daniel Bates
no flags
To land (31.46 KB, patch)
2019-08-21 15:36 PDT, Daniel Bates
no flags
To land (31.41 KB, patch)
2019-08-22 15:21 PDT, Daniel Bates
no flags
To Land (32.62 KB, patch)
2020-03-25 10:12 PDT, Daniel Bates
no flags
Daniel Bates
Comment 1 2019-08-19 16:32:58 PDT
Daniel Bates
Comment 2 2019-08-19 16:34:49 PDT
Created attachment 376716 [details] Work-in-progress
Daniel Bates
Comment 3 2019-08-20 11:04:14 PDT
Created attachment 376782 [details] Patch and layout tests
Wenson Hsieh
Comment 4 2019-08-20 15:43:31 PDT
Comment on attachment 376782 [details] Patch and layout tests View in context: https://bugs.webkit.org/attachment.cgi?id=376782&action=review > Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:341 > + BOOL _shouldShowInputViewForPageReActivation; Nit - this should probably be …Reactivation instead of …ReActivation. > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:5277 > + SetForScope<BOOL> shouldShowInputViewForPageReActivationScope { _shouldShowInputViewForPageReActivation, startInputSessionPolicy == _WKFocusStartsInputSessionPolicyAuto && (self.isFirstResponder || _becomingFirstResponder) && activityStateChanges.contains(WebCore::ActivityState::IsFocused) && _wasResignedWhileShowingInputView }; Nit - we could consider factoring out the self.isFirstResponder || _becomingFirstResponder check into a separate method, and just use the helper in both places.
Daniel Bates
Comment 5 2019-08-20 16:44:14 PDT
Thanks for the review. (In reply to Wenson Hsieh from comment #4) > Comment on attachment 376782 [details] > Patch and layout tests > > View in context: > https://bugs.webkit.org/attachment.cgi?id=376782&action=review > > > Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:341 > > + BOOL _shouldShowInputViewForPageReActivation; > > Nit - this should probably be …Reactivation instead of …ReActivation. > Yep, will fix. > > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:5277 > > + SetForScope<BOOL> shouldShowInputViewForPageReActivationScope { _shouldShowInputViewForPageReActivation, startInputSessionPolicy == _WKFocusStartsInputSessionPolicyAuto && (self.isFirstResponder || _becomingFirstResponder) && activityStateChanges.contains(WebCore::ActivityState::IsFocused) && _wasResignedWhileShowingInputView }; > > Nit - we could consider factoring out the self.isFirstResponder || > _becomingFirstResponder check into a separate method, and just use the > helper in both places. Will factor out.
Daniel Bates
Comment 6 2019-08-21 15:36:27 PDT
Daniel Bates
Comment 7 2019-08-22 15:21:12 PDT
Created attachment 377059 [details] To land Rebased patch
Daniel Bates
Comment 8 2019-08-22 15:23:00 PDT
Russell Epstein
Comment 9 2019-08-23 10:15:57 PDT
Reverted r249031 for reason: Causes multiple test failures on iOS simulator Committed r249051: <https://trac.webkit.org/changeset/249051>
Daniel Bates
Comment 10 2020-03-25 10:10:34 PDT
(In reply to Russell Epstein from comment #9) > Reverted r249031 for reason: > > Causes multiple test failures on iOS simulator > > Committed r249051: <https://trac.webkit.org/changeset/249051> To elaborate more, the reason why the change was rolled out was because it revealed a UIKit bug, <rdar://problem/55201802>. That bug has been fixed in 13.4.
Daniel Bates
Comment 11 2020-03-25 10:12:31 PDT
Note You need to log in before you can comment on or make changes to this bug.