ASSERT(m_wheelEventHandlerCount > 0) can fire
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2012 17:39:07 +0000 (17:39 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2012 17:39:07 +0000 (17:39 +0000)
commitd9242aa81fa7f8d87d7230009157218dabffd38a
tree840706e96f6b2b04eaa4d1b5ec04a953cb0e5cbe
parent23bebc9a8b14dc3becb3de4c9a44663750a7f029
ASSERT(m_wheelEventHandlerCount > 0) can fire
https://bugs.webkit.org/show_bug.cgi?id=89856

Reviewed by Eric Seidel.

Source/WebCore:

When a node with a wheel or a touch event is moved from one document to
another, the didAddMumble/didRemoveMumble calls do not balance because
they're called on different documents. This patch twiddles the counts
appropriately in that case.

Test: fast/events/move-element-with-wheel-and-touch-event-listeners.html

* dom/EventNames.h:
(WebCore::EventNames::isTouchEventType):
(EventNames):
(WebCore::EventNames::touchEventNames):
* dom/Node.cpp:
(WebCore::Node::didMoveToNewDocument):

LayoutTests:

Test what happens when we move a node with wheel and/or touch events
from one document to another. Prior to this patch, this test triggers
ASSERT(m_wheelEventHandlerCount > 0) in Document.cpp.

* fast/events/move-element-with-wheel-and-touch-event-listeners-expected.txt: Added.
* fast/events/move-element-with-wheel-and-touch-event-listeners.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121166 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/move-element-with-wheel-and-touch-event-listeners-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/move-element-with-wheel-and-touch-event-listeners.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/EventNames.h
Source/WebCore/dom/Node.cpp