Re: sXBL issue -- bindings getting notified when the bound element is inserted into a document

Cameron McCormack wrote:
> You also won't be able to use
> DOMNodeInsertedIntoDocument to handle new bindable elements being
> inserted into shadow trees, since techinically these aren't a part of
> the document tree.

Of course.  That's not what I'm talking about, though.  I'm talking about the 
binding itself being notified in some way when the node it's bound to is 
inserted into a document.

Again, this is less of an issue for sXBL because bindings just attach shadow 
content and don't execute any script.  But Mozilla XBL and XBL2 need to deal 
with this issue.  And again, I'd like to get the attachment mechanism and 
related issues resolved now, so that it doesn't have to change between sXBL and 
XBL2...

> So I went for using DOMNodeInserted events.

Those have the same exact issues as DOMNodeInsertedIntoDocument, in addition to 
not firing on some nodes which are being inserted into the document...

> Is there some requirement in Mozilla for the sXBL functionality to be
> kept completely separate from the DOM3 code?  If not, then of course
> you can do whatever you want (intercept appendChild et al) and handling
> binding at that point.

Sure.  That's what I have to do anyway.  Again, the problem is not so much one 
of knowing when to bind (which is a separate kettle of fish altogether, and one 
I'm still sorting through) as of how to notify the binding when the bound 
element is inserted into the document...

-Boris

Received on Friday, 18 March 2005 05:49:00 UTC