nsIContentViewManager 编辑

content/base/public/nsIFrameLoader.idlScriptable Manages the content views contained in a browser 1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

To obtain a reference to the view manager for a document, you can QueryInterface() the nsIFrameLoader object to nsIContentViewManager. See Getting access to content views for details. Once you have the view manager, you can call getContentViewsIn() to get a list of the content views for a given portion of the browser display, then use those nsIContentView objects to manipulate the content views.

Method overview

void getContentViewsIn(in float aXPx, in float aYPx, in float aTopSize, in float aRightSize, in float aBottomSize, in float aLeftSize, [optional] out unsigned long aLength, [retval, array, size_is(aLength)] out nsIContentView aResult);

Attributes

AttributeTypeDescription
rootContentViewnsIContentViewThe root content view. Read only.

Methods

getContentViewsIn()

Returns an array of nsIContentView objects representing all of the content views that intersect with the specified rectangle in the browser.

Note: The rectangle is specified using an anchor point, then four distances to indicate how far in each direction to expand the rectangle. This lets you, for example, take the coordinates at which the user clicked (or touched) the screen, and expand outward to create a rectangle from that point.

Pixels are in chrome device pixels and are relative to the browser element.

void getContentViewsIn(
  in float aXPx,
  in float aYPx,
  in float aTopSize,
  in float aRightSize,
  in float aBottomSize,
  in float aLeftSize,
  out unsigned long aLength, Optional
  [retval, array, size_is(aLength)] out nsIContentView aResult
);
Parameters
aXPx
The X coordinate of the anchor point of the rectangle, in CSS pixels.
aYPx
The Y coordinate of the anchor point of the rectangle, in CSS pixels.
aTopSize
The distance upward from the Y anchor to expand the rectangle.
aRightSize
The distance to the right from the X anchor to expand the rectangle.
aBottomSize
The distance downward from the Y anchor to expand the rectangle.
aLeftSize
The distance to the left from the X anchor to expand the rectangle.
aLength Optional
If specified, on return this parameter indicates the number of nsIContentView objects returned in the aResult array.
aResult
On return, an array of nsIContentView objects representing the content views in the specified rectangle.

See also

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

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

发布评论

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

词条统计

浏览:123 次

字数:5636

最后编辑:7 年前

编辑次数:0 次

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