NPAPI:CocoaCompositionClarification: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
 
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 <code>NPNVsupportsUpdatedCocoaTextInputBool</code> (NPNVariable = 3002) will indicate whether a browser supports this updated specification or not. If this is not defined and true then text input behavior will vary between browsers.

Latest revision as of 23:59, 20 January 2011

Status

Accepted, ready for implementation.

Contributors

  • Last modified: January 18, 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

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."

This has been changed. See the current "Text Input" section of the Cocoa event model spec for the updated version.