Cocoa NPAPI IME spec modification proposal

Josh Aas josh at mozilla.com
Thu Apr 29 16:18:26 PDT 2010


I'd like to propose a change to the Cocoa NPAPI IME input spec. The biggest problem we have with it is that it defines a second, inconsistent meaning for returning "0" from NPP_HandleEvent. Aside from being confusing, it prevents proper key handling in the future via the existing Advanced Key Handling spec.

I'd like to propose that we change the spec to have a return value of "2" start IME input. We would add the following general constants to make this clear:

int16_t kNPEventNotHandled = 0;
int16_t kNPEventHandled = 1;
int16_t kNPEventStartIME = 2;

The first two constants could be used for any case where NPP_HandleEvent returns handled status, the IME constant would only be used in event models that give it meaning. This also has the benefit of gracefully failing for plugins that implement the original IME spec - returning 0 to start IME would simply do nothing. This is also consistent with the existing handling of scroll events and the existing Advanced Key Handling spec.

There are no major plugins that use Cocoa NPAPI IME at this time, and currently shipping versions of WebKit do not properly implement the spec. Neither Gecko nor Chromium have implemented it yet. This being the case, changing the spec now should have a minimal impact. There will be some confusion, mostly from versions of Safari that implement the original spec, but I think having consistent meanings for 0 and 1 as return values for NPP_HandlEvent is important and will reduce pain in the long run.

--
Josh Aas
Software Engineer
Mozilla Corporation


More information about the plugin-futures mailing list