HTML Parser in the new WebKit

Source: Internet
Author: User

After documentloader receives HTML, it calls htmldocumentparser: appendbytes through documentwriter,

After being decoded by documentwriter, call htmldocumentparser: append to add it to htmlinputstream,

If JavaScript code is currently being executed, call htmlpreloadparts to download some IMG and CSS resources in advance,

If suspend exists, wait for htmlparserschedume to resume,

Call htmltokenizer to obtain an htmltoken and call htmltreebuilder to create a DOM tree,

If a script needs to be run, give htmltreebuilder to pause,

Then, run the corresponding script through htmlscriptrunner before obtaining the token next time.

 

 

 

 

 

Htmldocumentparser is used to manage the parser process and provide the execution environment for it.

Htmltokenizer is used to parse HTML and extract htmltoken

Htmlscriptrunner is used to provide an environment for executing scripts

Htmltreebuilder is used to handle errors when creating a DOM tree.

Htmlconstructionsite is used to create and save Dom trees. htmlelementstack is the stack used to create Dom trees.

Htmlpreloadparts is used to download some resources in advance.

Htmlparserscheduler is used to supend and resume the parse process.

 

 

 

 

 

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.