2010-03-16 Martin Robinson <mrobinson@webkit.org>
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Mar 2010 17:41:07 +0000 (17:41 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Mar 2010 17:41:07 +0000 (17:41 +0000)
commit1d5a8b7dc791e9bf703f5c077bbc7eafb72b5305
tree54d54585b59c2db3dc30e9ffc16a573cbc104193
parent85cbf5205b13acf4eb750f1432ef3d3f4fc03642
2010-03-16  Martin Robinson  <mrobinson@webkit.org>

        Reviewed by Xan Lopez.

        can't input korean into lower all input box except adress input box in webkit gtk launcher
        https://bugs.webkit.org/show_bug.cgi?id=32290

        Make the GTK+ EditorClient properly handle different types of input module
        behavior such as commit and preedit signals that happen outside of key event
        filtering and multiple times in a row. Filter keyup events as well as keydown
        events and call gtk_im_context_focus_{in/out} when the WebView focus changes.

        Added tests for this behavior to the GTK+ unit tests.

        * WebCoreSupport/EditorClientGtk.cpp:
        (WebKit::imContextCommitted): Handle this signal properly when it happens outside of
        key event filtering.
        (WebKit::imContextPreeditChanged): Immediately update the preedit state and do not reject
        empty preedits, so that cancellation works properly.
        (WebKit::EditorClient::updatePendingComposition): Add this method, which handles the
        situation where a commit signal happens when there is still a pending commit.
        (WebKit::EditorClient::shouldBeginEditing): Clear pending composition state before editing
        starts.
        (WebKit::EditorClient::shouldEndEditing): Clear pending composition state before editing ends.
        (WebKit::EditorClient::handleKeyboardEvent): No longer special case preedits which happen during
        key event filtering. When confirming a pending composition use insertText instead of confirmComposition.
        (WebKit::EditorClient::handleInputMethodKeydown):
        * WebCoreSupport/EditorClientGtk.h: Make pendingComposition a member, so that multiple WebViews
        do not share state.
        (WebKit::EditorClient::webView): Added.
        (WebKit::EditorClient::treatContextCommitAsKeyEvent): Added.
        (WebKit::EditorClient::clearPendingComposition): Added.
        * tests/testkeyevents.c:
        (test_keypress_events_load_status_cb):
        (map_event_cb):
        (setup_keyevent_test):
        (test_keypress_events):
        (element_text_equal_to):
        (test_ime_load_status_cb):
        (test_ime):
        (main):
        * webkit/webkitwebview.cpp:
        (webkit_web_view_key_release_event):
        (webkit_web_view_focus_in_event):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@56072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
WebKit/gtk/WebCoreSupport/EditorClientGtk.h
WebKit/gtk/tests/testkeyevents.c
WebKit/gtk/webkit/webkitwebview.cpp