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

Re: Should the base svg tag receive events?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 23 Aug 2010 01:51:49 -0400
Message-ID: <4C720C75.7080302@mit.edu>
To: Domenico Strazzullo <nst@dotuscomus.com>
CC: www-svg@w3.org
On 8/13/10 1:08 PM, Domenico Strazzullo wrote:
> The currentTarget is the element
> on which the event was registered;


> if that element is not suitable as
> target then the implementation ignores (rather than discard) the event.

There is no concept of "not suitable as target" in DOM Events.  For a 
bubbling event, all ancestors of the event target will have the event 
bubble to them (unless stopPropagation is called).

> Note that in Opera, Firefox, Chrome and Safari, pointer events
> registered on an outmost svg container with no graphical elements
> (strictly empty), do trigger the event handler(s). In ASV they don't.
> It's interesting that both the currentTarget and the target properties
> designate the svg element, whereas to be strict only the currentTarget
> should

Well, what would you expect the target to be in that case?

> To say that this would be the right way is arbitrary. A target cannot be
> the nearest ancestor in any case.

Well... the target of a click event should be some EventTarget (vacuous 
statement there).  But for every click that happens, a click event needs 
to fire.  The only question is where to target it.  Once you decide what 
the target is, DOM Events takes over from there in terms of what event 
listeners fire.

> What you really need is to check where
> the capturing phase originates, is it the svg document or the Document
> object (as: parent, window)? I honestly don't know. Then you can check
> with the bubbling phase also

The target is the same in both phases, by definition of the phases. 
It's an invariant of the given event dispatch.

Received on Monday, 23 August 2010 05:52:23 UTC

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