I want to get width and height of HTML element because I want to use
these information to segment and analyse a web page.
I searched an answer in FAQ of Gecko. It tells that Gecko can get
these information easily.
But I am a beginner of Gecko and don't want to dive into it. It seems
hard even trying to compile
it. Could anyone help me to achieve my goal ? Where should I get
started? Thanks.

https://wiki.mozilla.org/Gecko:Frequently_Asked_Questions

Q. Can I use the Gecko engine to get the width information of some
HTML elements (such as table,tr,td)? The element width information is
not always available in the HTML source, but when the element is
displayed, the width information is required. I think the layout
engine calculates the width. Is there a way to retrieve the width of
the element from the layout engine?

A. All HTML elements have offsetWidth and offsetHeight properties (see
http://developer.mozilla.org/en/docs/DOM:element.offsetWidth and
http://developer.mozilla.org/en/docs/DOM:element.offsetHeight). You
can also use getComputedStyle (http://developer.mozilla.org/en/docs/
DOM:window.getComputedStyle) to get width/height information. You can
also use the DOM Inspector in Firefox to view computed style.
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to