How Browsers Work: Behind the Scenes
Join the DZone community and get the full member experience.Join For Free
as she states in her home page : " in the years of ie 90% dominance there was nothing much to do but regard the browser as a "black box", but now, with open source browsers having more than half of the usage share, it's a good time to take a peek under the engine's hood and see what's inside a web browser. well, whatâ€™s inside are millions of c++ lines... "
do forget to miss check also her client side performance tips .
below are some teaser text and images from her article . check her article for more :)
the browser's main components are ( 1.1 ):
- the user interface - this includes the address bar, back/forward button, bookmarking menu etc. every part of the browser display except the main window where you see the requested page.
- the browser engine - marshalls the actions between the ui and the rendering engine.
- the rendering engine - responsible for displaying the requested content. for example if the requested content is html, it is responsible for parsing the html and css and displaying the parsed content on the screen.
- networking - used for network calls, like http requests. it has platform independent interface and underneath implementations for each platform.
- ui backend - used for drawing basic widgets like combo boxes and windows. it exposes a generic interface that is not platform specific. underneath it uses the operating system user interface methods.
- data storage . this is a persistence layer. the browser needs to save all sorts of data on the hard disk, for examples, cookies. the new html specification (html5) defines 'web database' which is a complete (although light) database in the browser.
figure : browser main components.
main flow examples
figure : webkit main flow
first check her article which is very comprehensive. but if you want to dig even more you can check her article's resources:
- browser architecture
- aho, sethi, ullman, compilers: principles, techniques, and tools (aka the "dragon book"), addison-wesley, 1986
- rick jelliffe. the bold and the beautiful: two new drafts for html 5.
- l. david baron, faster html and css: layout engine internals for web developers.
- l. david baron, faster html and css: layout engine internals for web developers (google tech talk video)
- l. david baron, mozilla's layout engine
- l. david baron, mozilla style system documentation
- chris waterson, notes on html reflow
- chris waterson, gecko overview
- alexander larsson, the life of an html http request
- w3c specifications
- browsers build instructions
Published at DZone with permission of Spyros Doulgeridis, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.