Bug 62802 - [GTK] Fix typos in PageClientImpl::getEditorCommandsForKeyEvent()
Summary: [GTK] Fix typos in PageClientImpl::getEditorCommandsForKeyEvent()
Status: RESOLVED DUPLICATE of bug 63081
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2011-06-16 10:02 PDT by Carlos Garcia Campos
Modified: 2011-07-06 20:53 PDT (History)
1 user (show)

See Also:


Attachments
Patch (6.62 KB, patch)
2011-06-16 10:47 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
New patch (1.53 KB, patch)
2011-06-24 05:25 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 2011-06-16 10:02:16 PDT
There are two typos there, one in the assert command that makes the build fail with --enable-debug and another one in the line to get the the even type.
Comment 1 Carlos Garcia Campos 2011-06-16 10:47:11 PDT
Created attachment 97461 [details]
Patch

It also renames KeyPress as KeyUp since it's confusing to have KeyDown and KeyPress, I would use KeyPress/KeyRelease or KeyDown/KeyUp
Comment 2 Martin Robinson 2011-06-16 10:50:51 PDT
Comment on attachment 97461 [details]
Patch

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

> Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp:62
> +    ASSERT(event.type() == WebEvent::KeyDown || event.type() == WebEvent::KeyUp);
> +    KeyBindingTranslator::EventType type = event.type() == WebEvent::KeyDown ?
> +        KeyBindingTranslator::KeyDown : KeyBindingTranslator::KeyUp;
>      m_keyBindingTranslator.getEditorCommandsForKeyEvent(const_cast<GdkEventKey*>(&event.nativeEvent()->key), type, commandList);

The typo fix looks good, but a  WebEvent::KeyDown and a WebEvent.KeyPress event are two very different things.
Comment 3 Carlos Garcia Campos 2011-06-16 11:16:15 PDT
Comment on attachment 97461 [details]
Patch

Clearing flags, martin explained to me that keypress and keyup are actually two different things.
Comment 4 Carlos Garcia Campos 2011-06-24 05:25:20 PDT
Created attachment 98487 [details]
New patch

Looking at http://trac.webkit.org/browser/trunk/Source/WebCore/dom/KeyboardEvent.cpp#L37 it seems KeyPress is WebEvent::Char.
Comment 5 Martin Robinson 2011-06-24 06:56:29 PDT
Comment on attachment 98487 [details]
New patch

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

> Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp:61
> +    ASSERT(event.type() == WebEvent::KeyDown || event.type() == WebEvent::Char);
> +    KeyBindingTranslator::EventType type = event.type() == WebEvent::KeyDown ?

I'm not sure I understand here when we generate char events on the UIProcess side and why they map to KeyDown DOM events.
Comment 6 Martin Robinson 2011-07-04 08:50:07 PDT
Dupe of https://bugs.webkit.org/show_bug.cgi?id=63081 now?
Comment 7 Carlos Garcia Campos 2011-07-05 23:56:55 PDT

*** This bug has been marked as a duplicate of bug 63081 ***
Comment 8 Daniel Bates 2011-07-06 20:53:27 PDT
Comment on attachment 98487 [details]
New patch

Clearing review flag to get this out of the review queue since this bug was marked as a duplicate of bug #63081. At the time of writing, bug #63081 has a patch up for review.