I am just started learning mozilla. I am trying to extract the labels for HTML Form elements. Instead of using the names enclosed in TAGs, I want to use surrounding text of form element as its label. In order to figure out which text is nearest to a form element, I want to use layout engine. After reading document about embedding Gecko and interface of Layout and Form, I can not figure out how to do it. How to relate nsWebBrowser and nsFromElement, nsHTMLTagContent? If it should be done by nsDomDocument, how to access it?
Thanks Chengkai
