W3C home > Mailing lists > Public > www-svg@w3.org > September 2011

Re: a minor confusion concerning mouse events

From: Rick <graham.rick@gmail.com>
Date: Mon, 12 Sep 2011 10:38:50 -0400
Message-ID: <CAGDjS3fg4QM8Q1J3dLUBVAvJV_WUO+_HscFhHVdjqovODF_d0g@mail.gmail.com>
To: olli@pettay.fi
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, David Dailey <ddailey@zoominternet.net>, www-svg@w3.org
On Mon, Sep 12, 2011 at 10:22 AM, Olli Pettay <Olli.Pettay@helsinki.fi> wrote:
> On 09/12/2011 01:46 AM, Tab Atkins Jr. wrote:
>>
>> On Sun, Sep 11, 2011 at 9:44 PM, Olli Pettay<Olli.Pettay@helsinki.fi>
>>  wrote:
>>>
>>> On 09/10/2011 09:49 AM, Tab Atkins Jr. wrote:
>>>>
>>>> IE exposes the much more useful (non-bubbling) mouseenter and
>>>> mouseleave events,
>>>
>>> mouseenter/leave are perhaps useful, but easily quite slow, since they
>>> need to be fired a lot more often.
>>
>> Hm, this doesn't make sense to me.  Ignoring any optimizations based
>> on registration, it seems like enter/leave are still fired *less* than
>> over/out.  over/out get fired on *every* transition between elements.
>
> Right, when mouse moves from top of some element to top of some other
> element, there is mouseout/mouseover

I haven't read every bit of this thread, so I'm not sure if this has
been mentioned.

It's true, when you have a complex graphic, mouseover / mouseout
events are thrown constantly, there is no simple way around this that
won't break something else.  I can't visualize a way to fix it in the
spec that is useful and not overly complex.

The way to deal with the issue is to use the facilities that SVG
provides.  Throwing up a mask element that is painted on top / last,
is transparent, and exists solely as an event trap avoids all of these
issues.  Some may call it a hack, I call it a simple elegant solution
that negates these problems.

-- 
Religion is regarded by the common people as true,
by the wise as false,
and by the rulers as useful.

— Lucius Annĉus Seneca.

Terrorism, the new religion.
Received on Monday, 12 September 2011 14:39:26 GMT

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