A quick search in the source showed me the method GetSelectionRegionRectAndScrollableView() on nsSelection isn't that what you want?
[EMAIL PROTECTED] wrote: > After weeks of pulling of hair, gnashing of teeth, and generally > wailing to myself, I've given up searching through the available > documentation, newsgroups etc. for an answer to this question. Please, > somebody put me out of my misery (or compound it by admitting there's > currently no solution :-) > > Here's the situation: a nice, simple, single page, embedded browser in > the middle of our application (no buttons, no frame, _just_ the browser > to render html). A user double clicks a word on the page and the word > is highlighted. So far so good. I can get the text. I can get character > positions. I can even get the selection range and node objects, and all > sorts of information that may eventually be useful to me. > > But what I *really* want to know are the coordinates of the selected > (block of) text itself. I can do this easily in IE with the > IHTMLTextRangeMetrics interface (except we've finally thrown out IE in > favour of an embedded Gecko browser) but I haven't been able to find > anything remotely like this for Mozilla/Gecko. > > Have I missed something? Is it really possible that there is *no* way > to obtain the coordinates of the selection/range object directly? Do I > really have to do something like: > > 1. grab the selection > 2. wrap the selection in a <div> block > 3. re-render and get the coords of the newly entered <div> (I think at > least *that* is possible) > > Thanks in advance for *any* suggestions! > > John > > usenetgroupie at gmail dot com _______________________________________________ dev-embedding mailing list dev-embedding@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-embedding