NPAPI:AdvancedKeyHandling: Difference between revisions

m
→‎Overview: Fix typo: s/participate and/participate in/
m (→‎Overview: Fix typo: s/participate and/participate in/)
 
(8 intermediate revisions by 2 users not shown)
Line 9: Line 9:
* Contributors: Johnny Stenback (Mozilla), Aaron Leventhal (IBM), Oliver Yeoh (Sun), Danielle Pham (Sun), Deneb Meketa (Adobe), Anders Carlsson (Apple), Michelle Sintov (Adobe), Karl Tomlinson (Mozilla)
* Contributors: Johnny Stenback (Mozilla), Aaron Leventhal (IBM), Oliver Yeoh (Sun), Danielle Pham (Sun), Deneb Meketa (Adobe), Anders Carlsson (Apple), Michelle Sintov (Adobe), Karl Tomlinson (Mozilla)


= Problem Summary =
= Overview =


# Plugins eat all key events when focused, Gecko does not get a chance to process anything. This is [https://bugzilla.mozilla.org/show_bug.cgi?id=78414 Mozilla bug 78414].
This specification aims to solve these major problems with NPAPI:
# There is no way to get focus from a plugin using the keyboard. This is [https://bugzilla.mozilla.org/show_bug.cgi?id=93149 Mozilla bug 93149].


= API Requirements =
* Plugins eat all key events when focused, the browser does not get a chance to process anything. For Gecko, this is [https://bugzilla.mozilla.org/show_bug.cgi?id=78414 Mozilla bug 78414].
* There is no way to get focus from a plugin using the keyboard. This is [https://bugzilla.mozilla.org/show_bug.cgi?id=93149 Mozilla bug 93149].


* Plugins should be able to participate and tab navigation just like any other tab-navigable elements.
This specification adds the following capabilities to NPAPI:
* Any API should allow for focus direction to be recalled and followed - plugins should know what direction focus is coming from when being focused, and the browser should know which direction focus is going when unfocusing the plugin.
 
* Plugins should be able to participate in tab navigation just like any other tab-navigable elements.
* This API will allow for focus direction to be recalled and followed - plugins should know what direction focus is coming from when being focused, and the browser should know which direction focus is going when unfocusing the plugin.
* Plugins should be able to hand events to the browser when they want to, regardless of the source. This would allow the browser to handle events the plugin does not want to handle.
* Plugins should be able to hand events to the browser when they want to, regardless of the source. This would allow the browser to handle events the plugin does not want to handle.


= Negotiating Advanced Key Handling =
= Negotiating Advanced Key Handling =


In order for behavior to change, the browser must return a boolean value of "true" for "NPNVsupportsAdvancedKeyHandling" and the plugin must return a boolean value of "true" for "NPPVSupportsAdvancedKeyHandling". There is no active negotiation of modes and supported status cannot change at any time for either the browser or the plugin.
In order for behavior to change, the browser must return a boolean value of "true" for "NPNVsupportsAdvancedKeyHandling" and the plugin must return a boolean value of "true" for "NPPVsupportsAdvancedKeyHandling". There is no active negotiation of modes and supported status cannot change at any time for either the browser or the plugin.


* NPPVSupportsAdvancedKeyHandling (NPPVariable = x)
* NPPVsupportsAdvancedKeyHandling (NPPVariable = 21)
* NPNVsupportsAdvancedKeyHandling (NPNVariable = x)
* NPNVsupportsAdvancedKeyHandling (NPNVariable = 21)


= Specification =
= Specification =
Line 58: Line 60:
// Return value indicates whether or not the browser will take focus.
// Return value indicates whether or not the browser will take focus.
NPBool NPN_UnfocusInstance(NPP instance, NPFocusDirection direction);
NPBool NPN_UnfocusInstance(NPP instance, NPFocusDirection direction);
// Called by the browser when the browser intends to take focus.
// Instance argument indicates the instances losing focus.
// There is no return value, plugins will lose focus when this is called.
void NPP_LostFocus(NPP instance);


// Called by the browser when the browser intends to focus an instance.
// Called by the browser when the browser intends to focus an instance.
Line 69: Line 66:
// Return value indicates whether or not the plugin accepts focus.
// Return value indicates whether or not the plugin accepts focus.
NPBool NPP_GotFocus(NPP instance, NPFocusDirection direction);
NPBool NPP_GotFocus(NPP instance, NPFocusDirection direction);
// Called by the browser when the browser intends to take focus.
// Instance argument indicates the instances losing focus.
// There is no return value, plugins will lose focus when this is called.
void NPP_LostFocus(NPP instance);
</pre>
</pre>


Line 89: Line 91:
= Specification History =
= Specification History =


[[https://wiki.mozilla.org/NPAPI:AdvancedKeyHandlingHistory Click here]] to see information on past specification attempts.
[[NPAPI:AdvancedKeyHandlingHistory|Click here]] to see information on past specification attempts.
Confirmed users
490

edits