tags:

views:

71

answers:

2

Basically I am currently doing some research, and I am interested to find out how I could render web pages without a browser: I have some algorithms that I would like to run to calculate the visual aspect of each blocks of DOM node(s) for each page.

A: 

Basically, you want to create the data structures a browser internally creates so that it knows how to render the page.

Check out the Firefox source.

I suspect it's rather complex.

Blank Xavier
+3  A: 

What you're asking for basically, is a browser rendering engine, otherwise known as a layout engine... For example, Firefox uses the Gecko layout engine to render the pages. Theoretically, you could adopt this engine for whatever project you're working on, saving you a lot of time.

The Gecko engine is used in more projects than just Firefox, and since it's open source, you could easily get the source code and try to throw it in an application.

Wikipedia has a nice list of layout engines, so there are other alternatives to Gecko, like GtkHTML.

Breakthrough