Changeset 120329 in webkit


Ignore:
Timestamp:
Jun 14, 2012 8:52:28 AM (12 years ago)
Author:
kling@webkit.org
Message:

Chinese IM receives incorrect/duplicated key events in text fields in webpages in Safari.
<http://webkit.org/b/89048>
<rdar://problem/11449702>

Reviewed by Darin Adler.

Send the DidReceiveEvent message with the DispatchMessageEvenWhenWaitingForSyncReply flag
for keyboard events. This ensures that it always arrives before the corresponding synchronous
InterpretQueuedKeyEvent message.

The problem was that we relied on DidReceiveEvent / InterpretQueuedKeyEvent always arriving in
the same order they were sent. This was not always true, since DidReceiveEvent (async) would
get deferred during an unrelated waitForSyncReply() whereas InterpretQueuedKeyEvent (sync)
gets dispatched right away.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::keyEvent):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r120305 r120329  
     12012-06-13  Andreas Kling  <kling@webkit.org>
     2
     3        Chinese IM receives incorrect/duplicated key events in text fields in webpages in Safari.
     4        <http://webkit.org/b/89048>
     5        <rdar://problem/11449702>
     6
     7        Reviewed by Darin Adler.
     8
     9        Send the DidReceiveEvent message with the DispatchMessageEvenWhenWaitingForSyncReply flag
     10        for keyboard events. This ensures that it always arrives before the corresponding synchronous
     11        InterpretQueuedKeyEvent message.
     12
     13        The problem was that we relied on DidReceiveEvent / InterpretQueuedKeyEvent always arriving in
     14        the same order they were sent. This was not always true, since DidReceiveEvent (async) would
     15        get deferred during an unrelated waitForSyncReply() whereas InterpretQueuedKeyEvent (sync)
     16        gets dispatched right away.
     17
     18        * WebProcess/WebPage/WebPage.cpp:
     19        (WebKit::WebPage::keyEvent):
     20
    1212012-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
    222
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r119975 r120329  
    14241424        handled = performDefaultBehaviorForKeyEvent(keyboardEvent);
    14251425
    1426     send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(keyboardEvent.type()), handled));
     1426    // The receiving end relies on DidReceiveEvent and InterpretQueuedKeyEvent arriving in the same order they are sent
     1427    // (for keyboard events.) We set the DispatchMessageEvenWhenWaitingForSyncReply flag to ensure consistent ordering.
     1428    connection()->send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(keyboardEvent.type()), handled), m_pageID, CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply);
    14271429}
    14281430
Note: See TracChangeset for help on using the changeset viewer.