⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245226 in webkit


Ignore:
Timestamp:
May 12, 2019, 11:51:05 PM (7 years ago)
Author:
bshafiei@apple.com
Message:

Cherry-pick r245148. rdar://problem/50457731

REGRESSION (r241734): 1% slower PLT on iPad
https://bugs.webkit.org/show_bug.cgi?id=197745
<rdar://problem/50457731>

Reviewed by Per Arne Vollan.

For now, only create a keyboard when WKContentView becomes first responder if a hardware keyboard
is attached or an editable element is focused to recover the 1% loss when a keyboard is not attached.
We can do better and by that I mean be lazier. We'll do this <https://bugs.webkit.org/show_bug.cgi?id=197746>.

In r241734 we unified the key event handling code paths so we use exactly one for both software and
hardware key events. We took a simple approach of always requesting UIKit to create a keyboard when
the WKContentView becomes first responder. We did this so that we could continue listening for hardware
key events even when a non-editable element is focused and dispatch DOM events. As it turns out, always
creating a keyboard is expensive and caused a ~1% slowdown in page load time on iPad.

  • UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _requiresKeyboardWhenFirstResponder]): Only create a keyboard if a hardware keyboard is attached or an editable element is focused. (-[WKContentView _hardwareKeyboardAvailabilityChanged]): Reload all input view (this will cause keyboard creation) if -_requiresKeyboardWhenFirstResponder returns YES.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245148 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-608.1.24-branch/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-608.1.24-branch/Source/WebKit/ChangeLog

    r245225 r245226  
     12019-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
    1532019-05-12  Babak Shafiei  <bshafiei@apple.com>
    254
  • branches/safari-608.1.24-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r245225 r245226  
    16651665- (BOOL)_requiresKeyboardWhenFirstResponder
    16661666{
     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>.
    16671669#if USE(UIKIT_KEYBOARD_ADDITIONS)
    1668     return YES;
    1669 #else
     1670    if (GSEventIsHardwareKeyboardAttached())
     1671        return YES;
     1672#endif
    16701673    // FIXME: We should add the logic to handle keyboard visibility during focus redirects.
    16711674    return [self shouldShowAutomaticKeyboardUI];
    1672 #endif
    16731675}
    16741676
     
    52195221- (void)_hardwareKeyboardAvailabilityChanged
    52205222{
    5221     if (hasFocusedElement(_focusedElementInformation) && _focusedElementInformation.inputMode == WebCore::InputMode::None)
    5222         [self reloadInputViews];
     5223    [self reloadInputViews];
    52235224}
    52245225
Note: See TracChangeset for help on using the changeset viewer.