nsIAccessNode 编辑

accessible/public/nsIAccessNode.idlScriptable An interface used by in-process accessibility clients to get style, window, markup and other information about a DOM node. When accessibility is active in Gecko, every DOM node can have one nsIAccessNode. Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

The nsIAccessNode implementations are instantiated lazily. The nsIAccessNode tree for a given DOM window has a one to one relationship to the DOM tree. If the DOM node for this access node is "accessible", then a QueryInterface to nsIAccessible will succeed.

Method overview

nsIAccessNode getChildNodeAt(in long childNum); Obsolete since Gecko 2.0
nsIDOMCSSPrimitiveValue getComputedStyleCSSValue(in DOMString pseudoElt, in DOMString propertyName);
DOMString getComputedStyleValue(in DOMString pseudoElt, in DOMString propertyName);
void scrollTo(in unsigned long aScrollType);
void scrollToPoint(in unsigned long aCoordinateType, in long aX, in long aY);

Attributes

Note: Attempting to access the attributes of a node that is unattached from the accessible tree will result in an exception - NS_ERROR_FAILURE.
AttributeTypeDescription
documentnsIAccessibleDocumentThe document accessible that this access node resides in. Read only. Note: Renamed from accessibleDocument in Gecko 2.0
DOMNodeNodeThe DOM node this nsIAccessNode is associated with. Read only.
firstChildNodensIAccessNodeThe first nsIAccessNode child. Read only. Obsolete since Gecko 2.0
innerHTMLDOMStringThe innerHTML for the DOM node This is a text string of all the markup inside the DOM node, not including the start and end tag for the node. Read only.
languageDOMStringThe language for the current DOM node, for example en, de, and so on. Read only.
lastChildNodensIAccessNodeThe last nsIAccessNode child. Read only. Obsolete since Gecko 2.0
nextSiblingNodensIAccessNodeThe next nsIAccessNode sibling. Read only. Obsolete since Gecko 2.0
numChildrenlongThe number of DOM children for the DOM node, which matches the number of nsIAccessNode children for this nsIAccessNode. Read only. Obsolete since Gecko 2.0
ownerWindowvoidPtrThe OS window handle for the window this node is being displayed in. Read only. Native code only! Obsolete since Gecko 8.0
parentNodensIAccessNodeThe parent nsIAccessNode. Read only. Obsolete since Gecko 2.0
previousSiblingNodensIAccessNodeThe previous nsIAccessNode sibling. Read only. Obsolete since Gecko 2.0
rootDocumentnsIAccessibleDocumentThe root document accessible that this access node resides in. Read only.
uniqueIDvoidPtrA unique ID calculated for this DOM node, for the purposes of caching and referencing this object. Read only. Native code only!

Methods

getChildNodeAt()

Obsolete since Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

Get the nth child of this node.

nsIAccessNode getChildNodeAt(
  in long childNum
);
Parameters
childNum
Zero-based child index.
Return value

The nth nsIAccessNode child.

Exceptions thrown
NS_ERROR_FAILURE
Indicates that the access node is unattached from the accessible tree.

getComputedStyleCSSValue()

Retrieve the computed style value as nsIDOMCSSPrimitiveValue for the DOM node this access node is associated with.

Note: The meanings of width, height and other size measurements depend on the version of CSS being used. Therefore, for bounds information, it is better to use nsIAccessible.getBounds().
nsIDOMCSSPrimitiveValue getComputedStyleCSSValue(
  in DOMString pseudoElt,
  in DOMString propertyName
);
Parameters
pseudoElt
The pseudo element to retrieve style for, or empty string for general computed style information for the node.
propertyName
Retrieve the computed style value for this property name.
Return value

The nsIDOMCSSPrimitiveValue computed style value.

Exceptions thrown
NS_ERROR_FAILURE
Indicates that the access node is unattached from the accessible tree.

getComputedStyleValue()

Retrieve the computed style value for this DOM node, if it is a DOM element.

Note: The meanings of width, height and other size measurements depend on the version of CSS being used. Therefore, for bounds information, it is better to use nsIAccessible.getBounds().
DOMString getComputedStyleValue(
  in DOMString pseudoElt,
  in DOMString propertyName
);
Parameters
pseudoElt
The pseudo element to retrieve style for, or null for general computed style information for this node.
propertyName
Retrieve the computed style value for this property name, for example "border-bottom".
Return value

The computed style value.

Exceptions thrown
NS_ERROR_FAILURE
Indicates that the access node is unattached from the accessible tree.

scrollTo()

Makes an object visible on screen.

void scrollTo(
  in unsigned long aScrollType
);
Parameters
aScrollType
Defines where the object should be placed on the screen (see nsIAccessibleScrollType.Constants for available constants).
Exceptions thrown
NS_ERROR_FAILURE
Indicates that the access node is unattached from the accessible tree.

scrollToPoint()

Moves the top left of an object to a specified location.

void scrollToPoint(
  in unsigned long aCoordinateType,
  in long aX,
  in long aY
);
Parameters
aCoordinateType
Specifies whether the coordinates are relative to the screen or the parent object (for available constants refer to nsIAccessibleCoordinateType.Constants.
aX
Defines the x coordinate.
aY
Defines the y coordinate.
Exceptions thrown
NS_ERROR_FAILURE
Indicates that the access node is unattached from the accessible tree.

Remarks

The main application of access node tree is it's used by ISimpleDOM* interfaces on Windows.

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

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

发布评论

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

词条统计

浏览:140 次

字数:12231

最后编辑:6 年前

编辑次数:0 次

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