Visit Mozilla.org

nsIAccessibleDocument

From MDC


The nsIAccessibleDocument interface allows in-process accessibility clients to retrieve information about a document.

When accessibility is turned on in Gecko, there is an nsIAccessibleDocument for each document whether it is XUL, HTML, or whatever. You can QueryInterface() to nsIAccessibleDocument from the nsIAccessible or nsIAccessNode for the root node of a document.

You can also get one from nsIAccessNode's GetAccessibleDocument() method or the GetAccessibleDocument() method in nsIAccessibleEvent.

Contents

nsIAccessibleDocument is defined in accessible/public/nsIAccessibleDocument.idl. It is scriptable and is currently under review.

Inherits from: nsISupports

[edit] Method overview

AString getNameSpaceURIForID(in short nameSpaceID);
nsIAccessNode getCachedAccessNode(in voidPtr aUniqueID);
nsIAccessible getAccessibleInParentChain(in nsIDOMNode aDOMNode, in boolean aCanCreate);

[edit] Attributes

Attribute Type Description
URL AString The URL of the document.
title AString The title of the document, as specified in the document.
mimeType AString The mime type of the document.
docType AString The doc type of the document, as specified in the document.
document nsIDOMDocument The nsIDOMDocument interface associated with this document.
window nsIDOMWindow The nsIDOMWindow that the document resides in.
windowHandle voidPtr The window handle for the OS window the document is being displayed in. For example, in Windows you can static cast it to an HWND.
ariaPropTypes unsigned long A bit flag representing the type of ARIA properties which should be checked in this document: either eUnknownPropType, eCheckNamespaced, eCheckHyphenated or eCheckAny.

[edit] Constants

Constant Value Description
eCheckNamespaced 1 Check attributes in the form of: [someprefix]:[propname] (e.g. aria:live) where ancestor defines: xmlns:[someprefix]="http://www.w3.org/2005/07/aaa".
eCheckHyphenated 2 Check hyphenated attributes in the form of aria-[propname]. This is the default in text/html documents. Can be combined with eCheckNamespaced flag. This may change during the life of the document, if setAttributeNS() is used to set an ARIA property.

[edit] Methods

[edit] getNameSpaceURIForID()

This method retrieves the namespace the specified ID.

 AString getNameSpaceURIForID(
   in short nameSpaceID
 );
[edit] Parameters
nameSpaceID
The ID of the namespace.
[edit] Return value

The namespace for given ID.

[edit] getCachedAccessNode()

This method retrieves the access node cached by this document.

 nsIAccessNode getCachedAccessNode(
   in voidPtr aUniqueID
 );
[edit] Parameters
aUniqueID

The unique ID used to cache the node. This matches up with the uniqueID attribute on nsIAccessNode.

[edit] Return value

Returns the nsIAccessNode cached for this particular unique ID.

[edit] getAccessibleInParentChain()

This method returns the first accessible parent of a DOM node. Guaranteed not to return nsnull if the DOM node is in a document.

 nsIAccessible getAccessibleInParentChain(
   in nsIDOMNode aDOMNode,
   in boolean aCanCreate
 );
[edit] Parameters
aDOMNode
The DOM node we need an accessible for.
aCanCreate
If true, this method can create a new accessible. Otherwise, it will return the first cached accessible in the parent chain.
[edit] Return value

Returns the first nsIAccessible found by crawling up the DOM node to the document root.

[edit] See also