I am wondering If I will be able to get the Position of a DOM element on a
Page from the DOM Tree. To get the position on the page the document must be
paginated. After Pagination is there a way to get the DOM Elements Page
Number and its Position on the Page. I am mainly interested in the
I am using the nsIDOMNSHTMLElement to get the Offsets, Width and Height. The
Offsets which I am getting are with respect to its Offset Parent. So I went
up the Tree adding the offsets of its parent to get the actual offset.
Intially I am getting the Offsets which doesnt fall with in the Paper Size
boundaries. So I did a Print Preview and then got the offsets. this time the
offsets are better and are falling in page boundaries but the offsets are
not matching to actual element coordinates on the page.
My question is will I be able to get the right Offsets that will match the
DOM Element, By doing this? When travesring the Tree when should I stop,
should I go all the way to the top of the tree? Will I be able to get the
Offset from the Page Origin to the Element?
"Boris Zbarsky" <[hidden email]> wrote in message
> Martin NG wrote:
> > I also want to know how to get the position of an DOM element. e.g, a
> > button, a textbox.
> Again, the concept of "position" for a "DOM element" is not well-defined.