Re: Cloning XBL bound elements

Jon Ferraiolo wrote:
> Here is what I am seeing:
> 
>  From the XBL2 spec:
> ------------
> Bindings attached through CSS must only remain on the bound element as 
> long as the element continues to match the style rule. If at any time a 
> resolution of style on the element determines that a different binding 
> should be attached, the old binding (and all bindings that it explicitly 
> extends in its _explicit inheritance chain_ 
> <http://www.w3.org/TR/xbl/#explicit1>) must be detached.
> ------------

This only talks about bindings attached using CSS though. Not bindings 
attached using the element attribute or the .addBinding function.

> In the case of a clone, if there is a <foo> element that gets cloned and 
> if there is a <binding element="foo"> or a style declaration for "foo" 
> which applies a binding, then dynamic reapplication of bindings would 
> cause the cloned foo element to have the given binding attached to it. 
> So, the clone would get its own binding, its own separately built shadow 
> tree, along with invocation of xblBindingAttached() and things like that.

Yes, that is probably how I would interpret the spec now, although it's 
not very explicit. This is Option A in my original email. However just 
leaving it at that I think would be a severe limitation on what you 
could implement using XBL2 since you couldn't keep any private state 
while still working with .clone().

/ Jonas

Received on Wednesday, 9 May 2007 21:11:36 UTC