It should be possible to re-initialize a MutationEvent after it's been dispatched
https://bugs.webkit.org/show_bug.cgi?id=160703

Reviewed by Sam Weinig.

Source/WebCore:

It should be possible to re-initialize a MutationEvent after it's been dispatched,
similarly to Event:
- https://www.w3.org/TR/2015/WD-uievents-20151215/#widl-MutationEvent-initMutationEvent

Test: fast/events/initMutationEvent-after-dispatch.html

* dom/MutationEvent.cpp:
(WebCore::MutationEvent::initMutationEvent):

LayoutTests:

Add layout test coverage.

* fast/events/initMutationEvent-after-dispatch-expected.txt: Added.
* fast/events/initMutationEvent-after-dispatch.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@204331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/dom/MutationEvent.cpp b/Source/WebCore/dom/MutationEvent.cpp
index a61ef76..6382350 100644
--- a/Source/WebCore/dom/MutationEvent.cpp
+++ b/Source/WebCore/dom/MutationEvent.cpp
@@ -51,7 +51,7 @@
                                       const String& prevValue, const String& newValue,
                                       const String& attrName, unsigned short attrChange)
 {
-    if (dispatched())
+    if (isBeingDispatched())
         return;
 
     initEvent(type, canBubble, cancelable);