Re: expose <use> shadow tree for JS?

On Friday, September 3, 2010, 8:35:21 PM, Declan wrote:

DN> Hello,

DN> As <use> clones elements on the dom level but does  not expose
DN> their javascript apis in any way, this makes it effectively 
DN> useless to use <use> to copy a group containing a canvas element 
DN> (inside of a foreignObject element (note this problem isn't
DN> related to  foreignObject but the way that the canvas api works)).

The point of <use> Is to allow multiple copies of an object, when filling up the DOM with all the copies (and dealing with id conflicts) is undesirable. Also, changes to the original object propogate to all the use instances. In other words, the fact that the subtrees are not exposed is a feature, not a bug.

If it is desired to make multiple copies in the DOM, cloneNode rather than <use> would be the way to go.


-- 
 Chris Lilley   Technical Director, Interaction Domain                 
 W3C Graphics Activity Lead, Fonts Activity Lead
 Co-Chair, W3C Hypertext CG
 Member, CSS, WebFonts, SVG Working Groups

Received on Sunday, 5 September 2010 08:28:32 UTC