W3C home > Mailing lists > Public > www-svg@w3.org > February 2006

Re: [SVGMobile12] SVGElementInstance, EventTarget, currentTarget, use and defs

From: Jon Ferraiolo <jonf@adobe.com>
Date: Sun, 19 Feb 2006 17:31:01 -0800
Message-ID: <6ECA24BE410D994496A2AE995367C5C87266D8@namail3.corp.adobe.com>
To: "Jeff Schiller" <codedread@gmail.com>
Cc: <www-svg@w3.org>
Hi Jeff,

This email is the official Last Call response to your comment at:



Our response is inline within your original email, prefixed by
"RESPONSE:". If our response is unsatisfactory, please tell us within
two weeks.


Jon Ferraiolo




From: Jeff Schiller <codedread@gmail.com
mail.gmail.com%253E> > 
Date: Tue, 3 Jan 2006 08:47:32 -0600
To: www-svg@w3.org
I'm really having trouble understanding several things related to
element instances from the IDL Appendix:
Section A.4.3 describes the Event interface where it states:  "If an
event target is an element instance (see SVGElementInstance), the
currentTarget is an implementation of EventTarget that does not
implement the Node interface. In profiles of SVG that support the
SVGElementInstance interface, the currentTarget is an
- first, currentTarget is of type EventTarget which does not include
the Node interface, so this first sentence seems redundant to me
- second, how can you have an IDL attribute that returns either an
EventTarget or a SVGElementInstance depending on whether the
SVGElementInstance is supported?  Could an implementation not support
RESPONSE: Thanks for pointing out the confusing wording. The extra
sentences within A.4.3 about element instances are unnecessary and
confusing. As you point out, the target is of type EventTarget which
does not include Node. Because these sentences are unnecessary and only
serve to confuse, we will remove them.
Next, looking at Section A.7.3 (SVGElementInstance) it states in the
example "Worth noticing is that if the original 'rect' had not been in
the 'defs' element the script would go into error when the original
'rect' is clicked. This is becouse the 'currentTarget' attribute would
return an 'SVGElement' that doesen't have the
'correspondingUseElement' attribute."
This states that currentTarget would be a SVGElement (not a simple
EventTarget or a SVGElementInstance as in Section A.4.3) if the rect
was outside of the 'defs' element.  I couldn't determine why if the
rect is not in the 'defs' element that the behavior would be different
for the "use" elements.  I couldn't find this in "use" (5.6) or "defs"
(5.3) sections.
Can you please clarify the behavior between EventTarget, currentTarget
attribute, SVGElementInstance, use and defs for me?  It's likely that
I'm just not connecting the dots properly in my head but I feel the
text could be clarified in the listed sections.
RESPONSE: Here is my attempt to connect the dots. If the rectangle r1
were not surrounded by defs, it would get rendered to the screen and
thus could be clicked. If it were clicked, then the event handler in the
example would get invoked. The event handler would attempt to use
ECMAScript dot notation to find the "correspondingUseElement" for the r1
object (which would be the currentTarget). But since r1 is a rectangle
and not a use, it does not support the SVGElementInstance interface, so
there is no correspondingUseElement, so an exception would be raised.

Received on Monday, 20 February 2006 01:34:29 UTC

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