The "browser rendering principle" rendering tree constructs the relationship between the render tree and the DOM tree (reproduced in the learning ... )

Source: Internet
Author: User

While the DOM tree is being built, the browser builds the render tree. The node (renderer) of the render tree, called the frame in gecko, is called renderer in WebKit. The renderer is created after the document is parsed and the DOM node is created, and the style information for the DOM node is computed.

In WebKit, renderer is created by the DOM node called the Attach () method. The Attach () method calculates the style information for a DOM node. Attach () is a top-down recursive operation. That is, the parent node always creates its own renderer before the child node. When destroyed, it is a bottom-up recursive operation, that is, child nodes are always destroyed before the parent node.

If the display property of an element is set to none, or if the descendant of the element inherits the Display:none,renderer, it will not be created. The sub-class of the node together with the Display property determines what renderer is created for that node. However, Visibility:hidden elements are created.

In WebKit, depending on the display property, different renderer are created, such as:

(1) Display:inline, the Renderinline type is created.

(2) Display:block, the Renderblock type is created.

(3) Display:inline-block, the Renderblock type is created.

(4) Display:list-item, the Renderlistitem type is created.

The elements of Position:relative and Position:absolute in the render tree are not the same as the location of the DOM nodes in the DOM tree.

The corresponding relationship between the DOM tree and the render tree is as follows:

The "browser rendering principle" rendering tree constructs the relationship between the render tree and the DOM tree (reproduced in the learning ... )

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.