nsIAccessibleHyperLink

A cross-platform interface that supports hyperlink-specific properties and methods.
Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3)

Method overview

nsIAccessible getAnchor(in long index); Renamed from getObject in Gecko 1.9
nsIURI getURI(in long index);
boolean isSelected(); Obsolete since Gecko 1.9
boolean isValid(); Obsolete since Gecko 1.9

Attributes

Attribute Type Description
anchorCount long

The number of anchors within this Hyperlink. Is normally 1 for anchors. This anchor is, for example, the visible output of the html:a tag. With an Image Map, reflects the actual areas within the map. Read only. Renamed from anchors in Gecko 1.9

Exceptions thrown
NS_ERROR_FAILURE
Indicates that the accessible is unattached from the accessible tree.
endIndex long

The end offset of the hyperlink accessible within the parent accessible. The returned value is related to the nsIAccessibleHyperLink interface of the object that owns this hyperlink. Read only.

Note: The link itself is represented by one embedded character within the parent text, so the endIndex should be startIndex + 1.
Exceptions thrown
NS_ERROR_FAILURE
Indicates that the accessible is unattached from the accessible tree.
selected boolean

Determines whether the element currently has the focus, for example after returning from the destination page. Read only.

Note: ARIA links can only be focused if they have the tabindex attribute set. Also, state_focused should then be set on the accessible for this link.
Exceptions thrown
NS_ERROR_FAILURE
Indicates that the accessible is unattached from the accessible tree.
startIndex long

The offset of the hyperlink accessible within the parent accessible. The returned value is related to the nsIAccessibleHyperLink interface of the object that owns this hyperlink. Read only.

Exceptions thrown
NS_ERROR_FAILURE
Indicates that the accessible is unattached from the accessible tree.
valid boolean

Determines whether the hyperlink is valid, for example points to a valid URL. Read only.

Note: Currently only used with ARIA links, and the author has to specify that the link is invalid via the aria-invalid='true' attribute. In all other cases, true is returned.
Exceptions thrown
NS_ERROR_FAILURE
Indicates that the accessible is unattached from the accessible tree.

Methods

Renamed from getObject in Gecko 1.9

getAnchor()

Returns a reference to the object at the given index.

Note: ARIA hyperlinks do not have an anchor accessible to point to, since clicks are processed via JavaScript.
Note: In the case of an image map there is more than one link represented by this accessible.

nsIAccessible getAnchor(
  in long index
);
Parameters
index
The 0-based index whose object is to be returned.
Return value

The nsIAccessible object at the desired index.

getURI()

Returns the URI at the given index.

Note: ARIA hyperlinks do not have an URI to point to, since clicks are processed via JavaScript. Therefore this property does not work on ARIA links.

nsIURI getURI(
  in long index
);
Parameters
index
The 0-based index of the URI to be returned.
Return value

The nsIURI object containing the specifications for the URI.

Obsolete since Gecko 1.9 (Firefox 3)

isSelected()

Note: Has been replaced by the selected attribute.

boolean isSelected();
Parameters

None.

Return value

true if the element currently has the focus.

Obsolete since Gecko 1.9 (Firefox 3)

isValid()

Note: Has been replaced by the valid attribute.

boolean isValid();
Parameters

None.

Return value

true if the hyperlink is valid.

Remarks

Anchors, image maps, xul:labels with class="text-link" implement this interface.

See also

Document Tags and Contributors

 Contributors to this page: Sheppy, trevorh, Surkov.alexander, Ayhfung
 Last updated by: Sheppy,