[webkit-dev] DOM tree vs. Render tree

Darin Adler darin at apple.com
Thu Jun 16 16:34:24 PDT 2011

On Jun 16, 2011, at 4:30 PM, song.7.liu at nokia.com wrote:

> Thanks, but why not generate a tree according to document ang css style at the same time? Or why is the post style decision needed?

I can see from your question that you didn’t understand, but I’m not sure how to clear things up.

The DOM tree needs to match the document structure and can’t be influenced by style. This is what makes the DOM API work; the DOM tree is a parsed form of the document explicitly exposed as API. Style can change many ways at times when the DOM must not change, for example, when a stylesheet finishes loading, the styles from that sheet can affect how the DOM elements are displayed. We can’t change the DOM tree in response to style changes.

I think we’ll have to get to a more specific question to have a useful discussion.

    -- Darin

More information about the webkit-dev mailing list