Loading ...
Sorry, an error occurred while loading the content.

Re: [svg-developers] Use with script

Expand Messages
  • G. Wade Johnson
    On Wed, 27 Oct 2010 22:34:02 -0500 ... I spent some time tonight digging around in the SVG 1.1 spec. As I thought I remembered, there is no mention of the
    Message 1 of 2 , Oct 28, 2010
    • 0 Attachment
      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 element
      > 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
      > component.
      >
      > 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:
      > http://daveabbott.com/svg/control/0/
      >
      > The script from the outer image is usable, the script from inside the
      > used image is not. Is that how it should be?

      I spent some time tonight digging around in the SVG 1.1 spec. As I
      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
      content.

      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?

      G. Wade
      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.