⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 136126 in webkit


Ignore:
Timestamp:
Nov 29, 2012, 6:17:30 AM (14 years ago)
Author:
michael.bruning@digia.com
Message:

[Qt][WK2] Commit the preedit string in the input method when focus is about to be moved.
​https://bugs.webkit.org/show_bug.cgi?id=97774

Reviewed by Kenneth Rohde Christiansen.

Implements the handler for willSetInputMethodState in WebKit2 in Qt.
This is needed to tell the input method instance in Qt to commit its
preedit content when the focus has moved to another node to prevent a
bug where the old preedit string was kept as the preedit string and
the editor moved focus back to the old node when continuing to enter
text via the input method.

This behavior is analog to the behavior of the QtQuick text input
elements.

  • UIProcess/API/qt/raw/qrawwebview.cpp:

(QRawWebViewPrivate::handleWillSetInputMethodState):

  • UIProcess/API/qt/raw/qrawwebview_p_p.h:

(QRawWebViewPrivate):

  • UIProcess/PageClient.h:

(PageClient):

  • UIProcess/WebPageProxy.h:

(WebPageProxy):

  • UIProcess/WebPageProxy.messages.in:
  • UIProcess/qt/QtPageClient.cpp:

(WebKit::QtPageClient::handleWillSetInputMethodState):
(WebKit):

  • UIProcess/qt/QtPageClient.h:

(QtPageClient):

  • UIProcess/qt/QtWebPageEventHandler.cpp:

(WebKit::QtWebPageEventHandler::handleWillSetInputMethodState):
(WebKit):

  • UIProcess/qt/QtWebPageEventHandler.h:

(QtWebPageEventHandler):

  • UIProcess/qt/WebPageProxyQt.cpp:

(WebKit::WebPageProxy::willSetInputMethodState):
(WebKit):

  • WebProcess/WebCoreSupport/WebEditorClient.cpp:

(WebKit::WebEditorClient::willSetInputMethodState):

Location:
trunk/Source/WebKit2
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r136119 r136126  
     12012-11-29  Michael Brüning  <michael.bruning@digia.com>
     2
     3        [Qt][WK2] Commit the preedit string in the input method when focus is about to be moved.
     4        https://bugs.webkit.org/show_bug.cgi?id=97774
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Implements the handler for willSetInputMethodState in WebKit2 in Qt.
     9        This is needed to tell the input method instance in Qt to commit its
     10        preedit content when the focus has moved to another node to prevent a
     11        bug where the old preedit string was kept as the preedit string and
     12        the editor moved focus back to the old node when continuing to enter
     13        text via the input method.
     14
     15        This behavior is analog to the behavior of the QtQuick text input
     16        elements.
     17
     18        * UIProcess/API/qt/raw/qrawwebview.cpp:
     19        (QRawWebViewPrivate::handleWillSetInputMethodState):
     20        * UIProcess/API/qt/raw/qrawwebview_p_p.h:
     21        (QRawWebViewPrivate):
     22        * UIProcess/PageClient.h:
     23        (PageClient):
     24        * UIProcess/WebPageProxy.h:
     25        (WebPageProxy):
     26        * UIProcess/WebPageProxy.messages.in:
     27        * UIProcess/qt/QtPageClient.cpp:
     28        (WebKit::QtPageClient::handleWillSetInputMethodState):
     29        (WebKit):
     30        * UIProcess/qt/QtPageClient.h:
     31        (QtPageClient):
     32        * UIProcess/qt/QtWebPageEventHandler.cpp:
     33        (WebKit::QtWebPageEventHandler::handleWillSetInputMethodState):
     34        (WebKit):
     35        * UIProcess/qt/QtWebPageEventHandler.h:
     36        (QtWebPageEventHandler):
     37        * UIProcess/qt/WebPageProxyQt.cpp:
     38        (WebKit::WebPageProxy::willSetInputMethodState):
     39        (WebKit):
     40        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
     41        (WebKit::WebEditorClient::willSetInputMethodState):
     42
    1432012-11-28  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
    244
  • trunk/Source/WebKit2/UIProcess/API/qt/raw/qrawwebview.cpp

    r135401 r136126  
    131131}
    132132
     133void QRawWebViewPrivate::handleWillSetInputMethodState()
     134{
     135    notImplemented();
     136}
     137
    133138#if ENABLE(GESTURE_EVENTS)
    134139void QRawWebViewPrivate::doneWithGestureEvent(const WebKit::WebGestureEvent& event, bool wasEventHandled)
  • trunk/Source/WebKit2/UIProcess/API/qt/raw/qrawwebview_p_p.h

    r130031 r136126  
    7272
    7373    virtual void updateTextInputState();
     74    virtual void handleWillSetInputMethodState();
    7475#if ENABLE(GESTURE_EVENTS)
    7576    virtual void doneWithGestureEvent(const WebKit::WebGestureEvent& event, bool wasEventHandled);
  • trunk/Source/WebKit2/UIProcess/PageClient.h

    r136075 r136126  
    128128    virtual void handleCertificateVerificationRequest(const String& hostname, bool& ignoreErrors) = 0;
    129129    virtual void handleProxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password) = 0;
     130    virtual void handleWillSetInputMethodState() = 0;
    130131#endif // PLATFORM(QT).
    131132
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r136095 r136126  
    896896
    897897    void editorStateChanged(const EditorState&);
     898#if PLATFORM(QT)
     899    void willSetInputMethodState();
     900#endif
    898901
    899902    // Back/Forward list management
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r136075 r136126  
    206206    DidChangeCompositionSelection(bool hasChanged)
    207207#endif
    208 
     208#if PLATFORM(QT)
     209    WillSetInputMethodState()
     210#endif
    209211    # Find messages
    210212    DidCountStringMatches(WTF::String string, uint32_t matchCount)
  • trunk/Source/WebKit2/UIProcess/qt/QtPageClient.cpp

    r130629 r136126  
    257257}
    258258
     259void QtPageClient::handleWillSetInputMethodState()
     260{
     261    ASSERT(m_eventHandler);
     262    m_eventHandler->handleWillSetInputMethodState();
     263}
     264
    259265#if ENABLE(GESTURE_EVENTS)
    260266void QtPageClient::doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled)
  • trunk/Source/WebKit2/UIProcess/qt/QtPageClient.h

    r130031 r136126  
    104104    virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
    105105    virtual void updateTextInputState();
     106    virtual void handleWillSetInputMethodState();
    106107    virtual void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled);
    107108#if ENABLE(TOUCH_EVENTS)
  • trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp

    r133153 r136126  
    436436}
    437437
     438void QtWebPageEventHandler::handleWillSetInputMethodState()
     439{
     440    if (qApp->inputMethod()->isVisible())
     441        qApp->inputMethod()->commit();
     442}
     443
    438444void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled)
    439445{
  • trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h

    r129496 r136126  
    9090#endif
    9191    void handleInputEvent(const QInputEvent*);
     92    void handleWillSetInputMethodState();
    9293    void resetGestureRecognizers();
    9394
  • trunk/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp

    r132228 r136126  
    172172}
    173173
     174void WebPageProxy::willSetInputMethodState()
     175{
     176    m_pageClient->handleWillSetInputMethodState();
     177}
     178
    174179} // namespace WebKit
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp

    r132032 r136126  
    470470void WebEditorClient::willSetInputMethodState()
    471471{
    472     notImplemented();
     472#if PLATFORM(QT)
     473    m_page->send(Messages::WebPageProxy::WillSetInputMethodState());
     474#else
     475    notImplemented();
     476#endif
    473477}
    474478
Note: See TracChangeset for help on using the changeset viewer.