Developing a web browser, part 2
This far...
Google.fi in my browser!
The layout logic is quite simple at the moment. It just goes through all the nodes in the internal DOM tree in the app and checks if the node is a text node and makes a Label with the text the node has.
The problem now is how to detect what "styles" to apply to each node. For example, if we have the following HTML code...
<div>
<b>Hello</b>
<p>Some <i>text</i> here</p>
</div>
so if the B element had 20px of padding for example, how would the program know to not apply it to the P element anymore. The current way of looping through the nodes inside the document can go through all the child nodes, but it doesn't discriminate different childs in any way.
I'll probably implement some kind of parent-checking or something weird.
0 Comments:
Post a Comment
<< Home