Re: XBL in document fragments

Cameron,
My opinion is that XBL processing only occurs when the document fragment is 
inserted into the document. In fact, all sorts of things having to do with 
knowing about the special semantics of the particular document type (e.g., 
filters, animations, mutation events, XBL) that go beyond generic XML only 
occur upon insertion into a document and don't happen on an unattached 
document fragment. Without insertion into the document, you don't have all 
of the contextual information you need for proper processing. You can't do 
inheritance; you don't have geometry; you can't bubble events; you can't do 
all of the dependency tree things having to do with resource management; 
you can't apply filters; etc. Until a fragment is inserted into the 
document, it is just a bunch of XML.

But that's just my opinion, which I hope is based on common sense. I will 
forward this email to the XBL task force and SVG working groups to see if 
my colleagues agree.

Jon Ferraiolo
Adobe Systems, Inc.
XBL co-editor

At 05:10 PM 9/16/2004, Cameron McCormack wrote:

>Jon Ferraiolo:
> > Can you be more concrete with your question, such as provide some sample
> > markup that shows the scenario. The term "document fragment" can mean lots
> > of things.
>
>Sorry.  I mean something like this:
>
>   var df = document.createDocumentFragment();
>   df.appendChild(document.createElementNS(myns, "something"));
>
>If there was a definition for my:something in the document, would the
>element get a shadow tree here?  I guess the document fragment is a bit
>of a red herring to the general form of my question, which would be:
>does an element get a shadow tree once it is created, or only once it is
>inserted into the document?
>
>Another example:
>
>   var df = document.createDocumentFragment();
>   df.appendChild(xblElement); // some XBL to define my:something
>   df.appendChild(document.createElementNS(myns, "something"));
>
>So now the XBL definitions for my:something are in the document fragment
>as well.  If the document fragment is not inserted into the document,
>would the my:something element get a shadow tree?
>
>In both of these examples, it would be equivalent if I used an svg:g
>element instead of a document fragment, I suppose.
>
>Thanks,
>
>Cameron
>
>--
>Cameron McCormack
>|  Web: http://mcc.id.au/
>|  ICQ: 26955922

Received on Saturday, 18 September 2004 16:36:00 UTC