Changeset 245148 in webkit
- Timestamp:
- May 9, 2019 11:58:45 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r245144 r245148 1 2019-05-09 Daniel Bates <dabates@apple.com> 2 3 REGRESSION (r241734): 1% slower PLT on iPad 4 https://bugs.webkit.org/show_bug.cgi?id=197745 5 <rdar://problem/50457731> 6 7 Reviewed by Per Arne Vollan. 8 9 For now, only create a keyboard when WKContentView becomes first responder if a hardware keyboard 10 is attached or an editable element is focused to recover the 1% loss when a keyboard is not attached. 11 We can do better and by that I mean be lazier. We'll do this <https://bugs.webkit.org/show_bug.cgi?id=197746>. 12 13 In r241734 we unified the key event handling code paths so we use exactly one for both software and 14 hardware key events. We took a simple approach of always requesting UIKit to create a keyboard when 15 the WKContentView becomes first responder. We did this so that we could continue listening for hardware 16 key events even when a non-editable element is focused and dispatch DOM events. As it turns out, always 17 creating a keyboard is expensive and caused a ~1% slowdown in page load time on iPad. 18 19 * UIProcess/ios/WKContentViewInteraction.mm: 20 (-[WKContentView _requiresKeyboardWhenFirstResponder]): Only create a keyboard if a hardware keyboard is 21 attached or an editable element is focused. 22 (-[WKContentView _hardwareKeyboardAvailabilityChanged]): Reload all input view (this will cause keyboard 23 creation) if -_requiresKeyboardWhenFirstResponder returns YES. 24 1 25 2019-05-09 Daniel Bates <dabates@apple.com> 2 26 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r245144 r245148 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.