Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1033)

Issue 18836002: Implement 'mouseenter' and 'mouseleave' from DOM Level 3 Events. (Closed)

Created:
7 years, 5 months ago by Mike West
Modified:
7 years, 5 months ago
CC:
blink-reviews, Nils Barth (inactive), jsbell+bindings_chromium.org, pdr, eae+blinkwatch, abarth-chromium, marja+watch_chromium.org, dglazkov+blink, f(malita), adamk+blink_chromium.org, haraken, Stephen Chennney, Nate Chapin, do-not-use, esprehn, ojan, eseidel, tdanderson
Visibility:
Public.

Description

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 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=153877

Patch Set 1 #

Total comments: 9

Patch Set 2 : new tests + esprehn is smart. #

Total comments: 2

Patch Set 3 : Attribute tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+570 lines, -12 lines) Patch
A LayoutTests/fast/events/mouseenter-mouseleave.html View 1 1 chunk +95 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/mouseenter-mouseleave-capture.html View 1 1 chunk +82 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/mouseenter-mouseleave-capture-expected.txt View 1 1 chunk +17 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/mouseenter-mouseleave-chained-listeners.html View 1 1 chunk +78 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/mouseenter-mouseleave-chained-listeners-expected.txt View 1 1 chunk +17 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/mouseenter-mouseleave-expected.txt View 1 1 chunk +49 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/mouseenter-mouseleave-inline-attributes.html View 1 2 1 chunk +84 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/mouseenter-mouseleave-inline-attributes-expected.txt View 1 2 1 chunk +49 lines, -0 lines 0 comments Download
M Source/bindings/scripts/CodeGeneratorV8.pm View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/Document.h View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M Source/core/dom/Document.cpp View 1 2 4 chunks +37 lines, -5 lines 0 comments Download
M Source/core/dom/Document.idl View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Element.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Element.idl View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/EventListenerMap.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/EventListenerMap.cpp View 1 chunk +14 lines, -0 lines 0 comments Download
M Source/core/dom/EventNames.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/EventTarget.h View 2 chunks +9 lines, -0 lines 0 comments Download
M Source/core/dom/MouseEvent.cpp View 2 chunks +8 lines, -6 lines 0 comments Download
M Source/core/html/HTMLAttributeNames.in View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/html/HTMLElement.cpp View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/page/DOMWindow.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/page/Window.idl View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/svg/SVGElement.cpp View 1 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/svg/SVGElementInstance.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/svg/SVGElementInstance.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/svg/SVGElementInstance.idl View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Mike West
This is a port of carewolf's WebKit patch to implement mouseenter/mouseleave. It's a pretty straightforward ...
7 years, 5 months ago (2013-07-08 10:59:47 UTC) #1
jochen (gone - plz use gerrit)
On 2013/07/08 10:59:47, Mike West (on paternity leave) wrote: > This is a port of ...
7 years, 5 months ago (2013-07-08 15:21:22 UTC) #2
PhistucK
This is exciting. I only have nits, sorry. :P https://codereview.chromium.org/18836002/diff/1/LayoutTests/fast/events/mouseenter-mouseleave-capture.html File LayoutTests/fast/events/mouseenter-mouseleave-capture.html (right): https://codereview.chromium.org/18836002/diff/1/LayoutTests/fast/events/mouseenter-mouseleave-capture.html#newcode19 LayoutTests/fast/events/mouseenter-mouseleave-capture.html:19: ...
7 years, 5 months ago (2013-07-08 17:57:25 UTC) #3
esprehn
You can't do the "look for listeners" optimization in one step, since a listener for ...
7 years, 5 months ago (2013-07-08 18:13:02 UTC) #4
Mike West
new tests + esprehn is smart.
7 years, 5 months ago (2013-07-09 09:35:11 UTC) #5
Mike West
Thanks for your comments. I've addressed them in the latest version of the patch. Would ...
7 years, 5 months ago (2013-07-09 09:37:00 UTC) #6
PhistucK
> https://codereview.chromium.org/18836002/diff/1/LayoutTests/fast/events/mouseenter-mouseleave.html > File LayoutTests/fast/events/mouseenter-mouseleave.html (right): > > https://codereview.chromium.org/18836002/diff/1/LayoutTests/fast/events/mouseenter-mouseleave.html#newcode37 > LayoutTests/fast/events/mouseenter-mouseleave.html:37: > onMouseOver="logMouseOverOutEvent(event)" > onMouseOut="logMouseOverOutEvent(event)" ...
7 years, 5 months ago (2013-07-09 09:42:33 UTC) #7
esprehn
LGTM, please add attribute tests before landing. It'd be nice if you simplified containsCapturing() or ...
7 years, 5 months ago (2013-07-10 02:13:56 UTC) #8
Mike West
On 2013/07/10 02:13:56, esprehn wrote: > I'm not a huge fan of all this stuff ...
7 years, 5 months ago (2013-07-10 06:49:35 UTC) #9
jochen (gone - plz use gerrit)
lgtm
7 years, 5 months ago (2013-07-10 06:59:06 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkwst@chromium.org/18836002/21001
7 years, 5 months ago (2013-07-10 07:37:37 UTC) #11
commit-bot: I haz the power
7 years, 5 months ago (2013-07-10 10:08:35 UTC) #12
Message was sent while issue was closed.
Change committed as 153877

Powered by Google App Engine
This is Rietveld 408576698