Bug 132136

Summary: [iOS WebKit2] Should properly handle focus redirect (keyboard state changes when focus changes)
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: WebKit2Assignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal Keywords: InRadar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch2 benjamin: review+

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.

<rdar://problem/16238336>
Comment 1 Enrica Casucci 2014-04-24 11:32:23 PDT
Created attachment 230095 [details]
Patch
Comment 2 Benjamin Poulain 2014-04-24 12:42:30 PDT
Comment on attachment 230095 [details]
Patch

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

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]
Patch2

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.