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

Side by Side Diff: Source/core/events/EventTarget.cpp

Issue 263553010: Make sure we correctly dispatch custom events having the same names as unprefixed animations events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if (!d) 260 if (!d)
261 return true; 261 return true;
262 262
263 EventListenerVector* legacyListenersVector = 0; 263 EventListenerVector* legacyListenersVector = 0;
264 AtomicString legacyTypeName = legacyType(event); 264 AtomicString legacyTypeName = legacyType(event);
265 if (!legacyTypeName.isEmpty()) 265 if (!legacyTypeName.isEmpty())
266 legacyListenersVector = d->eventListenerMap.find(legacyTypeName); 266 legacyListenersVector = d->eventListenerMap.find(legacyTypeName);
267 267
268 EventListenerVector* listenersVector = d->eventListenerMap.find(event->type( )); 268 EventListenerVector* listenersVector = d->eventListenerMap.find(event->type( ));
269 if (!RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && (event->type () == EventTypeNames::animationiteration || event->type() == EventTypeNames::ani mationend 269 if (!RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && (event->type () == EventTypeNames::animationiteration || event->type() == EventTypeNames::ani mationend
270 || event->type() == EventTypeNames::animationstart)) 270 || event->type() == EventTypeNames::animationstart)
271 // Some code out-there uses custom events to dispatch unprefixed animati on events manually,
272 // we can safely remove all this block when cssAnimationUnprefixedEnable d is always on, this
273 // is really a special case. DO NOT ADD MORE EVENTS HERE.
274 && event->interfaceName() != EventNames::CustomEvent)
271 listenersVector = 0; 275 listenersVector = 0;
272 276
273 if (listenersVector) { 277 if (listenersVector) {
274 fireEventListeners(event, d, *listenersVector); 278 fireEventListeners(event, d, *listenersVector);
275 } else if (legacyListenersVector) { 279 } else if (legacyListenersVector) {
276 AtomicString unprefixedTypeName = event->type(); 280 AtomicString unprefixedTypeName = event->type();
277 event->setType(legacyTypeName); 281 event->setType(legacyTypeName);
278 fireEventListeners(event, d, *legacyListenersVector); 282 fireEventListeners(event, d, *legacyListenersVector);
279 event->setType(unprefixedTypeName); 283 event->setType(unprefixedTypeName);
280 } 284 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 // they have one less listener to invoke. 371 // they have one less listener to invoke.
368 if (d->firingEventIterators) { 372 if (d->firingEventIterators) {
369 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { 373 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) {
370 d->firingEventIterators->at(i).iterator = 0; 374 d->firingEventIterators->at(i).iterator = 0;
371 d->firingEventIterators->at(i).end = 0; 375 d->firingEventIterators->at(i).end = 0;
372 } 376 }
373 } 377 }
374 } 378 }
375 379
376 } // namespace WebCore 380 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698