Welcome, Guest. Please login or register.

Author Topic: How does a web browser work?  (Read 3059 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: How does a web browser work?
« on: January 21, 2007, 01:00:58 AM »
Well, since this is quote generic query, I won't go into details.
Quote
How does a browser basically work?

By fetching and parsing the webpages, and then displaying (rendering) them to user to see. User can give input and take actions, and these will lead to other pages being displayed, or the content of the page being updated.

See Wikipedia: Web browser for more.

Quote
But how does it decide what gets done first? for example if images, html and scripts are contained on a web page which items are actions taken on first?

Whichever happens to come first (HTML is very structured markup language, elements are in certain ordered structure). Some elements might have higher priority than others, however. Some parts might depend on others to be 'resolved' first. Also, smart renderers first get enough information about all elements to know their sizes (if possible), and then figure out the layouting needed. After that the elements are rendered. If no size information is available, the page will be jumpy while loading (elements are 'dancing' as they're loaded and the layouting changes realtime).

Needless to say this is huge over-simplification. If you really want to know how simple web page renderer works, see aweb source code.

Quote
On an Amiga hows does data get sent back and forth between the browser and the TCP/IP stack software?

bsdsocket.library - This is a dynamically created library that TCP/IP stacks create to memory. It has all the APIs needed to talk to the network stack.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: How does a web browser work?
« Reply #1 on: January 21, 2007, 02:23:41 AM »
Maybe as a conclusion it should be pointed out that something like rendering most web pages correctly is probably one of the most difficult tasks programmer (or rather army of programmers) can tackle. It is a very hard and complex task, and depends on hundreds of smaller components to come together.