Erik Arvidsson <> wrote: > Xiaolei Li wrote: >> hi, i'm writing an app that needs the coordinates of DOM elements. >> given some DOM node (image, text, table, etc.) and the rendered page, >> i'd like to find out the coordinate of the upper-left hand corner and >> the width/height of the node. is there API to do this? thank you. > > Try using the boxObject associated with the element node. You need to > subtract the scroll position of all parent containers (bug #186229)
thank you. i've successfully gotten the nsIBoxObject from the element and can do GetX(), GetY(), etc. however, there doesn't seem to be any nsIBoxObjects associated with #text DOM nodes. even in DOM inspector, i can't see coordinate information about the #text node. is there any way to get around this? thanks. -- Xiaolei Li | [EMAIL PROTECTED] | www.xiaolei.org _______________________________________________ Mozilla-xpcom mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-xpcom
