Advertisement Jump to content
Sign in to follow this  

[.net] .Net HTML rendering engine

This topic is 3724 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello there. I somehow got into the situation where I need to build a HTML rendering engine in C#. So does anyone know of an existing one or the steps you'd take to make one?

Share this post

Link to post
Share on other sites
Original post by Lavinski
Hey again, I'm fully aware of the browser control but for this I'm not allowed to use it. So how do you make one?

What do you mean, "not allowed to use it"? Why not?

As for writing your own from scratch, it's a pretty daunting task... how fully-featured does it need to be? Does it need to just support some basic formatting (e.g. <b>, <a href="..."> etc) or does it need full support for things like inline images, CSS, the box model, etc?

Share this post

Link to post
Share on other sites
Maybe use WebKit? Google's Chrome does. I don't think they have a C# port yet, so you might have something to contribute to the community.

Other than that, I second Codeka in that writing up your own rendering engine will take you some years to do on your own; if you manage to do it at all. [wink]


Share this post

Link to post
Share on other sites
Hey Codeka, It will not be anywhere near fully featured but it will need to implement a the most common tags and the box model, but will not contain anything like javascript or the full HTML or CSS implementations.

Share this post

Link to post
Share on other sites
This is a very very simple process of rendering html.

Phase 1-
Create a text parser that reads your html file (from src or from http)

Phase 2-
The parser must break down the html text file into a collection of objects
So when you read <tag> text <tag2>text2</tag2></tag> you should be able to create object "tag" parent of object "text" and object "tag2" which is parent of "text2".

Phase 3-
Render objects into screen
An object would be something like

Type -> DIV
Child of -> its parent
Position -> absolute | relative | static -> translates into X,Y
Size -> W,H
Collection of children ->
styles ->

When rendering recursively through the screen you should be able to handle position and basic styles.

Thats about the best I can come up with in short.

Yours Truly

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!