RESOLVED FIXED 78559
[EFL][DRT] Implement TextInputController.
https://bugs.webkit.org/show_bug.cgi?id=78559
Summary [EFL][DRT] Implement TextInputController.
Kangil Han
Reported 2012-02-13 17:51:28 PST
Add initial implementation for TextInputController on DRT.
Attachments
Patch (11.22 KB, patch)
2012-02-13 17:54 PST, Kangil Han
no flags
Patch (10.28 KB, patch)
2012-02-21 00:46 PST, Kangil Han
no flags
Patch (12.62 KB, patch)
2012-03-26 03:02 PDT, Kangil Han
no flags
patch (22.77 KB, patch)
2012-04-27 21:33 PDT, Kangil Han
no flags
patch (23.41 KB, patch)
2012-05-06 19:39 PDT, Kangil Han
no flags
patch (23.65 KB, patch)
2012-05-06 21:44 PDT, Kangil Han
no flags
Patch (23.73 KB, patch)
2012-05-08 16:58 PDT, Kangil Han
mrobinson: review+
Kangil Han
Comment 1 2012-02-13 17:54:25 PST
Hajime Morrita
Comment 2 2012-02-20 21:28:27 PST
Comment on attachment 126877 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126877&action=review > Tools/DumpRenderTree/efl/TextInputController.cpp:14 > + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of I guess you don't need to claim anything about Apple ;-) > Tools/DumpRenderTree/efl/TextInputController.cpp:40 > +static JSValueRef setMarkedTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) Typically we don't give argument names which are not used in the function. Some compiler actually complain about that. > Tools/DumpRenderTree/efl/TextInputController.h:14 > + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of Ditto for license.
Kangil Han
Comment 3 2012-02-21 00:46:17 PST
Kangil Han
Comment 4 2012-02-21 00:48:09 PST
Done and thank you for reviewing my patch! :) (In reply to comment #2) > (From update of attachment 126877 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=126877&action=review > > > Tools/DumpRenderTree/efl/TextInputController.cpp:14 > > + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of > > I guess you don't need to claim anything about Apple ;-) > > > Tools/DumpRenderTree/efl/TextInputController.cpp:40 > > +static JSValueRef setMarkedTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) > > Typically we don't give argument names which are not used in the function. > Some compiler actually complain about that. > > > Tools/DumpRenderTree/efl/TextInputController.h:14 > > + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of > > Ditto for license.
Kangil Han
Comment 5 2012-03-02 00:55:22 PST
I think we can replace TextInputController with internal API.
Hajime Morrita
Comment 6 2012-03-04 17:50:11 PST
Hi Kangil, thanks for caring this! (In reply to comment #5) > I think we can replace TextInputController with internal API. It depends. Some API is good fit for internals. But many of them needs its own API. These APIs are for emulating user input, especially IME. You can think this more like MockClient than Internals. I think having this implementation inside WebCoreTestSupport could be a great idea. But it should be different object from Internals. Anyway, thanks again to consider better design over existing one. TextInputController is an old resident on DRT world which needs some improvement.
Kangil Han
Comment 7 2012-03-26 03:02:03 PDT
Kangil Han
Comment 8 2012-03-26 03:05:57 PDT
This patch has excluded functions used in port specific test cases at this stage. IMHO, I shouldn't touch webview related implementations for port specific purposes.
Hajime Morrita
Comment 9 2012-03-26 21:37:51 PDT
It looks my last explanation was confused. I'm sorry about that. Now, I cannot understand the purpose of this change. Whole purpose of TextInputController is to - inspect platform's text input API state. For mac, it's NSTextInput, and to - emulate user text input against the platform's text input API. It's also NSTextInput on mac. Following this pattern, what you need is to invoke EFL's text input interface through TextInputController And this is required only if EFL port is going to implement EFL's (or some other underlying platform's) text input protocol. If EFL isn't going to support any text input protocol, it makes little sense to support TextInputController since it is designed to test that feature. You can just skip tests which exercise text input functionality. I know both GTK and Qt implement TextInputController in a similar way. But in my opinion, it's kinda autotelic. Having yet another fake implementation just for mocking TextInputController will be a pure waste. I think you can discuss, say, GTK fork and move their TextInputController with this WebCoreTestSupport version. Then you can employ it for EFL. By doing it, - we can avoid code duplication at least. - we can eliminate manual JS binding code. This will help both GTK and EFL port. Als, the class name would be MockTextInputController or something. It cannot be common for the reason.
Kangil Han
Comment 10 2012-03-26 21:53:30 PDT
Your point makes sense. I will discard this and make a patch for EFL only. (In reply to comment #9) > It looks my last explanation was confused. I'm sorry about that. > > Now, I cannot understand the purpose of this change. > Whole purpose of TextInputController is to > > - inspect platform's text input API state. For mac, it's NSTextInput, and to > - emulate user text input against the platform's text input API. It's also NSTextInput on mac. > > Following this pattern, what you need is to invoke EFL's text input interface through TextInputController > And this is required only if EFL port is going to implement EFL's (or some other underlying platform's) > text input protocol. > > If EFL isn't going to support any text input protocol, it makes little sense to support TextInputController > since it is designed to test that feature. You can just skip tests which exercise text input functionality. > > I know both GTK and Qt implement TextInputController in a similar way. > But in my opinion, it's kinda autotelic. > Having yet another fake implementation just for mocking TextInputController > will be a pure waste. > > I think you can discuss, say, GTK fork and move their TextInputController with this > WebCoreTestSupport version. Then you can employ it for EFL. > By doing it, > - we can avoid code duplication at least. > - we can eliminate manual JS binding code. > This will help both GTK and EFL port. > > Als, the class name would be MockTextInputController or something. > It cannot be common for the reason.
Kangil Han
Comment 11 2012-04-27 21:33:59 PDT
Kangil Han
Comment 12 2012-05-06 17:37:00 PDT
Dear Gyuyoung and rakuco, Could I please get informal review on this patch? Thanks!
Gyuyoung Kim
Comment 13 2012-05-06 18:05:37 PDT
Comment on attachment 139335 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=139335&action=review Basically, this patch move GTK's implementation to EFL port. So, it seems to me there is no critical issue. > LayoutTests/ChangeLog:8 > + Implemented textInputController for EFL DRT. I think this is unsufficient description for this patch. > Source/WebKit/efl/ChangeLog:8 > + Implemented textInputController for EFL DRT. ditto. > Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:643 > +{ Is it better to initialize start and length like gtk port ? I think we need to initialize start and length. http://trac.webkit.org/browser/trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp#L478 > Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:670 > + } Nit : Add an empty line to here. > Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:698 > +{ Add a condition to check if start and length variables are 0.
Kangil Han
Comment 14 2012-05-06 18:13:04 PDT
Thanks for the review Gyuyoung! I will be back with a new patch. ;)
Raphael Kubo da Costa (:rakuco)
Comment 15 2012-05-06 18:30:46 PDT
Comment on attachment 139335 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=139335&action=review I can't help much here because text editing is not an area I'm familiar with, and most of the patch seems to be common, boilerplate code. It'd be good if some reviewer who works on editing stuff could take a look at this before landing. > Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:623 > + String compositionString = String::fromUTF8(text); Could be const. > Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:629 > +bool DumpRenderTreeSupportEfl::hasComposition(Evas_Object* ewkView) ewkView, page and editor can be const in this method. > Tools/DumpRenderTree/efl/TextInputController.h:28 > +#ifndef TextInputController_h Nit: we generally separate the copyright header from the ifdef guards with an empty line.
Kangil Han
Comment 16 2012-05-06 19:39:07 PDT
Thanks for the review rakuco! I will also figure it out soon. :)
Kangil Han
Comment 17 2012-05-06 19:39:53 PDT
Gyuyoung Kim
Comment 18 2012-05-06 20:10:16 PDT
Need to rebase.
Kangil Han
Comment 19 2012-05-06 20:14:04 PDT
Working. :)
Kangil Han
Comment 20 2012-05-06 21:44:09 PDT
Kangil Han
Comment 21 2012-05-06 22:41:50 PDT
Rebase and build done. :)
Gyuyoung Kim
Comment 22 2012-05-07 01:34:05 PDT
Comment on attachment 140470 [details] patch I'm also not expert in this area. But, this patch copies GTK's implementation to EFL port. It looks this patch doesn't have critical problems and nits. So, looks fine to me for now. I think editor review or GTK reviewer can review this patch.
Kangil Han
Comment 23 2012-05-07 23:25:01 PDT
mrobinson : Could I please get your formal review on this patch? Thanks!
Martin Robinson
Comment 24 2012-05-08 11:20:06 PDT
Comment on attachment 140470 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=140470&action=review > LayoutTests/ChangeLog:4631 > +2012-04-27 Kangil Han <kangil.han@samsung.com> The ChangeLog didn't merge properly here. > Source/WebKit/efl/ChangeLog:173 > +2012-04-27 Kangil Han <kangil.han@samsung.com> Ditto. > Tools/ChangeLog:1658 > +2012-04-27 Kangil Han <kangil.han@samsung.com> Ditto.
Kangil Han
Comment 25 2012-05-08 16:43:43 PDT
gyuyoung : Could you please help me out to land this patch?
Kangil Han
Comment 26 2012-05-08 16:58:03 PDT
WebKit Review Bot
Comment 27 2012-05-08 18:31:58 PDT
Comment on attachment 140819 [details] Patch Clearing flags on attachment: 140819 Committed r116475: <http://trac.webkit.org/changeset/116475>
WebKit Review Bot
Comment 28 2012-05-08 18:32:04 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.