Saturday, September 12, 2015

How browser works

Where I learned:

Tali Gabriel, an Israeli web developer, researched about browsers and went through many open source web browser's source code, and came up with the document about how browser works.

She also studied about Web-Kit and Gecko, the browser engines.

Browser is user interface for getting resources from web.
How browser interprets and displays HTML file.


Mostly used Terms:

Resources
URI
HTML5 and CSS specifications

Common things in all browsers:
Address bar
back and forward button
favorites bar
bookmarking options
refresh and stop buttons
home button



Browser high level architecture:
User Interface
browser engine
rendering engine
HTML parser
HTTP
JavaScript
Back end  UI
networking
Data persistence


networking - to get the HTML document from server
HTTP - protocol for transfer
HTML - language browser understands



DOM tree

HTML is very forgiving language. It is not a context free grammar, so it needs a different parser.
Other languages like JavaScript, XML etc. have context free grammar, that's why their parsers can be made from parser generators.

There is a formal format for defining HTML, that is DTD (Document Type Defifnition)

DOM tree is made by parsing of HTML. It is a object model representation of HTML. We can see this object representation in FireBug, a plugin for firefox.

In my project, we do not use DOM tree much. It is used mainly in Web programming.

In selenium, XPATH is of much importance. With almost all APIs we have to give Xpath to locate the object on web page.

A good tutorial is on w3c site:

http://www.w3schools.com/xsl/xpath_intro.asp

I'll highlight main points of Xpath in other post.

No comments:

Post a Comment