nsIAccessibleHyperLink 编辑

accessible/public/nsIAccessibleHyperLink.idlScriptable 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); Note: 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

AttributeTypeDescription
anchorCountlong

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.

Note: Renamed from anchors in Gecko 1.9
Exceptions thrown
NS_ERROR_FAILURE
Indicates that the accessible is unattached from the accessible tree.
endIndexlong

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

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

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

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

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.

isSelected()

Obsolete since Gecko 1.9 (Firefox 3) Note: Has been replaced by the selected attribute.
boolean isSelected();
Parameters

None.

Return value

true if the element currently has the focus.

isValid()

Obsolete since Gecko 1.9 (Firefox 3) 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:94 次

字数:7664

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文