Update Document's event listener type bitfield when adopting a Node
https://bugs.webkit.org/show_bug.cgi?id=114322

Reviewed by Darin Adler.

Source/WebCore:

Without this, moving a Node between documents can silently deactivate
an event listener, if it's one of the types that whose creation is
optimized away by Document::hasListenerType.

An alternate approach would be to simply copy the old document's
bitfield over. It's a tradeoff between making adoption fast and making
the operation of any operation depending on these event types fast.
The latter seems like the right optimization given that adoption
doesn't happen very often.

Test: fast/events/event-listener-moving-documents.html

* dom/Node.cpp:
(WebCore::Node::didMoveToNewDocument): For each event listener type on the adopted node, update the new document's list of listener types.

LayoutTests:

* fast/events/event-listener-moving-documents-expected.txt: Added.
* fast/events/event-listener-moving-documents.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148072 268f45cc-cd09-0410-ab3c-d52691b4dbfc