Conditional branch in tree builder based on DOM state

We had a meeting about moving parsing off the main thread in Gecko.  
The idea is to make the tree builder output a sequence of tree  
mutations on a dedicated thread and to actuate the mutations on the  
main thread.

It is then a problem if the sequence of mutations is conditional on  
information read synchronously from the DOM. There is one place in the  
HTML5 parsing algorithm where this problem arises and cannot be  
remedied by deferring the conditional check itself to the mutation  
actuation time: step 7.5. of the adoption agency algorithm. The  
changes to the internal state of the tree builder depend on whether a  
node has children.

The problem would go away if instead of checking whether the node has  
children in the DOM, there were a 'has children' flag on the tree  
builder stack tracking whether the node has *parser-inserted* children.

The spec change suggestion, therefore, is making step 7.5. of the AAA  
read "If node has any *parser-inserted* children, perform a shallow  
clone of node——".

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Wednesday, 10 December 2008 01:51:14 UTC