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

Hi Jeff,

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

  http://lists.w3.org/Archives/Public/www-svg/2006Jan/0051.html

 

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

 

Jon Ferraiolo

SVG WG

 

-----------------------------

From: Jeff Schiller <codedread@gmail.com
<mailto:codedread@gmail.com?Subject=Re%3A%20%5BSVGMobile12%5D%20SVGEleme
ntInstance%2C%20EventTarget%2C%20currentTarget%2C%20use%20and%20defs&In-
Reply-To=%253Cda131fde0601030647x2fa0a4fbvb7db34eded615a4c%40mail.gmail.
com%253E&References=%253Cda131fde0601030647x2fa0a4fbvb7db34eded615a4c%40
mail.gmail.com%253E> > 
Date: Tue, 3 Jan 2006 08:47:32 -0600
Message-ID:
<da131fde0601030647x2fa0a4fbvb7db34eded615a4c@mail.gmail.com> 
To: www-svg@w3.org
<mailto:www-svg@w3.org?Subject=Re%3A%20%5BSVGMobile12%5D%20SVGElementIns
tance%2C%20EventTarget%2C%20currentTarget%2C%20use%20and%20defs&In-Reply
-To=%253Cda131fde0601030647x2fa0a4fbvb7db34eded615a4c%40mail.gmail.com%2
53E&References=%253Cda131fde0601030647x2fa0a4fbvb7db34eded615a4c%40mail.
gmail.com%253E>  
 
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
SVGElementInstance."
 
- 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
SVGElementInstance?
 
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