Bug 132136 - [iOS WebKit2] Should properly handle focus redirect (keyboard state changes when focus changes)
Summary: [iOS WebKit2] Should properly handle focus redirect (keyboard state changes w...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Enrica Casucci
Keywords: InRadar
Depends on:
Reported: 2014-04-24 11:24 PDT by Enrica Casucci
Modified: 2014-04-24 14:45 PDT (History)
0 users

See Also:

Patch (4.62 KB, patch)
2014-04-24 11:32 PDT, Enrica Casucci
no flags Details | Formatted Diff | Diff
Patch2 (13.03 KB, patch)
2014-04-24 14:29 PDT, Enrica Casucci
benjamin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enrica Casucci 2014-04-24 11:24:28 PDT
In pages where fields are focused from Javascript we should not display the keyboard, unless the user has already started interacting with the page.

Comment 1 Enrica Casucci 2014-04-24 11:32:23 PDT
Created attachment 230095 [details]
Comment 2 Benjamin Poulain 2014-04-24 12:42:30 PDT
Comment on attachment 230095 [details]

To be udpated.
Comment 3 Enrica Casucci 2014-04-24 14:29:40 PDT
Created attachment 230106 [details]

After discussing the first patch with Ben, I've implemented a different solution.
Comment 4 Benjamin Poulain 2014-04-24 14:34:08 PDT
Comment on attachment 230106 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=230106&action=review

> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:317
> +    RefPtr<Frame> oldFocusedFrame = m_page->focusController().focusedFrame();
> +    RefPtr<Element> oldFocusedElement = oldFocusedFrame ? oldFocusedFrame->document()->focusedElement() : nullptr;
> +    m_userIsInteracting = true;

I believe you will need the same logic in WebPage::dispatchTouchEvent().
Comment 5 Enrica Casucci 2014-04-24 14:45:23 PDT
Committed revision 167774.