Re: [svg-developers] Use with script
- On Wed, 27 Oct 2010 22:34:02 -0500
"G. Wade Johnson" <gwadej@...> wrote:
> A co-worker of mine has been experimenting with the SVG use elementI spent some time tonight digging around in the SVG 1.1 spec. As I
> now that it is implemented more widely and reliably in browsers.
> We've been talking about SVG components that could be <use>d into an
> SVG image.
> The problem he brought up has to do with script elements. Should
> script elements from a <use>d element/image be accessible from the
> main SVG?
> Just as usefully, should we be able to combine some graphical elements
> and script into an SVG that gets used into another SVG as a functional
> Current testing appears to say 'no'. But, I don't remember anything
> from the spec that says it shouldn't work.
> Here's the page he's working with now:
> The script from the outer image is usable, the script from inside the
> used image is not. Is that how it should be?
thought I remembered, there is no mention of the behavior of script
that is included as part of 'use'ing content. There is also no mention
of what would happen with SMIL content included in the referenced
I know the spec says that the "contents of the referenced element were
deeply cloned into a separate non-exposed DOM tree" (Section 5.6).
There is an explicit comment that the referenced information is not
available to the DOM. However, the code contained in an enclosed script
tag is not part of the DOM, so there's no suggestion about whether it
should be interpreted.
Do any implementations pay any attention to child script or SMIL tags
nested within referenced content?
We've all heard that a million monkeys banging on a million typewriters
will eventually reproduce the works of Shakespeare. Now, thanks to the
Internet, we know this is not true. -- Robert Wilensky, UCB