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.