OLD | NEW |
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 bool EventTarget::fireEventListeners(Event* event) | 195 bool EventTarget::fireEventListeners(Event* event) |
196 { | 196 { |
197 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); | 197 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); |
198 ASSERT(event && !event->type().isEmpty()); | 198 ASSERT(event && !event->type().isEmpty()); |
199 | 199 |
200 EventTargetData* d = eventTargetData(); | 200 EventTargetData* d = eventTargetData(); |
201 if (!d) | 201 if (!d) |
202 return true; | 202 return true; |
203 | 203 |
204 EventListenerVector* listenerPrefixedVector = 0; | 204 EventListenerVector* legacyListenersVector = 0; |
205 AtomicString prefixedTypeName = legacyType(event); | 205 AtomicString legacyTypeName = legacyType(event); |
206 if (!prefixedTypeName.isEmpty()) | 206 if (!legacyTypeName.isEmpty()) |
207 listenerPrefixedVector = d->eventListenerMap.find(prefixedTypeName); | 207 legacyListenersVector = d->eventListenerMap.find(legacyTypeName); |
208 | 208 |
209 EventListenerVector* listenerUnprefixedVector = d->eventListenerMap.find(eve
nt->type()); | 209 EventListenerVector* listenersVector = d->eventListenerMap.find(event->type(
)); |
210 | 210 |
211 if (listenerUnprefixedVector) | 211 if (listenersVector) { |
212 fireEventListeners(event, d, *listenerUnprefixedVector); | 212 fireEventListeners(event, d, *listenersVector); |
213 else if (listenerPrefixedVector) { | 213 } else if (legacyListenersVector) { |
214 AtomicString unprefixedTypeName = event->type(); | 214 AtomicString unprefixedTypeName = event->type(); |
215 event->setType(prefixedTypeName); | 215 event->setType(legacyTypeName); |
216 fireEventListeners(event, d, *listenerPrefixedVector); | 216 fireEventListeners(event, d, *legacyListenersVector); |
217 event->setType(unprefixedTypeName); | 217 event->setType(unprefixedTypeName); |
218 } | 218 } |
219 | 219 |
220 if (prefixedTypeName == eventNames().webkitTransitionEndEvent) { | 220 if (legacyTypeName == eventNames().webkitTransitionEndEvent) { |
221 if (DOMWindow* executingWindow = this->executingWindow()) { | 221 if (DOMWindow* executingWindow = this->executingWindow()) { |
222 if (listenerPrefixedVector) { | 222 if (legacyListenersVector) { |
223 if (listenerUnprefixedVector) | 223 if (listenersVector) |
224 UseCounter::count(executingWindow, UseCounter::PrefixedAndUn
prefixedTransitionEndEvent); | 224 UseCounter::count(executingWindow, UseCounter::PrefixedAndUn
prefixedTransitionEndEvent); |
225 else | 225 else |
226 UseCounter::count(executingWindow, UseCounter::PrefixedTrans
itionEndEvent); | 226 UseCounter::count(executingWindow, UseCounter::PrefixedTrans
itionEndEvent); |
227 } else if (listenerUnprefixedVector) { | 227 } else if (listenersVector) { |
228 UseCounter::count(executingWindow, UseCounter::UnprefixedTransit
ionEndEvent); | 228 UseCounter::count(executingWindow, UseCounter::UnprefixedTransit
ionEndEvent); |
229 } | 229 } |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
233 return !event->defaultPrevented(); | 233 return !event->defaultPrevented(); |
234 } | 234 } |
235 | 235 |
236 void EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList
enerVector& entry) | 236 void EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList
enerVector& entry) |
237 { | 237 { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 // they have one less listener to invoke. | 310 // they have one less listener to invoke. |
311 if (d->firingEventIterators) { | 311 if (d->firingEventIterators) { |
312 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { | 312 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { |
313 d->firingEventIterators->at(i).iterator = 0; | 313 d->firingEventIterators->at(i).iterator = 0; |
314 d->firingEventIterators->at(i).end = 0; | 314 d->firingEventIterators->at(i).end = 0; |
315 } | 315 } |
316 } | 316 } |
317 } | 317 } |
318 | 318 |
319 } // namespace WebCore | 319 } // namespace WebCore |
OLD | NEW |