Gecko:Frequently Asked Questions

From MozillaWiki
Jump to: navigation, search

Add your question here. Note that this is an FAQ about Gecko; individual questions don't belong here, and questions about using Gecko don't belong here. The answers to a lot of questions can be found at http://developer.mozilla.org/.

Q. Can I use my favourite doxygen/ C++/ STL/ gcc/ Amiga feature in Mozilla code? It's really great!

A. Check documentation like our coding practices documents: http://www.mozilla.org/hacking/#coding-practices. If that documentation says no or doesn't address your question, ask your reviewer/super-reviewer or favourite Gecko hacker. If they say no and you're still not satisfied, you probably need to start a community-wide discussion about whether your feature should be used. A good way to start such a flame discussion is to post your suggestion to netscape.public.mozilla.seamonkey.


Questions added by various people; don't really belong in the FAQ, but I'm not sure where else to put the answers.

Q. How can i use Gecko engine in a standalone application ?

A. See http://developer.mozilla.org/en/docs/Embedding_Mozilla.

Q. Where can I find a list of CSS properties supported by Gecko?

A. See http://developer.mozilla.org/en/docs/Mozilla_CSS_support_chart and http://developer.mozilla.org/en/docs/CSS_Reference.

Q. Can you invoke the Gecko engine from a Unix shell script? Could you send it HTML and get back a web page that might be sent to the printer?

A. Not really supported; you can probably get something close to what you want by writing your own application using Gecko's embedding APIs, though. Note that it's currently not possible to print without a widget on the screen to render to.

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. Finally, in Firefox 3 and newer you can use https://developer.mozilla.org/En/DOM/Element.getBoundingClientRect