W3C home > Mailing lists > Public > www-svg@w3.org > September 2004

Re: xblBoundElement in sXBL

From: Jon Ferraiolo <jon.ferraiolo@adobe.com>
Date: Thu, 16 Sep 2004 14:30:12 -0700
To: Cameron McCormack <cam-www-svg@aka.mcc.id.au>, www-svg@w3.org
Message-id: <6.1.1.1.2.20040916141753.03b2c320@mailsj-v1.corp.adobe.com>

Cameron,
Yes, if elements are added to the shadow tree via script, their 
xblBoundElement points to the bound element just as if they were cloned 
from the original <xbl:template> within the <xbl:definition>.

For example, let's say you have a binding definition that has no 
<template>, such as:

   <xbl:definition element="foo:bar">...</xbl:definition>

And suppose you create an event listener in ECMAScript or Java which listen 
for the "bound" event, and further suppose that the handler associated with 
that event listener manually constructs the complete contents of 
xblShadowTree by creating an <xbl:template> element and then attaching 
children to the <xbl:template> such that xblShadowTree looks like this when 
everything is done:

   <xbl:template>
     <svg:g>
       <svg:rect/>
       <svg:text/>
     </svg:g>
   </xbl:template>

My understanding is that all of these elements would have xblBoundElement 
pointing to the relevant <foo:bar> element.

In terms of rewording things, yes, I think we should reword things. Also we 
should include an example. I will add this to my list of things to do.

Jon Ferraiolo
Adobe Systems, Inc.
sXBL co-editor

At 09:47 PM 9/15/2004, Cameron McCormack wrote:

>I'll just keep pumping out these questions as I come across things I'm
>not sure of. :)
>
>The definition of NodeXBL.xblBoundElement states:
>
>   The xblBoundElement attribute is used to obtain the bound element
>   with the binding attached that is responsible for the generation of
>   the specified shadow node. This attribute enables an author to
>   determine the shadow scope of any content node. For content at the
>   document-level scope, the attribute's value is null.
>
>There could be nodes in the shadow tree which weren't generated because
>of the binding on an element.  For example, some other script could
>append some new elements in the shadow tree after the binding scripts
>have run.  Would these new elements also have their xblBoundElement
>attributes set to th the bound element whose shadow tree they now reside
>in?  If so, maybe it could be reworded.
>
>Cameron
>
>--
>Cameron McCormack
>|  Web: http://mcc.id.au/
>|  ICQ: 26955922
Received on Thursday, 16 September 2004 21:35:09 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:55 UTC