Bug 203149 - [GTK] Simplify the Input Method implementation
Summary: [GTK] Simplify the Input Method implementation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2019-10-18 03:44 PDT by Carlos Garcia Campos
Modified: 2019-10-28 02:25 PDT (History)
11 users (show)

See Also:


Attachments
Patch (41.11 KB, patch)
2019-10-18 03:54 PDT, Carlos Garcia Campos
aperez: review+
Details | Formatted Diff | Diff
Patch for landing (41.22 KB, patch)
2019-10-28 02:15 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2019-10-18 03:44:52 PDT
There's some dead code to remove and some things that can be simplified.
Comment 1 Carlos Garcia Campos 2019-10-18 03:54:32 PDT
Created attachment 381294 [details]
Patch
Comment 2 EWS Watchlist 2019-10-18 03:55:22 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Adrian Perez 2019-10-22 04:29:58 PDT
Comment on attachment 381294 [details]
Patch

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

It's definitely pleasant to see this code being simplified, thanks
a lot. The patch looks good overall, with a couple of small comments,
which you may want to address before landing :] 

> Source/WebCore/platform/PlatformKeyboardEvent.h:43
>  #if PLATFORM(GTK)

This whole #if block can be removed, because there are no more uses
of GdkEventKey left.

> Source/WebKit/UIProcess/gtk/InputMethodFilter.h:42
> +    enum class EventFakedForComposition {

You could use

  enum class EventFakedForComposition : bool { No, Yes};

as you have used elsewhere in the patch.

> Source/WebKit/UIProcess/gtk/InputMethodFilter.h:46
> +    enum class EventHandledByInputMethod {

Ditto.
Comment 4 Carlos Garcia Campos 2019-10-23 00:35:58 PDT
(In reply to Adrian Perez from comment #3)
> Comment on attachment 381294 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=381294&action=review
> 
> It's definitely pleasant to see this code being simplified, thanks
> a lot. The patch looks good overall, with a couple of small comments,
> which you may want to address before landing :] 

Sure, thanks!

> > Source/WebCore/platform/PlatformKeyboardEvent.h:43
> >  #if PLATFORM(GTK)
> 
> This whole #if block can be removed, because there are no more uses
> of GdkEventKey left.

Indeed.

> > Source/WebKit/UIProcess/gtk/InputMethodFilter.h:42
> > +    enum class EventFakedForComposition {
> 
> You could use
> 
>   enum class EventFakedForComposition : bool { No, Yes};
> 
> as you have used elsewhere in the patch.
> 
> > Source/WebKit/UIProcess/gtk/InputMethodFilter.h:46
> > +    enum class EventHandledByInputMethod {
> 
> Ditto.

Yes, I didn't do that because I'm going to remove that enum in the next patch.
Comment 5 Adrian Perez 2019-10-23 02:18:13 PDT
(In reply to Carlos Garcia Campos from comment #4)
> (In reply to Adrian Perez from comment #3)
> > Comment on attachment 381294 [details]
> >
> > > [...]
> > >
> > > Source/WebKit/UIProcess/gtk/InputMethodFilter.h:42
> > > +    enum class EventFakedForComposition {
> > 
> > You could use
> > 
> >   enum class EventFakedForComposition : bool { No, Yes};
> > 
> > [...]
> 
> Yes, I didn't do that because I'm going to remove that enum in the next
> patch.

That sounds even better ;-)
Comment 6 Carlos Garcia Campos 2019-10-28 02:15:50 PDT
Created attachment 382051 [details]
Patch for landing
Comment 7 Carlos Garcia Campos 2019-10-28 02:25:04 PDT
Committed r251650: <https://trac.webkit.org/changeset/251650>