Kuinka www-sivun lataus tapahtuu konepellin alla
Applen Safari-selaimen kehittäjiin kuuluva Dave Hyatt kertoo, kuinka Safari lataa www-sivut.
“Well, the first step is to start fetching the data from the network. This is typically done on a thread other than the main UI thread. As the data for the page comes in, it is fed to an HTML tokenizer. It’s the tokenizer’s job to take the data stream and figure out what the individual tokens are, e.g., a start tag, an attribute name, an attribute value, an end tag, etc. The tokenizer then feeds the individual tokens to an HTML parser. The parser’s job is to build up the DOM tree for a document. Some DOM elements also represent subresources like stylesheets, scripts, and images, and those loads need to be kicked off when those DOM nodes are encountered.”