W3C home > Mailing lists > Public > public-html@w3.org > November 2008

Re: Black-box equivalence of parsing fragments directly into context node

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 27 Nov 2008 10:13:17 -0500
Message-ID: <492EB90D.2070201@mit.edu>
To: Henri Sivonen <hsivonen@iki.fi>
CC: HTML WG <public-html@w3.org>

Henri Sivonen wrote:
>> Well, they'd fire as you insert nodes, yes.
> Do you mean when the parser inserts node or when a document fragment is 
> inserted into the context node?

Both, in theory, but if the parser is parsing into an isolated document 
fragment there won't be any mutation listeners set up anywhere around 
that yet.

> I'm doing things like aParent->AppendChildTo(aChild, PR_TRUE); with the 
> assumption that this notifies but doesn't fire a mutation event. Now 
> that I've looking further in the code, I'm suspecting the two might be 
> coupled...

In Gecko, they are.

> Are different browsers consistent in what mutation events they fire in 
> this case?

I don't know (though I would suspect they aren't, on general principle).

> Can mutation event listeners do any kind of mischief before there has 
> been an event loop spin?

Mutation events fire synchronously, yes.  They have to, per DOM spec.

Received on Thursday, 27 November 2008 15:16:24 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:39 UTC