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

Re: Pointer-events Suggestion

From: Jeff Schiller <codedread@gmail.com>
Date: Thu, 5 Nov 2009 21:45:04 -0600
Message-ID: <da131fde0911051945m3ddd199dmdb45def494ab7573@mail.gmail.com>
To: Alex Danilo <alex@abbra.com>
Cc: www-svg@w3.org
My only solution is a hack :(

Basically an invisible rect over the whole UI that receives all mouse
events.  Then use SVGSVGElement.getIntersectionList() on a tiny rect
centered on the mouse event.  This is a horrible hack, I know.

Unfortunately (fortunately?) getIntersectionList()/getEnclosureList()
are not implemented cross-browser, specifically Firefox.

Jeff

2009/11/5 Alex Danilo <alex@abbra.com>:
>
> Hi Ryan,
>
> --Original Message--:
>>>You should be able to attach an event handler on both rectangles and
>>
>>>both will receive the event.
>>
>>
>>
>>>That is standard DOM event bubbling behaviour.
>>
>>
>>
>>>If you're not getting events on both rectangles, then it's
>>
>>>likely the user agent you're using is buggy.
>>
>>
>>
>>>Cheers,
>>
>>>Alex
>>
>>
>>Thanks for the tip, Alex. This would certainly work in some cases but, unless Iím missing something, I believe itís only when one rectangle is a DOM child/descendant of the other, right? My rectangles are DOM siblings, and sometimes not even siblings but nieces and nephews. As I understand it, the bubbling event only moves along the DOM via parent/child relationships on itís way to itís target. My other rectangle isnít in the path of event travel so it never would never receive the event.
>
> Yes, good point. Capture/bubbling does require the ancestry relationships to work.
>
> That's certainly an interesting use-case you have. Maybe other †people will have
> some useful suggestions.
>
> Cheers,
> Alex
>
>>Ryan
>>
>>
>>
>>
>
>
>
Received on Friday, 6 November 2009 03:45:36 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:43 GMT