Re: Should the base svg tag receive events?

On 8/13/10 1:08 PM, Domenico Strazzullo wrote:
> The currentTarget is the element
> on which the event was registered;

Yes.

> 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.

-Boris

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