Bug 104196 - Adding New WebInputEvent type for IME events
Summary: Adding New WebInputEvent type for IME events
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Android Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-05 17:46 PST by Aurimas Liutikas
Modified: 2012-12-06 12:41 PST (History)
9 users (show)

See Also:


Attachments
Patch (4.87 KB, patch)
2012-12-05 17:50 PST, Aurimas Liutikas
no flags Details | Formatted Diff | Diff
Patch (4.64 KB, patch)
2012-12-05 18:22 PST, Aurimas Liutikas
jamesr: review-
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aurimas Liutikas 2012-12-05 17:46:04 PST
Adding New WebInputEvent type for IME events
Comment 1 Aurimas Liutikas 2012-12-05 17:50:27 PST
Created attachment 177889 [details]
Patch
Comment 2 Aurimas Liutikas 2012-12-05 17:52:46 PST
Adding new WebInputEvent type for IME events. This will be used to
send IME events through the same path as WebKeyboardEvents, thus
solving out-of-order issues for Android using multi-thread compositing.
More bug info: crbug.com/164470
Comment 3 WebKit Review Bot 2012-12-05 17:56:15 PST
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 4 WebKit Review Bot 2012-12-05 17:56:34 PST
Attachment 177889 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/chromium/ChangeLog', u'Sourc..." exit_code: 1
Source/WebKit/chromium/src/android/WebInputEventFactory.cpp:72:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/src/android/WebInputEventFactory.cpp:73:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/src/android/WebInputEventFactory.cpp:74:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/public/android/WebInputEventFactory.h:64:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/public/android/WebInputEventFactory.h:65:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/public/android/WebInputEventFactory.h:66:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 6 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Aurimas Liutikas 2012-12-05 18:22:07 PST
Created attachment 177901 [details]
Patch
Comment 6 WebKit Review Bot 2012-12-05 19:46:43 PST
Comment on attachment 177901 [details]
Patch

Attachment 177901 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15157614
Comment 7 Peter Beverloo (cr-android ews) 2012-12-05 20:27:44 PST
Comment on attachment 177901 [details]
Patch

Attachment 177901 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/15157629
Comment 8 James Robinson 2012-12-05 21:55:16 PST
Comment on attachment 177901 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=177901&action=review

> Source/WebKit/chromium/public/WebInputEvent.h:313
> +    // Caps on string lengths so we can make them static arrays and keep
> +    // them PODs.
> +    static const size_t textLengthCap = 400;
> +
> +    // |text| is the text that needs to be composed, committed, or replaced.
> +    WebUChar text[textLengthCap];

WebInputEvents are assumed to be POD and to be *cheap* to copy.  Making some be 800 bytes long seems contrary to this goal.
Comment 9 James Robinson 2012-12-05 21:56:31 PST
Are IME events ACK'd?

I think this is a problem we need to solve on the chromium side.
Comment 10 Min Qin 2012-12-06 10:32:29 PST
(In reply to comment #9)
> Are IME events ACK'd?
> 
> I think this is a problem we need to solve on the chromium side.


They are not ACKed currently.
Even for keyboard event, I believe chromium never actually rely on the ACK as chromium batch sends all the keyevents without waiting for the previous ACK.
Comment 11 Darin Fisher (:fishd, Google) 2012-12-06 11:18:20 PST
As part of this change, I'd like to understand what is happening to the old way to inputting IME events.  It looks like these events are intended to obsolete WebWidget::{setComposition,confirmComposition} and so on.  What is the grand plan?
Comment 12 Min Qin 2012-12-06 11:34:57 PST
(In reply to comment #8)
> (From update of attachment 177901 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=177901&action=review
> 
> > Source/WebKit/chromium/public/WebInputEvent.h:313
> > +    // Caps on string lengths so we can make them static arrays and keep
> > +    // them PODs.
> > +    static const size_t textLengthCap = 400;
> > +
> > +    // |text| is the text that needs to be composed, committed, or replaced.
> > +    WebUChar text[textLengthCap];
> 
> WebInputEvents are assumed to be POD and to be *cheap* to copy.  Making some be 800 bytes long seems contrary to this goal.


I think we can make WebImeEvents relatively small by adding the text to ViewMsg_HandleInputEvent. 
The ViewMsg_HandleInputEvent containing a WebImeEvent may not be passed to the compositor thread, but they will stay in the message queue in input_event_filter. And when the queue is empty or a previous event get acked, we will pass all the following WebImeEvent to the render thread.
Comment 13 Darin Fisher (:fishd, Google) 2012-12-06 11:46:26 PST
JamesR and I discussed this a bit more, and now I understand better.  You don't need to extend WebInputEvent.  You just need the IME related IPC messages to follow the same "stream" as WebInputEvents.  That can be done without modifying WebInputEvent.  Take a look at how ViewMsg_HandleInputEvent gets routed / queued / etc. on the Chromium side, and mimic that for IME related IPC messages.
Comment 14 Min Qin 2012-12-06 12:41:56 PST
(In reply to comment #13)
> JamesR and I discussed this a bit more, and now I understand better.  You don't need to extend WebInputEvent.  You just need the IME related IPC messages to follow the same "stream" as WebInputEvents.  That can be done without modifying WebInputEvent.  Take a look at how ViewMsg_HandleInputEvent gets routed / queued / etc. on the Chromium side, and mimic that for IME related IPC messages.

Makes sense, just add another ViewMsg_HandleImeEvent message type and queue it up in the input_event_filter before passing it to the render thread.