Mozilla Document Loading
The purpose of this document is to describe, from a very high-level viewpoint, the start of the document loading process. We start with the request to load a particular link in a particular window, and proceed up to the point at which the data stream is dispatched to the proper handler. The final goal is to find the correct stream listener to pump the data into when necko calls OnDataAvailable (e.g., we may find the HTML parser as the stream listener to give the data to).
Read the article: Document Loading: From Load Start to Finding a Handler