Sign in to follow this  
Lavinski

[.net] .Net HTML rendering engine

Recommended Posts

Quote:
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]

hth,
CipherCraft

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
hm...
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
K

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this