Text input is largely broken when there are subframes loading
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 May 2013 20:04:43 +0000 (20:04 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 May 2013 20:04:43 +0000 (20:04 +0000)
commiteee5bbd0a65f4193ab6c03f76c92669f60b69936
tree665ffa1573b3ffbf8f01305ad3f57e81909ecfa3
parent43e5d7b05b54faad300d7fc90344f2276c6199dd
    Text input is largely broken when there are subframes loading
        http://bugs.webkit.org/show_bug.cgi?id=59121
        <rdar://problem/9320468>

        Reviewed by Darin Adler.

        * UIProcess/PageClient.h:
        * UIProcess/API/mac/PageClientImpl.h:
        * UIProcess/API/mac/PageClientImpl.mm:
        (WebKit::PageClientImpl::updateSecureInputState): Separated secure input state
        updating into a separate function. Removed updateTextInputState, we don't need
        to go through PageClient to implement its behavior at all.
        (WebKit::PageClientImpl::dismissDictionaryLookupPanel): Added a FIXME.

        * UIProcess/API/mac/WKView.mm:
        * UIProcess/API/mac/WKViewInternal.h:
        Removed _updateTextInputStateIncludingSecureInputState.

        * UIProcess/WebPageProxy.h: Added m_temporarilyClosedComposition, which helps
        to figure out that WebCore decided to close a composition. The issue is that WebCore
        would first send an EditorState with hasComposition set to false, and with
        shouldIgnoreCompositionSelectionChange set to true, at which time we forget the
        previous m_editorState, but can't make any decisions based on this transient state.
        We should find a way to simplify this (maybe not send these updates with
        shouldIgnoreCompositionSelectionChange at all?)

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::WebPageProxy): Initialize m_temporarilyClosedComposition.
        (WebKit::WebPageProxy::didCommitLoadForFrame): Removed the code to kill a composition
        when any frame commits a load, which made no sense (along with surrounding code,
        which will unfortunately survive longer).
        (WebKit::WebPageProxy::editorStateChanged): Implemented state updating here,
        we don't need to go to WKView.mm to implement this logic. Figure out when WebCore
        discards a composition, and notify input methods about this.
        (WebKit::WebPageProxy::resetStateAfterProcessExited): Reset m_temporarilyClosedComposition.
        Added some FIXMEs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/mac/editing/input/resources/first-page.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/input/resources/other-page.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/input/unconfirmed-text-navigation-with-page-cache-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/input/unconfirmed-text-navigation-with-page-cache.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h