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
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.
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
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.
<rdar://problem/9996476>
Created attachment 105287 [details] Patch
Committed r93845: <http://trac.webkit.org/changeset/93845>