Changeset 253881 in webkit


Ignore:
Timestamp:
Dec 23, 2019 1:19:50 AM (4 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK][WPE] Special combination characters doesn't respect the keystroke order when high CPU load
https://bugs.webkit.org/show_bug.cgi?id=185248

Reviewed by Žan Doberšek.

Source/WebCore:

Notify the editor when a key event handled by input method has been dispatched. This way we can handle the
composition results right after the event is dispatched.

  • editing/Editor.cpp:

(WebCore::Editor::didDispatchInputMethodKeydown): Notify the client.

  • editing/Editor.h:
  • page/EditorClient.h:

(WebCore::EditorClient::didDispatchInputMethodKeydown): Added.

  • page/EventHandler.cpp:

(WebCore::EventHandler::internalKeyEvent): Call Editor::didDispatchInputMethodKeydown() for events handled by
input method right after the event is dispatched.

  • platform/PlatformKeyboardEvent.h:

(WebCore::PlatformKeyboardEvent::preeditUnderlines const):
(WebCore::PlatformKeyboardEvent::preeditSelectionRangeStart const):
(WebCore::PlatformKeyboardEvent::preeditSelectionRangeLength const):

  • platform/gtk/PlatformKeyboardEventGtk.cpp:

(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Return early if the event was handled by input
method and remove the special case for Char events handled by input method because this is never called with
Char type for events handled by input method.

  • platform/libwpe/PlatformKeyboardEventLibWPE.cpp:

(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Return early if the event was handled by input
method.

Source/WebKit:

Key events are queued by the WebPageProxy so that the next event is not sent to the web process until the
previous one has been handled by the web process already. However, the composition results generated by key
events are sent to the web process using IPC messages when they happen. In case of high CPU load it can happen
that the composition results are sent to the web process even before the associated keys, that are still in the
queue waiting to be sent. We need to ensure that composition results are always processed right after its
associated key press event. So, instead of sending the results independently, we now include them as part of the
key event.

  • Shared/NativeWebKeyboardEvent.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor.
  • Shared/WebEvent.h:

(WebKit::WebKeyboardEvent::preeditUnderlines const): Return the optional preeditUnderlines.
(WebKit::WebKeyboardEvent::preeditSelectionRange const): Return the optional preeditSelectionRange.

  • Shared/WebEventConversion.cpp:

(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): Copy preeditUnderlines and
preeditSelectionRange too.

  • Shared/WebKeyboardEvent.cpp:

(WebKit::WebKeyboardEvent::WebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange
parameters and initialize them.
(WebKit::WebKeyboardEvent::encode const): Encode preeditUnderlines and preeditSelectionRange.
(WebKit::WebKeyboardEvent::decode): Decode preeditUnderlines and preeditSelectionRange.

  • Shared/gtk/NativeWebKeyboardEventGtk.cpp:

(WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and
preeditSelectionRange parameters and initialize them.

  • Shared/gtk/WebEventFactory.cpp:

(WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange
parameters and pass them to WebKeyboardEvent constructor.

  • Shared/gtk/WebEventFactory.h:
  • Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp:

(WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and
preeditSelectionRange parameters and initialize them.

  • Shared/libwpe/WebEventFactory.cpp:

(WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRang
parameters and pass them to WebKeyboardEvent constructor.

  • Shared/libwpe/WebEventFactory.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor.
  • UIProcess/API/glib/WebKitWebView.cpp:

(webkitWebViewSynthesizeCompositionKeyPress): Pass the preeditUnderlines and preeditSelectionRange to platform
implementation.
(webkitWebViewSetComposition): Remove the call to WebPageProxy::setComposition().
(webkitWebViewConfirmComposition): Remove the call to WebPageProxy::confirmComposition().
(webkitWebViewCancelComposition): Call WebPageProxy::cancelComposition();

  • UIProcess/API/gtk/WebKitWebViewBase.cpp:

(webkitWebViewBaseKeyPressEvent): Pass the preeditUnderlines and preeditSelectionRange to NativeWebKeyboardEvent constructor.
(webkitWebViewBaseKeyReleaseEvent): Ditto.
(webkitWebViewBaseSynthesizeCompositionKeyPress): Ditto.

  • UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
  • UIProcess/API/wpe/WPEView.cpp:

(WKWPE::View::handleKeyboardEvent): Ditto.
(WKWPE::View::synthesizeCompositionKeyPress): Ditto.

  • UIProcess/API/wpe/WPEView.h:
  • UIProcess/WebPageProxy.cpp:
  • UIProcess/WebPageProxy.h:
  • WebProcess/WebCoreSupport/WebEditorClient.h:
  • WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:

(WebKit::WebEditorClient::didDispatchInputMethodKeydown): Handle the composition results here, right after the
associated key events has been dispatched.

  • WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:

(WebKit::WebEditorClient::didDispatchInputMethodKeydown): Ditto.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::cancelComposition): Confirm the given string to cancel the composition.

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/WebPage.messages.in: Remove SetComposition message and rename ConfirmComposition as

CancelComposition since it's now only used for canceling.

Tools:

Remove the waits() that were added to work around this bug.

  • TestWebKitAPI/Tests/WebKitGLib/TestInputMethodContext.cpp:

(testWebKitInputMethodContextSequence):
(testWebKitInputMethodContextInvalidSequence):
(testWebKitInputMethodContextCancelSequence):
(testWebKitInputMethodContextReset):

Location:
trunk
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r253880 r253881  
     12019-12-23  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][WPE] Special combination characters doesn't respect the keystroke order when high CPU load
     4        https://bugs.webkit.org/show_bug.cgi?id=185248
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Notify the editor when a key event handled by input method has been dispatched. This way we can handle the
     9        composition results right after the event is dispatched.
     10
     11        * editing/Editor.cpp:
     12        (WebCore::Editor::didDispatchInputMethodKeydown): Notify the client.
     13        * editing/Editor.h:
     14        * page/EditorClient.h:
     15        (WebCore::EditorClient::didDispatchInputMethodKeydown): Added.
     16        * page/EventHandler.cpp:
     17        (WebCore::EventHandler::internalKeyEvent): Call Editor::didDispatchInputMethodKeydown() for events handled by
     18        input method right after the event is dispatched.
     19        * platform/PlatformKeyboardEvent.h:
     20        (WebCore::PlatformKeyboardEvent::preeditUnderlines const):
     21        (WebCore::PlatformKeyboardEvent::preeditSelectionRangeStart const):
     22        (WebCore::PlatformKeyboardEvent::preeditSelectionRangeLength const):
     23        * platform/gtk/PlatformKeyboardEventGtk.cpp:
     24        (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Return early if the event was handled by input
     25        method and remove the special case for Char events handled by input method because this is never called with
     26        Char type for events handled by input method.
     27        * platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
     28        (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Return early if the event was handled by input
     29        method.
     30
    1312019-12-22  Simon Fraser  <simon.fraser@apple.com>
    232
  • trunk/Source/WebCore/editing/Editor.cpp

    r249605 r253881  
    303303}
    304304
     305void Editor::didDispatchInputMethodKeydown(KeyboardEvent& event)
     306{
     307    if (auto* client = this->client())
     308        client->didDispatchInputMethodKeydown(event);
     309}
     310
    305311bool Editor::handleTextEvent(TextEvent& event)
    306312{
  • trunk/Source/WebCore/editing/Editor.h

    r249605 r253881  
    152152    void handleKeyboardEvent(KeyboardEvent&);
    153153    void handleInputMethodKeydown(KeyboardEvent&);
     154    void didDispatchInputMethodKeydown(KeyboardEvent&);
    154155    bool handleTextEvent(TextEvent&);
    155156
  • trunk/Source/WebCore/page/EditorClient.h

    r250365 r253881  
    122122    virtual void handleKeyboardEvent(KeyboardEvent&) = 0;
    123123    virtual void handleInputMethodKeydown(KeyboardEvent&) = 0;
     124    virtual void didDispatchInputMethodKeydown(KeyboardEvent&) { }
    124125   
    125126    virtual void textFieldDidBeginEditing(Element*) = 0;
  • trunk/Source/WebCore/page/EventHandler.cpp

    r253636 r253881  
    33583358
    33593359    element->dispatchEvent(keydown);
    3360     if (handledByInputMethod)
     3360    if (handledByInputMethod) {
     3361        m_frame.editor().didDispatchInputMethodKeydown(keydown.get());
    33613362        return true;
     3363    }
    33623364
    33633365    // If frame changed as a result of keydown dispatch, then return early to avoid sending a subsequent keypress message to the new frame.
  • trunk/Source/WebCore/platform/PlatformKeyboardEvent.h

    r253749 r253881  
    2727#pragma once
    2828
     29#include "CompositionUnderline.h"
    2930#include "KeypressCommand.h"
    3031#include "PlatformEvent.h"
     
    9798        bool handledByInputMethod() const { return m_handledByInputMethod; }
    9899#endif
     100#if PLATFORM(GTK) || USE(LIBWPE)
     101        const Optional<Vector<WebCore::CompositionUnderline>>& preeditUnderlines() const { return m_preeditUnderlines; }
     102        const Optional<uint64_t>& preeditSelectionRangeStart() const { return m_preeditSelectionRangeStart; }
     103        const Optional<uint64_t>& preeditSelectionRangeLength() const { return m_preeditSelectionRangeLength; }
     104#endif
    99105#if USE(APPKIT)
    100106        const Vector<KeypressCommand>& commands() const { return m_commands; }
     
    155161        bool m_handledByInputMethod { false };
    156162#endif
     163#if PLATFORM(GTK) || USE(LIBWPE)
     164        Optional<Vector<WebCore::CompositionUnderline>> m_preeditUnderlines;
     165        Optional<uint64_t> m_preeditSelectionRangeStart;
     166        Optional<uint64_t> m_preeditSelectionRangeLength;
     167#endif
    157168#if USE(APPKIT)
    158169        Vector<KeypressCommand> m_commands;
  • trunk/Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp

    r251650 r253881  
    13281328    m_type = type;
    13291329
    1330     if (backwardCompatibilityMode)
     1330    if (backwardCompatibilityMode || m_handledByInputMethod)
    13311331        return;
    13321332
    13331333    if (type == PlatformEvent::RawKeyDown) {
    1334         m_text = String();
    1335         m_unmodifiedText = String();
    1336     } else if (type == PlatformEvent::Char && m_handledByInputMethod) {
    1337         // Having empty text, prevents this Char (which is a DOM keypress) event
    1338         // from going to the DOM. Keys that trigger composition events should not
    1339         // fire keypress.
    13401334        m_text = String();
    13411335        m_unmodifiedText = String();
  • trunk/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp

    r248660 r253881  
    13211321    ASSERT(m_type == KeyDown);
    13221322    m_type = type;
    1323     if (backwardsCompatibility)
     1323    if (backwardsCompatibility || m_handledByInputMethod)
    13241324        return;
    13251325
  • trunk/Source/WebKit/ChangeLog

    r253880 r253881  
     12019-12-23  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][WPE] Special combination characters doesn't respect the keystroke order when high CPU load
     4        https://bugs.webkit.org/show_bug.cgi?id=185248
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Key events are queued by the WebPageProxy so that the next event is not sent to the web process until the
     9        previous one has been handled by the web process already. However, the composition results generated by key
     10        events are sent to the web process using IPC messages when they happen. In case of high CPU load it can happen
     11        that the composition results are sent to the web process even before the associated keys, that are still in the
     12        queue waiting to be sent. We need to ensure that composition results are always processed right after its
     13        associated key press event. So, instead of sending the results independently, we now include them as part of the
     14        key event.
     15
     16        * Shared/NativeWebKeyboardEvent.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor.
     17        * Shared/WebEvent.h:
     18        (WebKit::WebKeyboardEvent::preeditUnderlines const): Return the optional preeditUnderlines.
     19        (WebKit::WebKeyboardEvent::preeditSelectionRange const): Return the optional preeditSelectionRange.
     20        * Shared/WebEventConversion.cpp:
     21        (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): Copy preeditUnderlines and
     22        preeditSelectionRange too.
     23        * Shared/WebKeyboardEvent.cpp:
     24        (WebKit::WebKeyboardEvent::WebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange
     25        parameters and initialize them.
     26        (WebKit::WebKeyboardEvent::encode const): Encode preeditUnderlines and preeditSelectionRange.
     27        (WebKit::WebKeyboardEvent::decode): Decode preeditUnderlines and preeditSelectionRange.
     28        * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
     29        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and
     30        preeditSelectionRange parameters and initialize them.
     31        * Shared/gtk/WebEventFactory.cpp:
     32        (WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange
     33        parameters and pass them to WebKeyboardEvent constructor.
     34        * Shared/gtk/WebEventFactory.h:
     35        * Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp:
     36        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and
     37        preeditSelectionRange parameters and initialize them.
     38        * Shared/libwpe/WebEventFactory.cpp:
     39        (WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRang
     40        parameters and pass them to WebKeyboardEvent constructor.
     41        * Shared/libwpe/WebEventFactory.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor.
     42        * UIProcess/API/glib/WebKitWebView.cpp:
     43        (webkitWebViewSynthesizeCompositionKeyPress): Pass the preeditUnderlines and preeditSelectionRange to platform
     44        implementation.
     45        (webkitWebViewSetComposition): Remove the call to WebPageProxy::setComposition().
     46        (webkitWebViewConfirmComposition): Remove the call to WebPageProxy::confirmComposition().
     47        (webkitWebViewCancelComposition): Call WebPageProxy::cancelComposition();
     48        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
     49        (webkitWebViewBaseKeyPressEvent): Pass the preeditUnderlines and preeditSelectionRange to NativeWebKeyboardEvent constructor.
     50        (webkitWebViewBaseKeyReleaseEvent): Ditto.
     51        (webkitWebViewBaseSynthesizeCompositionKeyPress): Ditto.
     52        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
     53        * UIProcess/API/wpe/WPEView.cpp:
     54        (WKWPE::View::handleKeyboardEvent): Ditto.
     55        (WKWPE::View::synthesizeCompositionKeyPress): Ditto.
     56        * UIProcess/API/wpe/WPEView.h:
     57        * UIProcess/WebPageProxy.cpp:
     58        * UIProcess/WebPageProxy.h:
     59        * WebProcess/WebCoreSupport/WebEditorClient.h:
     60        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
     61        (WebKit::WebEditorClient::didDispatchInputMethodKeydown): Handle the composition results here, right after the
     62        associated key events has been dispatched.
     63        * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
     64        (WebKit::WebEditorClient::didDispatchInputMethodKeydown): Ditto.
     65        * WebProcess/WebPage/WebPage.cpp:
     66        (WebKit::WebPage::cancelComposition): Confirm the given string to cancel the composition.
     67        * WebProcess/WebPage/WebPage.h:
     68        * WebProcess/WebPage/WebPage.messages.in: Remove SetComposition message and rename ConfirmComposition as
     69        CancelComposition since it's now only used for canceling.
     70
    1712019-12-22  Simon Fraser  <simon.fraser@apple.com>
    272
  • trunk/Source/WebKit/Shared/NativeWebKeyboardEvent.h

    r253749 r253881  
    3737
    3838namespace WebCore {
     39struct CompositionUnderline;
    3940struct KeypressCommand;
    4041}
     
    6061
    6162namespace WebKit {
     63struct EditingRange;
    6264
    6365class NativeWebKeyboardEvent : public WebKeyboardEvent {
     
    6971    NativeWebKeyboardEvent(const NativeWebKeyboardEvent&);
    7072    enum class HandledByInputMethod : bool { No, Yes };
    71     NativeWebKeyboardEvent(GdkEvent*, const String&, HandledByInputMethod, Vector<String>&& commands);
     73    NativeWebKeyboardEvent(GdkEvent*, const String&, HandledByInputMethod, Optional<Vector<WebCore::CompositionUnderline>>&&, Optional<EditingRange>&&, Vector<String>&& commands);
    7274#elif PLATFORM(IOS_FAMILY)
    7375    enum class HandledByInputMethod : bool { No, Yes };
     
    7577#elif USE(LIBWPE)
    7678    enum class HandledByInputMethod : bool { No, Yes };
    77     NativeWebKeyboardEvent(struct wpe_input_keyboard_event*, const String&, HandledByInputMethod);
     79    NativeWebKeyboardEvent(struct wpe_input_keyboard_event*, const String&, HandledByInputMethod, Optional<Vector<WebCore::CompositionUnderline>>&&, Optional<EditingRange>&&);
    7880#elif PLATFORM(WIN)
    7981    NativeWebKeyboardEvent(HWND, UINT message, WPARAM, LPARAM, Vector<MSG>&& pendingCharEvents);
  • trunk/Source/WebKit/Shared/WebEvent.h

    r253749 r253881  
    3030// we can use them as the event type.
    3131
     32#include "EditingRange.h"
     33#include <WebCore/CompositionUnderline.h>
    3234#include <WebCore/FloatPoint.h>
    3335#include <WebCore/FloatSize.h>
     
    258260    WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>&, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<Modifier>, WallTime timestamp);
    259261#elif PLATFORM(GTK)
    260     WebKeyboardEvent(Type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Vector<String>&& commands, bool isKeypad, OptionSet<Modifier>, WallTime timestamp);
     262    WebKeyboardEvent(Type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Optional<Vector<WebCore::CompositionUnderline>>&&, Optional<EditingRange>&&, Vector<String>&& commands, bool isKeypad, OptionSet<Modifier>, WallTime timestamp);
    261263#elif PLATFORM(IOS_FAMILY)
    262264    WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<Modifier>, WallTime timestamp);
    263265#elif USE(LIBWPE)
    264     WebKeyboardEvent(Type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, bool isKeypad, OptionSet<Modifier>, WallTime timestamp);
     266    WebKeyboardEvent(Type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Optional<Vector<WebCore::CompositionUnderline>>&&, Optional<EditingRange>&&, bool isKeypad, OptionSet<Modifier>, WallTime timestamp);
    265267#else
    266268    WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<Modifier>, WallTime timestamp);
     
    278280    bool handledByInputMethod() const { return m_handledByInputMethod; }
    279281#endif
     282#if PLATFORM(GTK) || USE(LIBWPE)
     283    const Optional<Vector<WebCore::CompositionUnderline>>& preeditUnderlines() const { return m_preeditUnderlines; }
     284    const Optional<EditingRange>& preeditSelectionRange() const { return m_preeditSelectionRange; }
     285#endif
    280286#if USE(APPKIT)
    281287    const Vector<WebCore::KeypressCommand>& commands() const { return m_commands; }
     
    303309#if USE(APPKIT) || USE(UIKIT_KEYBOARD_ADDITIONS) || PLATFORM(GTK) || USE(LIBWPE)
    304310    bool m_handledByInputMethod;
     311#endif
     312#if PLATFORM(GTK) || USE(LIBWPE)
     313    Optional<Vector<WebCore::CompositionUnderline>> m_preeditUnderlines;
     314    Optional<EditingRange> m_preeditSelectionRange;
    305315#endif
    306316#if USE(APPKIT)
  • trunk/Source/WebKit/Shared/WebEventConversion.cpp

    r252936 r253881  
    218218        m_keyIdentifier = webEvent.keyIdentifier();
    219219        m_windowsVirtualKeyCode = webEvent.windowsVirtualKeyCode();
    220 #if USE(APPKIT) || USE(UIKIT_KEYBOARD_ADDITIONS) || PLATFORM(GTK)
     220#if USE(APPKIT) || USE(UIKIT_KEYBOARD_ADDITIONS) || PLATFORM(GTK) || USE(LIBWPE)
    221221        m_handledByInputMethod = webEvent.handledByInputMethod();
     222#endif
     223#if PLATFORM(GTK) || USE(LIBWPE)
     224        m_preeditUnderlines = webEvent.preeditUnderlines();
     225        if (auto preeditSelectionRange = webEvent.preeditSelectionRange()) {
     226            m_preeditSelectionRangeStart = preeditSelectionRange->location;
     227            m_preeditSelectionRangeLength = preeditSelectionRange->length;
     228        }
    222229#endif
    223230#if USE(APPKIT) || PLATFORM(GTK)
  • trunk/Source/WebKit/Shared/WebKeyboardEvent.cpp

    r253749 r253881  
    5959#elif PLATFORM(GTK)
    6060
    61 WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Vector<String>&& commands, bool isKeypad, OptionSet<Modifier> modifiers, WallTime timestamp)
     61WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Optional<Vector<WebCore::CompositionUnderline>>&& preeditUnderlines, Optional<EditingRange>&& preeditSelectionRange, Vector<String>&& commands, bool isKeypad, OptionSet<Modifier> modifiers, WallTime timestamp)
    6262    : WebEvent(type, modifiers, timestamp)
    6363    , m_text(text)
     
    7070    , m_macCharCode(0)
    7171    , m_handledByInputMethod(handledByInputMethod)
     72    , m_preeditUnderlines(WTFMove(preeditUnderlines))
     73    , m_preeditSelectionRange(WTFMove(preeditSelectionRange))
    7274    , m_commands(WTFMove(commands))
    7375    , m_isAutoRepeat(false)
     
    102104#elif USE(LIBWPE)
    103105
    104 WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, bool isKeypad, OptionSet<Modifier> modifiers, WallTime timestamp)
     106WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Optional<Vector<WebCore::CompositionUnderline>>&& preeditUnderlines, Optional<EditingRange>&& preeditSelectionRange, bool isKeypad, OptionSet<Modifier> modifiers, WallTime timestamp)
    105107    : WebEvent(type, modifiers, timestamp)
    106108    , m_text(text)
     
    113115    , m_macCharCode(0)
    114116    , m_handledByInputMethod(handledByInputMethod)
     117    , m_preeditUnderlines(WTFMove(preeditUnderlines))
     118    , m_preeditSelectionRange(WTFMove(preeditSelectionRange))
    115119    , m_isAutoRepeat(false)
    116120    , m_isKeypad(isKeypad)
     
    160164    encoder << m_handledByInputMethod;
    161165#endif
     166#if PLATFORM(GTK) || USE(LIBWPE)
     167    encoder << m_preeditUnderlines;
     168    encoder << m_preeditSelectionRange;
     169#endif
    162170#if USE(APPKIT) || PLATFORM(GTK)
    163171    encoder << m_commands;
     
    193201        return false;
    194202#endif
     203#if PLATFORM(GTK) || USE(LIBWPE)
     204    if (!decoder.decode(result.m_preeditUnderlines))
     205        return false;
     206    if (!decoder.decode(result.m_preeditSelectionRange))
     207        return false;
     208#endif
    195209#if USE(APPKIT) || PLATFORM(GTK)
    196210    if (!decoder.decode(result.m_commands))
  • trunk/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp

    r253749 r253881  
    3434namespace WebKit {
    3535
    36 NativeWebKeyboardEvent::NativeWebKeyboardEvent(GdkEvent* event, const String& text, HandledByInputMethod handledByInputMethod, Vector<String>&& commands)
    37     : WebKeyboardEvent(WebEventFactory::createWebKeyboardEvent(event, text, handledByInputMethod == HandledByInputMethod::Yes, WTFMove(commands)))
     36NativeWebKeyboardEvent::NativeWebKeyboardEvent(GdkEvent* event, const String& text, HandledByInputMethod handledByInputMethod, Optional<Vector<WebCore::CompositionUnderline>>&& preeditUnderlines, Optional<EditingRange>&& preeditSelectionRange, Vector<String>&& commands)
     37    : WebKeyboardEvent(WebEventFactory::createWebKeyboardEvent(event, text, handledByInputMethod == HandledByInputMethod::Yes, WTFMove(preeditUnderlines), WTFMove(preeditSelectionRange), WTFMove(commands)))
    3838    , m_nativeEvent(gdk_event_copy(event))
    3939{
     
    4141
    4242NativeWebKeyboardEvent::NativeWebKeyboardEvent(const NativeWebKeyboardEvent& event)
    43     : WebKeyboardEvent(WebEventFactory::createWebKeyboardEvent(event.nativeEvent(), event.text(), event.handledByInputMethod(), Vector<String>(event.commands())))
     43    : WebKeyboardEvent(WebEventFactory::createWebKeyboardEvent(event.nativeEvent(), event.text(), event.handledByInputMethod(), Optional<Vector<WebCore::CompositionUnderline>>(event.preeditUnderlines()), Optional<EditingRange>(event.preeditSelectionRange()), Vector<String>(event.commands())))
    4444    , m_nativeEvent(gdk_event_copy(event.nativeEvent()))
    4545{
  • trunk/Source/WebKit/Shared/gtk/WebEventFactory.cpp

    r252126 r253881  
    253253}
    254254
    255 WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(const GdkEvent* event, const String& text, bool handledByInputMethod, Vector<String>&& commands)
     255WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(const GdkEvent* event, const String& text, bool handledByInputMethod, Optional<Vector<CompositionUnderline>>&& preeditUnderlines, Optional<EditingRange>&& preeditSelectionRange, Vector<String>&& commands)
    256256{
    257257    guint keyval;
     
    270270        static_cast<int>(keyval),
    271271        handledByInputMethod,
     272        WTFMove(preeditUnderlines),
     273        WTFMove(preeditSelectionRange),
    272274        WTFMove(commands),
    273275        isGdkKeyCodeFromKeyPad(keyval),
  • trunk/Source/WebKit/Shared/gtk/WebEventFactory.h

    r252126 r253881  
    3838    static WebWheelEvent createWebWheelEvent(const GdkEvent*);
    3939    static WebWheelEvent createWebWheelEvent(const GdkEvent*, WebWheelEvent::Phase, WebWheelEvent::Phase momentumPhase);
    40     static WebKeyboardEvent createWebKeyboardEvent(const GdkEvent*, const String&, bool handledByInputMethod, Vector<String>&& commands);
     40    static WebKeyboardEvent createWebKeyboardEvent(const GdkEvent*, const String&, bool handledByInputMethod, Optional<Vector<WebCore::CompositionUnderline>>&&, Optional<EditingRange>&&, Vector<String>&& commands);
    4141#if ENABLE(TOUCH_EVENTS)
    4242    static WebTouchEvent createWebTouchEvent(const GdkEvent*, Vector<WebPlatformTouchPoint>&&);
  • trunk/Source/WebKit/Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp

    r253749 r253881  
    3131namespace WebKit {
    3232
    33 NativeWebKeyboardEvent::NativeWebKeyboardEvent(struct wpe_input_keyboard_event* event, const String& text, HandledByInputMethod handledByInputMethod)
    34     : WebKeyboardEvent(WebEventFactory::createWebKeyboardEvent(event, text, handledByInputMethod == HandledByInputMethod::Yes))
     33NativeWebKeyboardEvent::NativeWebKeyboardEvent(struct wpe_input_keyboard_event* event, const String& text, HandledByInputMethod handledByInputMethod, Optional<Vector<WebCore::CompositionUnderline>>&& preeditUnderlines, Optional<EditingRange>&& preeditSelectionRange)
     34    : WebKeyboardEvent(WebEventFactory::createWebKeyboardEvent(event, text, handledByInputMethod == HandledByInputMethod::Yes, WTFMove(preeditUnderlines), WTFMove(preeditSelectionRange)))
    3535{
    3636}
  • trunk/Source/WebKit/Shared/libwpe/WebEventFactory.cpp

    r253749 r253881  
    6363}
    6464
    65 WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(struct wpe_input_keyboard_event* event, const String& text, bool handledByInputMethod)
     65WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(struct wpe_input_keyboard_event* event, const String& text, bool handledByInputMethod, Optional<Vector<WebCore::CompositionUnderline>>&& preeditUnderlines, Optional<EditingRange>&& preeditSelectionRange)
    6666{
    6767    return WebKeyboardEvent(event->pressed ? WebEvent::KeyDown : WebEvent::KeyUp,
     
    7373        event->key_code,
    7474        handledByInputMethod,
     75        WTFMove(preeditUnderlines),
     76        WTFMove(preeditSelectionRange),
    7577        isWPEKeyCodeFromKeyPad(event->key_code),
    7678        modifiersForEventModifiers(event->modifiers),
  • trunk/Source/WebKit/Shared/libwpe/WebEventFactory.h

    r253749 r253881  
    3939class WebEventFactory {
    4040public:
    41     static WebKeyboardEvent createWebKeyboardEvent(struct wpe_input_keyboard_event*, const String&, bool handledByInputMethod);
     41    static WebKeyboardEvent createWebKeyboardEvent(struct wpe_input_keyboard_event*, const String&, bool handledByInputMethod, Optional<Vector<WebCore::CompositionUnderline>>&&, Optional<EditingRange>&&);
    4242    static WebMouseEvent createWebMouseEvent(struct wpe_input_pointer_event*, float deviceScaleFactor);
    4343    static WebWheelEvent createWebWheelEvent(struct wpe_input_axis_event*, float deviceScaleFactor);
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp

    r253749 r253881  
    26922692#endif
    26932693
    2694 static void webkitWebViewSynthesizeCompositionKeyPress(WebKitWebView* webView)
     2694static void webkitWebViewSynthesizeCompositionKeyPress(WebKitWebView* webView, const String& text, Optional<Vector<CompositionUnderline>>&& underlines, Optional<EditingRange>&& selectionRange)
    26952695{
    26962696#if PLATFORM(GTK)
    2697     webkitWebViewBaseSynthesizeCompositionKeyPress(WEBKIT_WEB_VIEW_BASE(webView));
     2697    webkitWebViewBaseSynthesizeCompositionKeyPress(WEBKIT_WEB_VIEW_BASE(webView), text, WTFMove(underlines), WTFMove(selectionRange));
    26982698#elif PLATFORM(WPE)
    2699     webView->priv->view->synthesizeCompositionKeyPress();
    2700 #endif
    2701 }
    2702 
    2703 void webkitWebViewSetComposition(WebKitWebView* webView, const String& text, const Vector<CompositionUnderline>& underlines, const EditingRange& selectionRange)
    2704 {
    2705     webkitWebViewSynthesizeCompositionKeyPress(webView);
    2706     getPage(webView).setComposition(text, underlines, selectionRange);
     2699    webView->priv->view->synthesizeCompositionKeyPress(text, WTFMove(underlines), WTFMove(selectionRange));
     2700#endif
     2701}
     2702
     2703void webkitWebViewSetComposition(WebKitWebView* webView, const String& text, const Vector<CompositionUnderline>& underlines, EditingRange&& selectionRange)
     2704{
     2705    webkitWebViewSynthesizeCompositionKeyPress(webView, text, underlines, WTFMove(selectionRange));
    27072706}
    27082707
    27092708void webkitWebViewConfirmComposition(WebKitWebView* webView, const String& text)
    27102709{
    2711     webkitWebViewSynthesizeCompositionKeyPress(webView);
    2712     getPage(webView).confirmComposition(text);
     2710    webkitWebViewSynthesizeCompositionKeyPress(webView, text, WTF::nullopt, WTF::nullopt);
    27132711}
    27142712
    27152713void webkitWebViewCancelComposition(WebKitWebView* webView, const String& text)
    27162714{
    2717     getPage(webView).confirmComposition(text);
     2715    getPage(webView).cancelComposition(text);
    27182716}
    27192717
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h

    r253749 r253881  
    113113#endif
    114114
    115 void webkitWebViewSetComposition(WebKitWebView*, const String&, const Vector<WebCore::CompositionUnderline>&, const WebKit::EditingRange&);
     115void webkitWebViewSetComposition(WebKitWebView*, const String&, const Vector<WebCore::CompositionUnderline>&, WebKit::EditingRange&&);
    116116void webkitWebViewConfirmComposition(WebKitWebView*, const String&);
    117117void webkitWebViewCancelComposition(WebKitWebView*, const String&);
  • trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp

    r253749 r253881  
    800800    if (!filterResult.handled) {
    801801        priv->pageProxy->handleKeyboardEvent(NativeWebKeyboardEvent(reinterpret_cast<GdkEvent*>(keyEvent), filterResult.keyText,
    802             NativeWebKeyboardEvent::HandledByInputMethod::No, priv->keyBindingTranslator.commandsForKeyEvent(keyEvent)));
     802            NativeWebKeyboardEvent::HandledByInputMethod::No, WTF::nullopt, WTF::nullopt, priv->keyBindingTranslator.commandsForKeyEvent(keyEvent)));
    803803    }
    804804
     
    818818    if (!priv->inputMethodFilter.filterKeyEvent(keyEvent).handled) {
    819819        priv->pageProxy->handleKeyboardEvent(NativeWebKeyboardEvent(reinterpret_cast<GdkEvent*>(keyEvent), { },
    820             NativeWebKeyboardEvent::HandledByInputMethod::No, { }));
     820            NativeWebKeyboardEvent::HandledByInputMethod::No, WTF::nullopt, WTF::nullopt, { }));
    821821    }
    822822
     
    19101910}
    19111911
    1912 void webkitWebViewBaseSynthesizeCompositionKeyPress(WebKitWebViewBase* webViewBase)
     1912void webkitWebViewBaseSynthesizeCompositionKeyPress(WebKitWebViewBase* webViewBase, const String& text, Optional<Vector<CompositionUnderline>>&& underlines, Optional<EditingRange>&& selectionRange)
    19131913{
    19141914    static GdkEvent* event = nullptr;
     
    19251925
    19261926    WebKitWebViewBasePrivate* priv = webViewBase->priv;
    1927     priv->pageProxy->handleKeyboardEvent(NativeWebKeyboardEvent(event, { }, NativeWebKeyboardEvent::HandledByInputMethod::Yes, { }));
    1928 }
     1927    priv->pageProxy->handleKeyboardEvent(NativeWebKeyboardEvent(event, text, NativeWebKeyboardEvent::HandledByInputMethod::Yes, WTFMove(underlines), WTFMove(selectionRange), { }));
     1928}
  • trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h

    r253749 r253881  
    3939#include "WebKitWebViewBase.h"
    4040#include "WebPageProxy.h"
     41#include <wtf/Optional.h>
    4142
    4243WebKitWebViewBase* webkitWebViewBaseCreate(const API::PageConfiguration&);
     
    109110void webkitWebViewBaseSetInputMethodContext(WebKitWebViewBase*, WebKitInputMethodContext*);
    110111WebKitInputMethodContext* webkitWebViewBaseGetInputMethodContext(WebKitWebViewBase*);
    111 void webkitWebViewBaseSynthesizeCompositionKeyPress(WebKitWebViewBase*);
     112void webkitWebViewBaseSynthesizeCompositionKeyPress(WebKitWebViewBase*, const String& text, Optional<Vector<WebCore::CompositionUnderline>>&&, Optional<WebKit::EditingRange>&&);
  • trunk/Source/WebKit/UIProcess/API/wpe/WPEView.cpp

    r253749 r253881  
    3030#include "APIViewClient.h"
    3131#include "DrawingAreaProxy.h"
     32#include "EditingRange.h"
    3233#include "EditorState.h"
    3334#include "NativeWebKeyboardEvent.h"
     
    3738#include "WebPageGroup.h"
    3839#include "WebProcessPool.h"
     40#include <WebCore/CompositionUnderline.h>
    3941#include <wpe/wpe.h>
    4042
     
    271273        return;
    272274
    273     page().handleKeyboardEvent(WebKit::NativeWebKeyboardEvent(event, event->pressed ? filterResult.keyText : String(), NativeWebKeyboardEvent::HandledByInputMethod::No));
    274 }
    275 
    276 void View::synthesizeCompositionKeyPress()
     275    page().handleKeyboardEvent(WebKit::NativeWebKeyboardEvent(event, event->pressed ? filterResult.keyText : String(), NativeWebKeyboardEvent::HandledByInputMethod::No, WTF::nullopt, WTF::nullopt));
     276}
     277
     278void View::synthesizeCompositionKeyPress(const String& text, Optional<Vector<WebCore::CompositionUnderline>>&& underlines, Optional<EditingRange>&& selectionRange)
    277279{
    278280    // The Windows composition key event code is 299 or VK_PROCESSKEY. We need to
     
    281283    // here to WebCore. PlatformKeyEvent converts this code into VK_PROCESSKEY.
    282284    static struct wpe_input_keyboard_event event = { 0, WPE_KEY_VoidSymbol, 0, true, 0 };
    283     page().handleKeyboardEvent(WebKit::NativeWebKeyboardEvent(&event, { }, NativeWebKeyboardEvent::HandledByInputMethod::Yes));
     285    page().handleKeyboardEvent(WebKit::NativeWebKeyboardEvent(&event, text, NativeWebKeyboardEvent::HandledByInputMethod::Yes, WTFMove(underlines), WTFMove(selectionRange)));
    284286}
    285287
  • trunk/Source/WebKit/UIProcess/API/wpe/WPEView.h

    r253749 r253881  
    4949}
    5050
     51namespace WebCore {
     52struct CompositionUnderline;
     53}
     54
    5155namespace WebKit {
    5256class DownloadProxy;
    5357class WebPageGroup;
    5458class WebProcessPool;
     59struct EditingRange;
    5560struct UserMessage;
    5661}
     
    7883    WebKitInputMethodContext* inputMethodContext() const;
    7984    void setInputMethodState(bool);
    80     void synthesizeCompositionKeyPress();
     85    void synthesizeCompositionKeyPress(const String&, Optional<Vector<WebCore::CompositionUnderline>>&&, Optional<WebKit::EditingRange>&&);
    8186
    8287    void selectionDidChange();
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r253749 r253881  
    81958195
    81968196#if PLATFORM(GTK) || PLATFORM(WPE)
    8197 void WebPageProxy::setComposition(const String& text, const Vector<CompositionUnderline>& underlines, const EditingRange& selectionRange)
    8198 {
    8199     // FIXME: We need to find out how to proper handle the crashes case.
    8200     if (!hasRunningProcess())
    8201         return;
    8202 
    8203     send(Messages::WebPage::SetComposition(text, underlines, selectionRange));
    8204 }
    8205 
    8206 void WebPageProxy::confirmComposition(const String& compositionString)
    8207 {
    8208     if (!hasRunningProcess())
    8209         return;
    8210 
    8211     send(Messages::WebPage::ConfirmComposition(compositionString));
     8197void WebPageProxy::cancelComposition(const String& compositionString)
     8198{
     8199    if (!hasRunningProcess())
     8200        return;
     8201
     8202    // Remove any pending composition key event.
     8203    if (m_keyEventQueue.size() > 1) {
     8204        auto event = m_keyEventQueue.takeFirst();
     8205        m_keyEventQueue.removeAllMatching([](const auto& event) {
     8206            return event.handledByInputMethod();
     8207        });
     8208        m_keyEventQueue.prepend(WTFMove(event));
     8209    }
     8210    send(Messages::WebPage::CancelComposition(compositionString));
    82128211}
    82138212#endif // PLATFORM(GTK)
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r253749 r253881  
    789789
    790790#if PLATFORM(GTK) || PLATFORM(WPE)
    791     void setComposition(const String&, const Vector<WebCore::CompositionUnderline>&, const EditingRange& selectionRange);
    792     void confirmComposition(const String& compositionString);
     791    void cancelComposition(const String& compositionString);
    793792
    794793    void setInputMethodState(bool enabled);
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h

    r250365 r253881  
    175175#endif
    176176
     177#if PLATFORM(GTK) || PLATFORM(WPE)
     178    void didDispatchInputMethodKeydown(WebCore::KeyboardEvent&) final;
     179#endif
     180
    177181#if PLATFORM(IOS_FAMILY)
    178182    void startDelayingAndCoalescingContentChangeNotifications() final;
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp

    r246596 r253881  
    140140}
    141141
     142void WebEditorClient::didDispatchInputMethodKeydown(KeyboardEvent& event)
     143{
     144    auto* platformEvent = event.underlyingPlatformEvent();
     145    ASSERT(event.target());
     146    auto* frame = downcast<Node>(event.target())->document().frame();
     147    ASSERT(frame);
     148
     149    if (const auto& underlines = platformEvent->preeditUnderlines()) {
     150        auto rangeStart = platformEvent->preeditSelectionRangeStart().valueOr(0);
     151        auto rangeLength = platformEvent->preeditSelectionRangeLength().valueOr(0);
     152        frame->editor().setComposition(platformEvent->text(), underlines.value(), rangeStart, rangeStart + rangeLength);
     153    } else
     154        frame->editor().confirmComposition(platformEvent->text());
     155}
     156
    142157void WebEditorClient::updateGlobalSelection(Frame* frame)
    143158{
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp

    r253749 r253881  
    242242}
    243243
     244void WebEditorClient::didDispatchInputMethodKeydown(KeyboardEvent& event)
     245{
     246    auto* platformEvent = event.underlyingPlatformEvent();
     247    ASSERT(event.target());
     248    auto* frame = downcast<Node>(event.target())->document().frame();
     249    ASSERT(frame);
     250
     251    if (const auto& underlines = platformEvent->preeditUnderlines()) {
     252        auto rangeStart = platformEvent->preeditSelectionRangeStart().valueOr(0);
     253        auto rangeLength = platformEvent->preeditSelectionRangeLength().valueOr(0);
     254        frame->editor().setComposition(platformEvent->text(), underlines.value(), rangeStart, rangeStart + rangeLength);
     255    } else
     256        frame->editor().confirmComposition(platformEvent->text());
     257}
     258
    244259} // namespace WebKit
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r253749 r253881  
    53535353}
    53545354
    5355 void WebPage::confirmComposition(const String& compositionString)
     5355void WebPage::cancelComposition(const String& compositionString)
    53565356{
    53575357    if (auto* targetFrame = targetFrameForEditing(*this))
    53585358        targetFrame->editor().confirmComposition(compositionString);
    5359 }
    5360 
    5361 void WebPage::setComposition(const String& text, const Vector<CompositionUnderline>& underlines, const EditingRange& selectionRange)
    5362 {
    5363     Frame* targetFrame = targetFrameForEditing(*this);
    5364     if (!targetFrame || !targetFrame->selection().selection().isContentEditable())
    5365         return;
    5366 
    5367     Ref<Frame> protector(*targetFrame);
    5368     targetFrame->editor().setComposition(text, underlines, selectionRange.location, selectionRange.location + selectionRange.length);
    53695359}
    53705360#endif
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r253749 r253881  
    779779
    780780#if PLATFORM(GTK) || PLATFORM(WPE)
    781     void setComposition(const String&, const Vector<WebCore::CompositionUnderline>&, const EditingRange& selectionRange);
    782     void confirmComposition(const String& text);
     781    void cancelComposition(const String& text);
    783782#endif
    784783
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in

    r253749 r253881  
    415415
    416416#if PLATFORM(GTK) || PLATFORM(WPE)
    417     SetComposition(String text, Vector<WebCore::CompositionUnderline> underlines, struct WebKit::EditingRange selectionRange)
    418     ConfirmComposition(String text)
     417    CancelComposition(String text)
    419418#endif
    420419
  • trunk/Tools/ChangeLog

    r253867 r253881  
     12019-12-23  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][WPE] Special combination characters doesn't respect the keystroke order when high CPU load
     4        https://bugs.webkit.org/show_bug.cgi?id=185248
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Remove the waits() that were added to work around this bug.
     9
     10        * TestWebKitAPI/Tests/WebKitGLib/TestInputMethodContext.cpp:
     11        (testWebKitInputMethodContextSequence):
     12        (testWebKitInputMethodContextInvalidSequence):
     13        (testWebKitInputMethodContextCancelSequence):
     14        (testWebKitInputMethodContextReset):
     15
    1162019-12-21  Yusuke Suzuki  <ysuzuki@apple.com>
    217
  • trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestInputMethodContext.cpp

    r253749 r253881  
    437437    g_assert_cmpstr(test->m_events[3].key.data(), ==, "w");
    438438    g_assert_true(test->m_events[3].isComposing);
    439     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    440439    test->m_events.clear();
    441440    test->keyStrokeAndWaitForEvents(KEY(g), 3);
     
    450449    g_assert_cmpstr(test->m_events[2].key.data(), ==, "g");
    451450    g_assert_true(test->m_events[2].isComposing);
    452     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    453451    test->m_events.clear();
    454452    test->keyStrokeAndWaitForEvents(KEY(t), 3);
     
    463461    g_assert_cmpstr(test->m_events[2].key.data(), ==, "t");
    464462    g_assert_true(test->m_events[2].isComposing);
    465     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    466463    test->m_events.clear();
    467464    test->keyStrokeAndWaitForEvents(KEY(k), 3);
     
    476473    g_assert_cmpstr(test->m_events[2].key.data(), ==, "k");
    477474    g_assert_true(test->m_events[2].isComposing);
    478     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    479475    test->m_events.clear();
    480476    test->keyStrokeAndWaitForEvents(KEY(ISO_Enter), 3);
     
    509505    g_assert_cmpstr(test->m_events[3].key.data(), ==, "w");
    510506    g_assert_true(test->m_events[3].isComposing);
    511     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    512507    test->m_events.clear();
    513508    test->keyStrokeAndWaitForEvents(KEY(w), 3);
     
    522517    g_assert_cmpstr(test->m_events[2].key.data(), ==, "w");
    523518    g_assert_true(test->m_events[2].isComposing);
    524     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    525519    test->m_events.clear();
    526520    test->keyStrokeAndWaitForEvents(KEY(p), 3);
     
    535529    g_assert_cmpstr(test->m_events[2].key.data(), ==, "p");
    536530    g_assert_true(test->m_events[2].isComposing);
    537     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    538531    test->m_events.clear();
    539532    test->keyStrokeAndWaitForEvents(KEY(e), 3);
     
    548541    g_assert_cmpstr(test->m_events[2].key.data(), ==, "e");
    549542    g_assert_true(test->m_events[2].isComposing);
    550     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    551543    test->m_events.clear();
    552544    test->keyStrokeAndWaitForEvents(KEY(space), 3);
     
    592584    g_assert_cmpstr(test->m_events[3].key.data(), ==, "w");
    593585    g_assert_true(test->m_events[3].isComposing);
    594     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    595586    test->m_events.clear();
    596587    test->keyStrokeAndWaitForEvents(KEY(w), 3);
     
    605596    g_assert_cmpstr(test->m_events[2].key.data(), ==, "w");
    606597    g_assert_true(test->m_events[2].isComposing);
    607     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    608598    test->m_events.clear();
    609599    test->keyStrokeAndWaitForEvents(KEY(space), 3);
     
    649639    g_assert_cmpstr(test->m_events[3].key.data(), ==, "w");
    650640    g_assert_true(test->m_events[3].isComposing);
    651     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    652641    test->m_events.clear();
    653642    test->keyStrokeAndWaitForEvents(KEY(Escape), 3);
     
    693682    g_assert_cmpstr(test->m_events[3].key.data(), ==, "w");
    694683    g_assert_true(test->m_events[3].isComposing);
    695     test->wait(0.1); // FIXME: this is a workaround for existing bug when key events are queued.
    696684    test->m_events.clear();
    697685    test->clickAndWaitForEvents(1);
Note: See TracChangeset for help on using the changeset viewer.