WebKit Bugzilla
Attachment 369511 Details for
Bug 197746
: [iOS] Lazily request keyboard on first hardware keydown when a non-editable element is focused
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197746-20190509122638.patch (text/plain), 3.89 KB, created by
Daniel Bates
on 2019-05-09 12:26:39 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-05-09 12:26:39 PDT
Size:
3.89 KB
patch
obsolete
>Subversion Revision: 244742 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index f03e10731efc3db834e841e0dd3e15bd6a5675e1..9c8c9a61a324f397125f33af2ed79a5d94709694 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,24 @@ >+2019-05-09 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Lazily request keyboard on first hardware keydown when a non-editable element is focused >+ https://bugs.webkit.org/show_bug.cgi?id=197746 >+ <rdar://problem/50630406> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Be even lazier. We only need to create a keyboard if an editable element is focused or on >+ the first hardware keydown when a non-editable element is focused. >+ >+ * UIProcess/ios/WKContentViewInteraction.h: >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView cleanupInteraction]): Reset bookkeeping. >+ (-[WKContentView _requiresKeyboardWhenFirstResponder]): Further condition the result on >+ whether we have seen a hardware keydown event in a non-editable element. >+ (-[WKContentView _handleKeyUIEvent:]): If this is the first hardware key event we've seen then >+ update state and call -reloadInputView. -reloadInputView will call us back in -_requiresKeyboardWhenFirstResponder >+ and we will now return YES. So, it will create the keyboard. >+ (-[WKContentView _hardwareKeyboardAvailabilityChanged]): Reset bookkeeping. >+ > 2019-05-09 Daniel Bates <dabates@apple.com> > > REGRESSION (r241734): 1% slower PLT on iPad >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >index 4aed1a8ca520ae3ec6a861c257cd336cf5a0868e..0164d2e3bcf3fe0b31302f15372b0a52753c6240 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >@@ -325,6 +325,7 @@ struct WKAutoCorrectionData { > > #if USE(UIKIT_KEYBOARD_ADDITIONS) > BOOL _candidateViewNeedsUpdate; >+ BOOL _seenHardwareKeyDownInNonEditableElement; > #endif > > BOOL _becomingFirstResponder; >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index b6c4d8588d728e49aeb6c8c633b3c195980495af..8d76c8a1ae19b6b41c6607dc9afc3145fe5d9943 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -835,6 +835,7 @@ - (void)cleanupInteraction > > #if USE(UIKIT_KEYBOARD_ADDITIONS) > _candidateViewNeedsUpdate = NO; >+ _seenHardwareKeyDownInNonEditableElement = NO; > #endif > > if (_interactionViewsContainerView) { >@@ -1646,14 +1647,8 @@ - (BOOL)_disableAutomaticKeyboardUI > > - (BOOL)_requiresKeyboardWhenFirstResponder > { >- // FIXME: Only create keyboard if [self shouldShowAutomaticKeyboardUI] returns YES or >- // on first hardware keydown in a non-editable element. See <https://bugs.webkit.org/show_bug.cgi?id=197746>. >-#if USE(UIKIT_KEYBOARD_ADDITIONS) >- if (GSEventIsHardwareKeyboardAttached()) >- return YES; >-#endif > // FIXME: We should add the logic to handle keyboard visibility during focus redirects. >- return [self shouldShowAutomaticKeyboardUI]; >+ return [self shouldShowAutomaticKeyboardUI] || _seenHardwareKeyDownInNonEditableElement; > } > > - (BOOL)_requiresKeyboardResetOnReload >@@ -4460,6 +4455,10 @@ - (void)_handleKeyUIEvent:(::UIEvent *)event > return; > } > #if USE(UIKIT_KEYBOARD_ADDITIONS) >+ if (!_seenHardwareKeyDownInNonEditableElement) { >+ _seenHardwareKeyDownInNonEditableElement = YES; >+ [self reloadInputViews]; >+ } > [super _handleKeyUIEvent:event]; > #else > [self handleKeyEvent:event]; >@@ -5184,6 +5183,7 @@ - (void)_elementDidBlur > > - (void)_hardwareKeyboardAvailabilityChanged > { >+ _seenHardwareKeyDownInNonEditableElement = NO; > [self reloadInputViews]; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197746
:
369511
|
369512
|
369519