NPAPI:CocoaCompositionClarification: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 5: | Line 5: | ||
= Contributors = | = Contributors = | ||
* Last modified: | * Last modified: January 5, 2011 | ||
* Authors: Josh Aas (Mozilla) | * Authors: Josh Aas (Mozilla) | ||
* Contributors: Stuart Morgan (Google) | * Contributors: Stuart Morgan (Google) | ||
Line 11: | Line 11: | ||
= Overview = | = Overview = | ||
This proposal modifies the existing Cocoa NPAPI specification ([[NPAPI:CocoaEventModel]]). | This proposal modifies the existing Cocoa NPAPI specification ([[NPAPI:CocoaEventModel]]). Under the current specification plugins receive key events during complex text composition but do not have a reliable way to know whether or not key events are intended for use in the composition. Since composition can be canceled by the user or the browser plugins cannot assume that composition is in progress until they receive an 'NPCocoaEventTextInput' event. | ||
= Specification Change = | = Specification Change = | ||
Upcoming... | |||
= Open Questions = | = Open Questions = | ||
Line 21: | Line 21: | ||
<ul> | <ul> | ||
<li> An alternative solution would be to specify that once composition is started it will always result in an 'NPCocoaEventTextInput' event and canceled compositions will simply result in an 'NPCocoaEventTextInput' event with an empty string. Unlike the currently proposed solution this has the downside of potential backwards-compatibility issues. Adobe Flash? | <li> An alternative solution would be to specify that once composition is started it will always result in an 'NPCocoaEventTextInput' event and canceled compositions will simply result in an 'NPCocoaEventTextInput' event with an empty string. Unlike the currently proposed solution this has the downside of potential backwards-compatibility issues. Adobe Flash? | ||
<li> Another alternative: In order to provide the plugin with information about whether or not there is a complex text composition in progress we will bump the 'NPCocoaEvent' version to '2'. If a plugin receives an 'NPCocoaEvent' with a version of '2' or higher then the key structure will contain a field of type 'NPBool' called 'compositionInProgress'. The 'compositionInProgress' field is only valid for 'NPCocoaEventKeyDown' events. It will be set to false when no composition is in progress and true when a composition is in progress. | |||
</ul> | </ul> |
Revision as of 13:29, 5 January 2011
Status
Under consideration.
Contributors
- Last modified: January 5, 2011
- Authors: Josh Aas (Mozilla)
- Contributors: Stuart Morgan (Google)
Overview
This proposal modifies the existing Cocoa NPAPI specification (NPAPI:CocoaEventModel). Under the current specification plugins receive key events during complex text composition but do not have a reliable way to know whether or not key events are intended for use in the composition. Since composition can be canceled by the user or the browser plugins cannot assume that composition is in progress until they receive an 'NPCocoaEventTextInput' event.
Specification Change
Upcoming...
Open Questions
- An alternative solution would be to specify that once composition is started it will always result in an 'NPCocoaEventTextInput' event and canceled compositions will simply result in an 'NPCocoaEventTextInput' event with an empty string. Unlike the currently proposed solution this has the downside of potential backwards-compatibility issues. Adobe Flash?
- Another alternative: In order to provide the plugin with information about whether or not there is a complex text composition in progress we will bump the 'NPCocoaEvent' version to '2'. If a plugin receives an 'NPCocoaEvent' with a version of '2' or higher then the key structure will contain a field of type 'NPBool' called 'compositionInProgress'. The 'compositionInProgress' field is only valid for 'NPCocoaEventKeyDown' events. It will be set to false when no composition is in progress and true when a composition is in progress.