W3C home > Mailing lists > Public > public-html@w3.org > January 2009

Re: Conditional branch in tree builder based on DOM state

From: Henri Sivonen <hsivonen@iki.fi>
Date: Fri, 2 Jan 2009 15:41:22 +0200
Cc: HTMLWG WG <public-html@w3.org>
Message-Id: <B7396D02-8CE9-403D-B63B-3FE4E86451FE@iki.fi>
To: Ian Hickson <ian@hixie.ch>

On Dec 25, 2008, at 12:59, Ian Hickson wrote:

> On Tue, 9 Dec 2008, Henri Sivonen wrote:
[...]
>
>> 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——".
[...]
> While what you describe would make your particular implementation  
> strategy
> easier, it would in fact complicate implementations that support  
> script
> and operate on the DOM directly (i.e. all script-aware implementations
> today).

It would add a boolean flag to each stack node. The main complication  
seems to be the setting the flag, which is pretty tame. Granted, it  
does change the nature of the stack nodes a bit, since so far they've  
been immutable.

> Instead, I recommend passing along an _assertion_ along with the
> mutations, along the lines of "these elements have children" and  
> "these
> elements don't have children", which the main thread can quickly  
> check. If
> the assertions turn out to be false, which will only happen in rare  
> caes,
> then the thread can synchronise with the main thread, getting itself
> updated on what nodes have children, and then try again from that  
> point.

This seems a lot more complicated than requiring all implementations  
to maintain a flag on each stack node.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/
Received on Friday, 2 January 2009 13:42:09 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:00 UTC