#include "core/dom/ExceptionCode.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/frame/DOMWindow.h"
-#include "platform/UserGestureIndicator.h"
#include "wtf/StdLibExtras.h"
#include "wtf/Vector.h"
return removeEventListener(eventType, listener, false);
}
-bool EventTarget::dispatchEvent(PassRefPtr<Event> event, ExceptionState& exceptionState)
+bool EventTarget::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event, ExceptionState& exceptionState)
{
if (!event) {
exceptionState.throwDOMException(InvalidStateError, "The event provided is null.");
return dispatchEvent(event);
}
-bool EventTarget::dispatchEvent(PassRefPtr<Event> event)
+bool EventTarget::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event)
{
event->setTarget(this);
event->setCurrentTarget(this);
EventListenerVector* listenersVector = d->eventListenerMap.find(event->type());
if (!RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && (event->type() == EventTypeNames::animationiteration || event->type() == EventTypeNames::animationend
- || event->type() == EventTypeNames::animationstart))
+ || event->type() == EventTypeNames::animationstart)
+ // Some code out-there uses custom events to dispatch unprefixed animation events manually,
+ // we can safely remove all this block when cssAnimationUnprefixedEnabled is always on, this
+ // is really a special case. DO NOT ADD MORE EVENTS HERE.
+ && event->interfaceName() != EventNames::CustomEvent)
listenersVector = 0;
if (listenersVector) {
UseCounter::count(executingWindow->document(), UseCounter::DocumentUnloadFired);
}
- bool userEventWasHandled = false;
size_t i = 0;
size_t size = entry.size();
if (!d->firingEventIterators)
// To match Mozilla, the AT_TARGET phase fires both capturing and bubbling
// event listeners, even though that violates some versions of the DOM spec.
registeredListener.listener->handleEvent(context, event);
- if (!userEventWasHandled && UserGestureIndicator::processingUserGesture())
- userEventWasHandled = true;
InspectorInstrumentation::didHandleEvent(cookie);
}
d->firingEventIterators->removeLast();
- if (userEventWasHandled) {
- if (ExecutionContext* context = executionContext())
- context->userEventWasHandled();
- }
}
const EventListenerVector& EventTarget::getEventListeners(const AtomicString& eventType)