NPAPI:CocoaCompositionClarification: Difference between revisions

 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Status =
= Status =


Under consideration.
Accepted, ready for implementation.


= Contributors =
= Contributors =


* Last modified: January 6, 2011
* Last modified: January 18, 2011
* Authors: Josh Aas (Mozilla)
* Authors: Josh Aas (Mozilla)
* Contributors: Stuart Morgan (Google)
* Contributors: Stuart Morgan (Google)
Line 15: Line 15:
= Specification Change =
= Specification Change =


The specification currently states, in the "Text Input" section:
The original "Text Input" section stated:


"During complex text input the browser will continue to send regular key events. So long as the plugin still wants complex text input (which may result in a NPCocoaEventTextInput event being sent) it should continue to return kNPEventStartIME for NPCocoaEventKeyDown. If a plugin returns anything other than kNPEventStartIME for NPCocoaEventKeyDown then complex text input will be canceled."
"During complex text input the browser will continue to send regular key events. So long as the plugin still wants complex text input (which may result in a NPCocoaEventTextInput event being sent) it should continue to return kNPEventStartIME for NPCocoaEventKeyDown. If a plugin returns anything other than kNPEventStartIME for NPCocoaEventKeyDown then complex text input will be canceled."


This paragraph will be changed to:
This has been changed. See the current "Text Input" section of the [[NPAPI:CocoaEventModel|Cocoa event model spec]] for the updated version.
 
"No <code>NPCocoaEventKeyDown</code> or <code>NPCocoaEventKeyUp</code> events will be sent to the plugin during composition. <code>NPCocoaEventFlagsChanged</code> events will still be sent. Browser implementers should be mindful of the edge case where a key down ends composition (for example, the <code>return</code> key when an input window is in use) - the subsequent key up event is considered to be associated with the composition and should not be sent to the plugin."
 
The variable "NPNVsupportsUpdatedCocoaInput" (bool value) will indicate whether a browser supports this updated specification or not.
 
= Open Questions =
 
* None
 
= Alternatives =
 
Preserved for reference...
 
<ul>
<li> 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> 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>
Confirmed users, Bureaucrats and Sysops emeriti
1,680

edits