Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 236215 Support mouseenter and mouseleave
Starred by 8 users Reported by stepien....@gmail.com, Apr 28 2013 Back to list
Status: Fixed
Owner: mkwst@chromium.org
Closed: Jul 2013
Cc: meh@chromium.org
Components:
OS: All
Pri: 2
Type: Feature

Blocking:
issue 176671


Sign in to add a comment
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31

Steps to reproduce the problem:
WebKit added support for mouseenter and mouseleave, would love Blink to port this patch.

What is the expected behavior?

What went wrong?
http://trac.webkit.org/changeset/149173

Did this work before? No 

Chrome version: 26.0.1410.63  Channel: stable
OS Version:
 
Comment 1 by tkent@chromium.org, Apr 30 2013
Labels: Cr-Blink
Comment 2 by Deleted ...@, May 9 2013
Please, support mouseenter/mouseleave as soon as possible. Google Chrome is not that last browser that remains with this unimplemented.

MouseEnter and MouseLeave are events defined by W3C, and will be fine if implemented:

http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-mouseenter
http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-mouseleave

Of course there are some workarrounds, but there are not as fine as a native solution.

Thanks for your work!
Comment 3 by mkwst@chromium.org, Jun 30 2013
Owner: mkwst@chromium.org
It's a good patch. I'll work on porting this over.
Comment 4 by mkwst@chromium.org, Jun 30 2013
Cc: meh@chromium.org
Status: Assigned
Comment 5 by mkwst@chromium.org, Jul 2 2013
Blocking: chromium:176671
Project Member Comment 6 by bugdroid1@chromium.org, Jul 8 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=153664

------------------------------------------------------------------------
r153664 | mkwst@chromium.org | 2013-07-08T09:52:21.535238Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/TestExpectations?r1=153664&r2=153663&pathrev=153664
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Document.cpp?r1=153664&r2=153663&pathrev=153664

Optimize (slightly) Document::updateHoverActiveState.

When walking up the chain of potentially effected elements, we can stop
updating hover state as soon as we hit the common ancestor of the newly
hovered element and the previously hovered element. This is a tiny
optimization; it should result in no web-visible change in behavior.

This patch is extracted from the larger mouseenter/mouseleave WebKit
patch[1] submitted by allan.jensen@digia.com (carewolf), reviewed by
David Hyatt.

[1]: http://trac.webkit.org/changeset/149173,

BUG= 236215 

Review URL: https://chromiumcodereview.appspot.com/18297002
------------------------------------------------------------------------
Project Member Comment 7 by bugdroid1@chromium.org, Jul 10 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=153877

------------------------------------------------------------------------
r153877 | mkwst@chromium.org | 2013-07-10T10:08:28.807278Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/page/DOMWindow.h?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/EventNames.h?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Document.cpp?r1=153877&r2=153876&pathrev=153877
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/events/mouseenter-mouseleave-chained-listeners-expected.txt?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/svg/SVGElementInstance.cpp?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Element.idl?r1=153877&r2=153876&pathrev=153877
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/events/mouseenter-mouseleave-inline-attributes-expected.txt?r1=153877&r2=153876&pathrev=153877
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/events/mouseenter-mouseleave-expected.txt?r1=153877&r2=153876&pathrev=153877
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/events/mouseenter-mouseleave-capture-expected.txt?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Document.h?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/svg/SVGElementInstance.h?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLAttributeNames.in?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/EventListenerMap.cpp?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/svg/SVGElement.cpp?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/page/Window.idl?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/MouseEvent.cpp?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/EventListenerMap.h?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/EventTarget.h?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Element.h?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLElement.cpp?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/svg/SVGElementInstance.idl?r1=153877&r2=153876&pathrev=153877
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/events/mouseenter-mouseleave-chained-listeners.html?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Document.idl?r1=153877&r2=153876&pathrev=153877
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/events/mouseenter-mouseleave-inline-attributes.html?r1=153877&r2=153876&pathrev=153877
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/events/mouseenter-mouseleave.html?r1=153877&r2=153876&pathrev=153877
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/events/mouseenter-mouseleave-capture.html?r1=153877&r2=153876&pathrev=153877
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/scripts/CodeGeneratorV8.pm?r1=153877&r2=153876&pathrev=153877

Implement 'mouseenter' and 'mouseleave' from DOM Level 3 Events.

This patch adds 'mouseenter' and 'mouseleave' as accepted event names in
a variety of places, and does the core of the implementation inside
Document::updateHoverActiveState. Since we're already doing all the
testing there to determine hover state (which 'mouseenter'/'mouseleave'
closely mirrors), that method now accepts a PlatformMouseEvent*
parameter, using it to directly dispatch the new events on relevant
nodes.

A bit of logic has also been added to that method to ensure that we only
generate events when an event handler is listening for them, as
performance is otherwise slightly less than awesome. This optimization
requires the addition of an EventTarget method to determine if capturing
event listeners exist (which requires the addition of an
EventListenerMap method to do the dirty work).

This patch is a lightly modified version of the mouseenter/mouseleave
WebKit patch[1] submitted by allan.jensen@digia.com (carewolf), reviewed
by David Hyatt.

[1]: http://trac.webkit.org/changeset/149173

BUG= 236215 

Review URL: https://chromiumcodereview.appspot.com/18836002
------------------------------------------------------------------------
Hooray
Comment 9 by mkwst@chromium.org, Jul 28 2013
Status: Fixed
Labels: -OS-Linux OS-All M-30
This implementation does not work like IE/Firefox when it comes to mouseenter events triggered by DOM-changes instead of mouse movement.

I created a new bug, but maybe I should have commented here also/instead. Since this will soon enter stable, I'll add a reference here and hope somebody notices. https://code.google.com/p/chromium/issues/detail?id=276329
Sign in to add a comment