Skip to main content



      Home
Home » Archived » ATF » Get coordinates for text, letters in rendered web page(Question about how to get coordinates or any related position for the textual structures (letter, word) inside the DOM element.)
icon5.gif  Get coordinates for text, letters in rendered web page [message #496671] Tue, 10 November 2009 16:09 Go to next message
Eclipse UserFriend
Hello, Jacek!

Do you know is it possible to get information about rendered text inside DOM Node?
For example it can be word "Word" (some where in the text node) which in HTML represented as
<span ...>W</span>ord
Is it possible to get info about related position between "W" and "ord" to figure out that it is one word?
Re: Get coordinates for text, letters in rendered web page [message #498021 is a reply to message #496671] Fri, 13 November 2009 12:17 Go to previous messageGo to next message
Eclipse UserFriend
Does anyone know, how to get a coordinates and bounding box for particular symbol in node?
Which interface of XPCOM should I use?
Re: Get coordinates for text, letters in rendered web page [message #498258 is a reply to message #498021] Mon, 16 November 2009 03:40 Go to previous messageGo to next message
Eclipse UserFriend
hi,
sorry for late response, I was offline for last 5 days. You can see how
ATF gets the DOM node bounding box in
org.eclipse.atf.mozilla.ide.ui.browser.SelectionBox.getEleme ntBounds(nsIDOMElement)

I'd try to get the parent node of text node, e.g. <span> for
"<span>W</span>ord". Next, get the information line wrapping, lines
height and chars width and calculate by hand.
You could also ask on the Mozilla newsgroup, as it doesn't really matter
whether you use XULRunner APIs over JavaXPCOM or from JavaScript/C++.
I find mozilla.dev.platform quite helpful.

ruslanrf wrote:
> Does anyone know, how to get a coordinates and bounding box for
> particular symbol in node?
> Which interface of XPCOM should I use?
Re: Get coordinates for text, letters in rendered web page [message #499331 is a reply to message #498258] Fri, 20 November 2009 15:48 Go to previous messageGo to next message
Eclipse UserFriend
But how to learn width of particular character and how many lines?
I found only one solution to add additional tag for every word in DOM tree to get coordinates for every word, but I would not to change DOM tree and wanted to find another solution.
Re: Get coordinates for text, letters in rendered web page [message #499553 is a reply to message #499331] Mon, 23 November 2009 05:44 Go to previous message
Eclipse UserFriend
ruslanrf wrote:
> But how to learn width of particular character and how many lines?
> I found only one solution to add additional tag for every word in DOM
> tree to get coordinates for every word, but I would not to change DOM
> tree and wanted to find another solution.

it would be fun to have this in ATF. I asked on Mozilla group how to
achieve this. Link to follow:
http://groups.google.com/group/mozilla.dev.platform/browse_t hread/thread/7ed4d752a19c3cfa#
Re: Get coordinates for text, letters in rendered web page [message #562071 is a reply to message #496671] Fri, 13 November 2009 12:17 Go to previous message
Eclipse UserFriend
Does anyone know, how to get a coordinates and bounding box for particular symbol in node?
Which interface of XPCOM should I use?
Re: Get coordinates for text, letters in rendered web page [message #562158 is a reply to message #562071] Mon, 16 November 2009 03:40 Go to previous message
Eclipse UserFriend
hi,
sorry for late response, I was offline for last 5 days. You can see how
ATF gets the DOM node bounding box in
org.eclipse.atf.mozilla.ide.ui.browser.SelectionBox.getEleme ntBounds(nsIDOMElement)

I'd try to get the parent node of text node, e.g. <span> for
"<span>W</span>ord". Next, get the information line wrapping, lines
height and chars width and calculate by hand.
You could also ask on the Mozilla newsgroup, as it doesn't really matter
whether you use XULRunner APIs over JavaXPCOM or from JavaScript/C++.
I find mozilla.dev.platform quite helpful.

ruslanrf wrote:
> Does anyone know, how to get a coordinates and bounding box for
> particular symbol in node?
> Which interface of XPCOM should I use?
Re: Get coordinates for text, letters in rendered web page [message #562302 is a reply to message #498258] Fri, 20 November 2009 15:48 Go to previous message
Eclipse UserFriend
But how to learn width of particular character and how many lines?
I found only one solution to add additional tag for every word in DOM tree to get coordinates for every word, but I would not to change DOM tree and wanted to find another solution.
Re: Get coordinates for text, letters in rendered web page [message #562376 is a reply to message #562302] Mon, 23 November 2009 05:44 Go to previous message
Eclipse UserFriend
ruslanrf wrote:
> But how to learn width of particular character and how many lines?
> I found only one solution to add additional tag for every word in DOM
> tree to get coordinates for every word, but I would not to change DOM
> tree and wanted to find another solution.

it would be fun to have this in ATF. I asked on Mozilla group how to
achieve this. Link to follow:
http://groups.google.com/group/mozilla.dev.platform/browse_t hread/thread/7ed4d752a19c3cfa#
Previous Topic:Add and execute JavaScript code
Next Topic:atf 0.3.0 installation woes
Goto Forum:
  


Current Time: Wed Jul 23 13:29:44 EDT 2025

Powered by FUDForum. Page generated in 0.24614 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top