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

Boris Zbarsky:
> 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.

So this is purely from an sXBL author's point of view?  I'm not sure I
uunderstand then.  When the XBL prebind event has been fired on the
element, you would add a DOMNodeInsertedIntoDocument listener on to it.
This might be problematic for the case where a previously registered
capturing listener on the document immediately removed that element, but
surely you could just check if it was still there if this mattered
(with, for example, Node.compareDocumentPosition).

> 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...

I guess I don't see what is special about notifying the binding that the
bound element is inserted into the document.  To be inserted into the
document, it would have to be not in the document tree beforehand.  And
if that is the case, the binding may as well use the 'bound' event to do
whatever it needed to do.

Cameron

-- 
  e-mail : cam (at) mcc.id.au    	icq : 26955922
     web : http://mcc.id.au/	        msn : cam-msn (at) aka.mcc.id.au
  office : +61399055779		     jabber : heycam (at) jabber.org

Received on Friday, 18 March 2005 06:05:05 UTC