Changeset 245226 in webkit
- Timestamp:
- May 12, 2019, 11:51:05 PM (7 years ago)
- Location:
- branches/safari-608.1.24-branch/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/ios/WKContentViewInteraction.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-608.1.24-branch/Source/WebKit/ChangeLog
r245225 r245226 1 2019-05-12 Babak Shafiei <bshafiei@apple.com> 2 3 Cherry-pick r245148. rdar://problem/50457731 4 5 REGRESSION (r241734): 1% slower PLT on iPad 6 https://bugs.webkit.org/show_bug.cgi?id=197745 7 <rdar://problem/50457731> 8 9 Reviewed by Per Arne Vollan. 10 11 For now, only create a keyboard when WKContentView becomes first responder if a hardware keyboard 12 is attached or an editable element is focused to recover the 1% loss when a keyboard is not attached. 13 We can do better and by that I mean be lazier. We'll do this <https://bugs.webkit.org/show_bug.cgi?id=197746>. 14 15 In r241734 we unified the key event handling code paths so we use exactly one for both software and 16 hardware key events. We took a simple approach of always requesting UIKit to create a keyboard when 17 the WKContentView becomes first responder. We did this so that we could continue listening for hardware 18 key events even when a non-editable element is focused and dispatch DOM events. As it turns out, always 19 creating a keyboard is expensive and caused a ~1% slowdown in page load time on iPad. 20 21 * UIProcess/ios/WKContentViewInteraction.mm: 22 (-[WKContentView _requiresKeyboardWhenFirstResponder]): Only create a keyboard if a hardware keyboard is 23 attached or an editable element is focused. 24 (-[WKContentView _hardwareKeyboardAvailabilityChanged]): Reload all input view (this will cause keyboard 25 creation) if -_requiresKeyboardWhenFirstResponder returns YES. 26 27 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245148 268f45cc-cd09-0410-ab3c-d52691b4dbfc 28 29 2019-05-09 Daniel Bates <dabates@apple.com> 30 31 REGRESSION (r241734): 1% slower PLT on iPad 32 https://bugs.webkit.org/show_bug.cgi?id=197745 33 <rdar://problem/50457731> 34 35 Reviewed by Per Arne Vollan. 36 37 For now, only create a keyboard when WKContentView becomes first responder if a hardware keyboard 38 is attached or an editable element is focused to recover the 1% loss when a keyboard is not attached. 39 We can do better and by that I mean be lazier. We'll do this <https://bugs.webkit.org/show_bug.cgi?id=197746>. 40 41 In r241734 we unified the key event handling code paths so we use exactly one for both software and 42 hardware key events. We took a simple approach of always requesting UIKit to create a keyboard when 43 the WKContentView becomes first responder. We did this so that we could continue listening for hardware 44 key events even when a non-editable element is focused and dispatch DOM events. As it turns out, always 45 creating a keyboard is expensive and caused a ~1% slowdown in page load time on iPad. 46 47 * UIProcess/ios/WKContentViewInteraction.mm: 48 (-[WKContentView _requiresKeyboardWhenFirstResponder]): Only create a keyboard if a hardware keyboard is 49 attached or an editable element is focused. 50 (-[WKContentView _hardwareKeyboardAvailabilityChanged]): Reload all input view (this will cause keyboard 51 creation) if -_requiresKeyboardWhenFirstResponder returns YES. 52 1 53 2019-05-12 Babak Shafiei <bshafiei@apple.com> 2 54 -
branches/safari-608.1.24-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r245225 r245226 1665 1665 - (BOOL)_requiresKeyboardWhenFirstResponder 1666 1666 { 1667 // FIXME: Only create keyboard if [self shouldShowAutomaticKeyboardUI] returns YES or 1668 // on first hardware keydown in a non-editable element. See <https://bugs.webkit.org/show_bug.cgi?id=197746>. 1667 1669 #if USE(UIKIT_KEYBOARD_ADDITIONS) 1668 return YES; 1669 #else 1670 if (GSEventIsHardwareKeyboardAttached()) 1671 return YES; 1672 #endif 1670 1673 // FIXME: We should add the logic to handle keyboard visibility during focus redirects. 1671 1674 return [self shouldShowAutomaticKeyboardUI]; 1672 #endif1673 1675 } 1674 1676 … … 5219 5221 - (void)_hardwareKeyboardAvailabilityChanged 5220 5222 { 5221 if (hasFocusedElement(_focusedElementInformation) && _focusedElementInformation.inputMode == WebCore::InputMode::None) 5222 [self reloadInputViews]; 5223 [self reloadInputViews]; 5223 5224 } 5224 5225
Note:
See TracChangeset
for help on using the changeset viewer.