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

Unified Diff: sky/engine/core/events/EventTarget.cpp

Issue 760183003: Enable/Unprefix Animations & Transitions, add basic tests (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: patch for landing Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/events/EventTarget.h ('k') | sky/engine/core/events/EventTypeNames.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/events/EventTarget.cpp
diff --git a/sky/engine/core/events/EventTarget.cpp b/sky/engine/core/events/EventTarget.cpp
index 9d316a81a7a7d3393d8ed78318cd893b04eb87a1..a1388e77724315be1dcb16211cd1c730b68859bf 100644
--- a/sky/engine/core/events/EventTarget.cpp
+++ b/sky/engine/core/events/EventTarget.cpp
@@ -159,61 +159,12 @@ void EventTarget::uncaughtExceptionInEventHandler()
static const AtomicString& legacyType(const Event* event)
{
- if (event->type() == EventTypeNames::transitionend)
- return EventTypeNames::webkitTransitionEnd;
-
- if (event->type() == EventTypeNames::animationstart)
- return EventTypeNames::webkitAnimationStart;
-
- if (event->type() == EventTypeNames::animationend)
- return EventTypeNames::webkitAnimationEnd;
-
- if (event->type() == EventTypeNames::animationiteration)
- return EventTypeNames::webkitAnimationIteration;
-
if (event->type() == EventTypeNames::wheel)
return EventTypeNames::mousewheel;
return emptyAtom;
}
-void EventTarget::countLegacyEvents(const AtomicString& legacyTypeName, EventListenerVector* listenersVector, EventListenerVector* legacyListenersVector)
-{
- UseCounter::Feature unprefixedFeature;
- UseCounter::Feature prefixedFeature;
- UseCounter::Feature prefixedAndUnprefixedFeature;
- if (legacyTypeName == EventTypeNames::webkitTransitionEnd) {
- prefixedFeature = UseCounter::PrefixedTransitionEndEvent;
- unprefixedFeature = UseCounter::UnprefixedTransitionEndEvent;
- prefixedAndUnprefixedFeature = UseCounter::PrefixedAndUnprefixedTransitionEndEvent;
- } else if (legacyTypeName == EventTypeNames::webkitAnimationEnd) {
- prefixedFeature = UseCounter::PrefixedAnimationEndEvent;
- unprefixedFeature = UseCounter::UnprefixedAnimationEndEvent;
- prefixedAndUnprefixedFeature = UseCounter::PrefixedAndUnprefixedAnimationEndEvent;
- } else if (legacyTypeName == EventTypeNames::webkitAnimationStart) {
- prefixedFeature = UseCounter::PrefixedAnimationStartEvent;
- unprefixedFeature = UseCounter::UnprefixedAnimationStartEvent;
- prefixedAndUnprefixedFeature = UseCounter::PrefixedAndUnprefixedAnimationStartEvent;
- } else if (legacyTypeName == EventTypeNames::webkitAnimationIteration) {
- prefixedFeature = UseCounter::PrefixedAnimationIterationEvent;
- unprefixedFeature = UseCounter::UnprefixedAnimationIterationEvent;
- prefixedAndUnprefixedFeature = UseCounter::PrefixedAndUnprefixedAnimationIterationEvent;
- } else {
- return;
- }
-
- if (LocalDOMWindow* executingWindow = this->executingWindow()) {
- if (legacyListenersVector) {
- if (listenersVector)
- UseCounter::count(executingWindow->document(), prefixedAndUnprefixedFeature);
- else
- UseCounter::count(executingWindow->document(), prefixedFeature);
- } else if (listenersVector) {
- UseCounter::count(executingWindow->document(), unprefixedFeature);
- }
- }
-}
-
bool EventTarget::fireEventListeners(Event* event)
{
ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden());
@@ -229,13 +180,6 @@ bool EventTarget::fireEventListeners(Event* event)
legacyListenersVector = d->eventListenerMap.find(legacyTypeName);
EventListenerVector* listenersVector = d->eventListenerMap.find(event->type());
- if (!RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && (event->type() == EventTypeNames::animationiteration || event->type() == EventTypeNames::animationend
- || 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) {
fireEventListeners(event, d, *listenersVector);
@@ -247,7 +191,6 @@ bool EventTarget::fireEventListeners(Event* event)
}
Editor::countEvent(executionContext(), event);
- countLegacyEvents(legacyTypeName, listenersVector, legacyListenersVector);
return !event->defaultPrevented();
}
« no previous file with comments | « sky/engine/core/events/EventTarget.h ('k') | sky/engine/core/events/EventTypeNames.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698