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

Fw: The intersection of scripting and the use element

From: G. Wade Johnson <gwadej@anomaly.org>
Date: Mon, 8 Nov 2010 07:06:38 -0600
To: www-svg@w3.org
Message-ID: <20101108070638.589d7710@sovvan>
(Drat, forgot to "reply all").

Hi Boris,

On Sun, 07 Nov 2010 23:10:46 -0500
Boris Zbarsky <bzbarsky@MIT.EDU> wrote:

> On 11/7/10 10:52 PM, G. Wade Johnson wrote:
> > 3. "The effect of a ‘use’ element is as if the contents of the
> >     referenced element were deeply cloned into a separate
> > non-exposed DOM tree which had the ‘use’ element as its parent and
> > all of the ‘use’ element's ancestors as its higher-level ancestors."
> >
> > This statement does not make any distinctions about the kinds of
> > elements copied. It is conceivable "the contents of the referenced
> > element" would apply to script elements included within a referenced
> > 'g' element.
> Note that when a <script> element that has already run is cloned by a 
> browser the clone is marked with a "do not execute" flag...


> > 4. "The event handling for the non-exposed tree works as if the
> >     referenced element had been textually included as a deeply
> > cloned child of the ‘use’ element, except that events are
> > dispatched to the SVGElementInstance objects."
> >
> > Now this could imply that at least event handling attributes are
> > have the appropriate scripting copied from the reference. However,
> > experimentation suggests that the copied hander references scripting
> > from the referencing document, not the referenced document. This
> > seems somewhat counter-intuitive.
> It's consistent with them being cloned and then inserted, no?

The code does not run at all in the referenced document, so I would
think this would be different.

> > Does anyone know what the intent of the 'use' element with respect
> > to referenced scripting is? Whichever way this should be
> > interpreted, the specification should probably be more clear on
> > this point.
> It really sounds like you're looking for something more like XBL than 
> <use> elements...

Actually, I'm looking to understand what SVG is intended to support at
the moment. I'm really okay with either outcome, but there's seems to
be a genuine fuzzy spot here in the spec.

G. Wade

Machines take me by surprise with great frequency.    -- Alan Turing

There are only two kinds of programming languages: those people always
bitch about and those nobody uses.              -- Bjarne Stroustrup
Received on Monday, 8 November 2010 13:07:14 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:29 UTC