NPAPI:NativeAccessibility: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 5: Line 5:
= Problem Summary =
= Problem Summary =


Plugins cannot currently provide accessible information about their contents on non-Windows platforms.  This is [https://bugzilla.mozilla.org/show_bug.cgi?id=480317 Mozilla bug 78414].
Plugins cannot currently provide accessible information about their contents on Linux platforms.  This is [https://bugzilla.mozilla.org/show_bug.cgi?id=480317 Mozilla bug 78414].


= Glossary =
= Glossary =
Line 20: Line 20:


= API Requirements =
= API Requirements =
* Plugins should be able to easily provide an accessible implementation (in the native accessibility toolkit) to the Browser
* Plugins should be able to easily provide an accessible implementation (in ATK) to the Browser
* The Browser should inject the plugin's accessible into its accessible hierarchy
* The Browser should inject the plugin's accessible into its accessible hierarchy
* The lifetime of the plugin's accessible should be the same as the lifetime of the plugin.
* The lifetime of the plugin's accessible should be the same as the lifetime of the plugin.
Line 28: Line 28:
=== Specification ===
=== Specification ===


'''NPAPI Native Accessibility Support'''
'''NPAPI Native Accessibility Support for Linux'''


* Last modified: June 26, 2009
* Last modified: June 26, 2009
Line 36: Line 36:
Plugins have the need to provide accessibility support to the browser so they can be accessed by assistive technologies like screen readers and testing tools.  Most common web browsers already provide an accessible implementation of DOM content, but thus far, can only export a blank (and therefore useless) object when it comes across a plugin.
Plugins have the need to provide accessibility support to the browser so they can be accessed by assistive technologies like screen readers and testing tools.  Most common web browsers already provide an accessible implementation of DOM content, but thus far, can only export a blank (and therefore useless) object when it comes across a plugin.


When a plugin's accessible is requested from an assistive technology, or when the plugin is first created, the web browser should call the <tt>NPN_GetValue</tt> method, passing <tt>NPNVNativeAccessible</tt> as the <tt>variable</tt> parameter.
When a plugin's accessible is requested from an assistive technology, or when the plugin is first created, the web browser should call the <tt>NPN_GetValue</tt> method, passing <tt>NPNVNativeAccessibleAtk</tt> as the <tt>variable</tt> parameter.


If the plugin sets <tt>value</tt> to <tt>NULL</tt>, the browser should use an empty accessible to represent the plugin.
If the plugin sets <tt>value</tt> to <tt>NULL</tt>, the browser should use an empty accessible to represent the plugin.


If <tt>value</tt> is not <tt>NULL</tt>, the browser should cast it to the base type of the native accessibility toolkit (e.g.: [http://library.gnome.org/devel/atk/unstable/AtkObject.html AtkObject] on Linux), and insert the object into the accessibility hierarchy as a child of the plugin's DOM parent.
If <tt>value</tt> is not <tt>NULL</tt>, the browser should cast it to an [http://library.gnome.org/devel/atk/unstable/AtkObject.html AtkObject], and insert the object into the accessibility hierarchy as a child of the plugin's DOM parent.


If the accessibility toolkit supports reference counting, the plugin accessible's reference should be incremented right after the call to <tt>NPN_GetValue</tt>, and decremented when the plugin is freed.  If the accessible object provided is a pointer, the value ''should not'' be copied to ensure that the plugin can maintain the state of the plugin object.
The plugin's accessible reference should be incremented (via <tt>atk_object_ref</tt>) right after the call to <tt>NPN_GetValue</tt>, and decremented (via <tt>atk_object_unref</tt>) when the plugin is freed.  The accessible provided ''should not'' be copied to ensure that the plugin can maintain the state of the plugin object.


This accessible does not need to be updated, so the browser may cache the object for the life of the plugin.  Plugins that need to regularly remove and re-add their root accessible object should return a container-type object from <tt>NPN_GetValue</tt> and make their root accessible a child of the container.
This accessible does not need to be updated, so the browser may cache the object for the life of the plugin.  Plugins that need to regularly remove and re-add their root accessible object should return a container-type object from <tt>NPN_GetValue</tt> and make their root accessible a child of the container.
26

edits

Navigation menu