Q:

When does a web page appear the first time?

I'd like to know when does a web page appear the first time, especially in relation with events like the DOMContentLoaded or or the Load event.
If I knew the event in question then I could minimize the HTTP requests up until that point and lazy-load resources after that. My knowledge on the subject is admittedly limited and I know that it's a very broad topic but I'd rather like some practical info.

A:

According to Google, this is the general sequence of events:

Process HTML markup and build the DOM tree.
Process CSS markup and build the CSSOM tree.
Combine the DOM and CSSOM into a render tree.
Run layout on the render tree to compute geometry of each node.
Paint the individual nodes to the screen.

According to Google again,

domContentLoaded typically marks when both the DOM and CSSOM are ready.

Together, I would say that in general, DOMContentLoaded is the closest event related to the painting of the markup, and Load is the closest event to when the rendering and loading of external resources is finished.
But, this could vary based on browser implementation, HTML version (4, 5, etc.), and probably other things I'm not thinking about.

