Re: XBL in document fragments

"Jon Ferraiolo" <jon.ferraiolo@adobe.com> wrote in message 
news:6.1.1.1.2.20040928113603.03bbb640@mailsj-v1.corp.adobe.com...
>> I'm struggling to really see it, and
>>can think of many situations where having the bind events before it's in 
>>the
>>document are problematical (anything that relies on sizes etc. from the
>>document.  You'd certainly get considerable complications, and start 
>>having
>>to track mutation events as the element was inserted into the document.  I
>>think it would be much easier to say that the binding happened on 
>>insertion.
>
> What we have done with sXBL is that there is an xbl:prebind event which 
> happens after raw XML cloning of <xbl:template> but before insertion into 
> xblShadowTree and an xbl:bound event which happens after insertion into 
> xblShadowTree (and after recursive XBL processing). When the xbl:prebind 
> event is fired, you are given a handle to the cloned <xbl:template>. 
> However, at this point the cloned subtree is unattached to any document; 
> thus, my analysis and understanding is that neither CSS nor recursive XBL 
> processing can be applied yet.

My concern with doing the binding before the element is embedded in the 
document, makes it considerably more complicated to do things like <OL><LI> 
from HTML in sXBL - the LI sXBL component will need to know the child index 
of the LI element to provide the numbering - if the binding happens after 
creation rather than insertion, we have a more complicated problem, and 
anything that was created in the initial binds are of little use.   Of 
course we'd need to track the mutation events as the nodes move around for a 
proper implementation of LI, but for a simple implementation when you know 
nodes are only going to be appended to the end, and are not going to be 
re-inserted it would be nice not to have to worry about it.

Jim. 

Received on Wednesday, 29 September 2004 13:05:06 UTC