WebKit initialization and the creation of various objects in the process of loading the URL and the detailed analysis of the DOM tree

Source: Internet
Author: User

As we all know, WebKit needs to create a DOM tree. For this it is necessary to create WebView, Chrome,page,frame, document, document PARSER, Dom tree Builder (dom trees build engine), Scriptrunner, Resource Handle and so on objects.

At the same time, you also need to create support objects that serve or communicate with the above objects, such as the chromeclient associated with the local window, the frameloaderclient associated with the Frameloader event, the document that serves the document Loader, Documentwriter and documentparser; Analysis of HTML page words Htmlmetachractorparser, Htmltokenizer , the Htmlparserscheduler of the parser service, the htmlconstrctionsite of the service for the DOM tree, the resourceloader of the request service for the network resource, and so on.

Of course, in addition to the objects listed here, there are many objects such as Subresourceloader and so on are not all listed. So, when are so many objects created? Sorted by time, I ranked them as follows:

Webview->chromeclient->chrome->page->frameloaderclient->frameloader->frame->

Policychecker->documentloader->documentwriter->document->htmldocumentparser->

textresourcedecoder->htmlmetachractorparser->htmltokenizer->htmlscriprunner->htmlparserscheduler- >

Htmltreebuilder->htmlconstructionsite->htmlelementfactory->mainresourceloader->resourcehandle

Detailed creation details I drew two time series diagrams:

Figure One: Creation of individual objects when initializing (before initiating a request for network requests)

Figure II: Creation of various objects after initiating network requests (request) and details of the creation of the DOM tree



The next chapter is about the working process of the lexical analyzer.

WebKit initialization and the creation of various objects in the process of loading the URL and the detailed analysis of the DOM tree

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.