Changeset 187751 in webkit


Ignore:
Timestamp:
Aug 3, 2015 12:29:47 PM (9 years ago)
Author:
Wenson Hsieh
Message:

Inputs with the autofocus attribute cause the keyboard to not deploy
https://bugs.webkit.org/show_bug.cgi?id=147555
<rdar://problem/22018044>

Reviewed by Andreas Kling.

Upon submitting a form by pressing "Go" on the keyboard, an <input> on the next page with the
autofocus attribute may become non-interactible. When attempting to tap on the input, nothing
seems to happen. This is because the state of WebPage upon invoking WebPage::elementDidFocus
indicates (incorrectly) that the input element is already focused, and therefore hits an early
return. To solve this, we explicitly reset m_hasFocusedDueToUserInteraction upon transitioning
to a new page.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::didStartPageTransition): On iOS, resets m_hasFocusedDueToUserInteraction as

well. It was previously thought that this would be handled by blur() called on the assisted
element when submitting a form. However, pressing "Go" on the iOS keyboard is an implicit
submission and does not trigger a blur event.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r187749 r187751  
     12015-08-03  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Inputs with the autofocus attribute cause the keyboard to not deploy
     4        https://bugs.webkit.org/show_bug.cgi?id=147555
     5        <rdar://problem/22018044>
     6
     7        Reviewed by Andreas Kling.
     8
     9        Upon submitting a form by pressing "Go" on the keyboard, an <input> on the next page with the
     10        autofocus attribute may become non-interactible. When attempting to tap on the input, nothing
     11        seems to happen. This is because the state of WebPage upon invoking WebPage::elementDidFocus
     12        indicates (incorrectly) that the input element is already focused, and therefore hits an early
     13        return. To solve this, we explicitly reset m_hasFocusedDueToUserInteraction upon transitioning
     14        to a new page.
     15
     16        * WebProcess/WebPage/WebPage.cpp:
     17        (WebKit::WebPage::didStartPageTransition): On iOS, resets m_hasFocusedDueToUserInteraction as
     18            well. It was previously thought that this would be handled by blur() called on the assisted
     19            element when submitting a form. However, pressing "Go" on the iOS keyboard is an implicit
     20            submission and does not trigger a blur event.
     21
    1222015-08-03  Chris Dumez  <cdumez@apple.com>
    223
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r187338 r187751  
    24382438{
    24392439    m_drawingArea->setLayerTreeStateIsFrozen(true);
     2440#if PLATFORM(IOS)
     2441    m_hasFocusedDueToUserInteraction = false;
     2442#endif
    24402443}
    24412444
Note: See TracChangeset for help on using the changeset viewer.