Bug 65264 - kNPEventStartIME doesn't work correctly for NPAPI
Summary: kNPEventStartIME doesn't work correctly for NPAPI
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.6
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-07-27 09:27 PDT by Bill Appleton
Modified: 2011-08-25 18:02 PDT (History)
6 users (show)

See Also:


Attachments
Patch (7.45 KB, patch)
2011-08-25 17:59 PDT, Anders Carlsson
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Appleton 2011-07-27 09:27:02 PDT
On Safari, typing the "g" key will generate a (1) key down event and then (2) a key up event with no call to NPCocoaEventTextInput 

--> this is wrong because i used the kNPEventStartIME flag, see FireFox behavior below

On Safari, typing "option-e" and then "e" will generate (1) key up event and then (2) a NPCocoaEventTextInput event with "accented e", and then (3) a key up event

--> this is wrong because there is a strange key up event sent at first, see FireFox behavior below

Based on my understanding of the spec Safari or webkit is implementing this incorrectly

https://wiki.mozilla.org/NPAPI:CocoaEventModel

On FireFox, typing the "g" key will generate a (1) key down event and then (2) a NPCocoaEventTextInput with "g" and then NO key up event
On FireFox, typing "option-e" and then "e" will generate (1) key down event, (2) a NPCocoaEventTextInput event with "accented e" and then NO key up event
Comment 1 Bill Appleton 2011-08-04 11:08:51 PDT
This is a serious bug because:

1) on a simple key press the NPCocoaEventTextInput event is NOT sent at all.

2) on multiple key presses for composite characters a key up event (?) is sent on the first key down.

3) the spec on this is quite clear, and Safari and/or WebKit is not in compliance.

We are very uncertain how to correctly receive Unicode text events in a situation like this. We could remap the incorrect events that are received as a special case in Safari, but this might break at a future date.
Comment 2 Bill Appleton 2011-08-09 13:49:41 PDT
Here is a test app to show this bug:

http://www.dreamfactory.com/projects/keytester.html

This will list out the keydown, keyup, and keydata (unicode) events that are generated.

Try it in FireFox, the events follow the spec, try it in Safari, strange events are happening.


Best,

Bill
Comment 3 Rudi Sherry 2011-08-15 16:16:07 PDT
This is serious for us too.  We will be forced to do most of our IME and other text input testing with Firefox until this is fixed, and won't be able to guarantee support for Safari until some time after this is fixed.
Comment 4 Maciej Stachowiak 2011-08-25 10:38:17 PDT
<rdar://problem/9996476>
Comment 5 Anders Carlsson 2011-08-25 17:59:04 PDT
Created attachment 105287 [details]
Patch
Comment 6 Anders Carlsson 2011-08-25 18:02:29 PDT
Committed r93845: <http://trac.webkit.org/changeset/93845>