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

Re: expose <use> shadow tree for JS?

From: Chris Lilley <chris@w3.org>
Date: Sun, 5 Sep 2010 10:28:17 +0200
Message-ID: <1502535587.20100905102817@w3.org>
To: Declan Naughton <piratepenguin@gmail.com>
CC: www-svg@w3.org
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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:22 UTC