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 18 matching lines...) Expand all Loading... |
29 * | 29 * |
30 */ | 30 */ |
31 | 31 |
32 #include "config.h" | 32 #include "config.h" |
33 #include "core/events/EventTarget.h" | 33 #include "core/events/EventTarget.h" |
34 | 34 |
35 #include "RuntimeEnabledFeatures.h" | 35 #include "RuntimeEnabledFeatures.h" |
36 #include "bindings/v8/ExceptionState.h" | 36 #include "bindings/v8/ExceptionState.h" |
37 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
38 #include "core/dom/NoEventDispatchAssertion.h" | 38 #include "core/dom/NoEventDispatchAssertion.h" |
| 39 #include "core/editing/Editor.h" |
39 #include "core/events/Event.h" | 40 #include "core/events/Event.h" |
40 #include "core/inspector/InspectorInstrumentation.h" | 41 #include "core/inspector/InspectorInstrumentation.h" |
41 #include "core/frame/DOMWindow.h" | 42 #include "core/frame/DOMWindow.h" |
42 #include "wtf/StdLibExtras.h" | 43 #include "wtf/StdLibExtras.h" |
43 #include "wtf/Vector.h" | 44 #include "wtf/Vector.h" |
44 | 45 |
45 using namespace WTF; | 46 using namespace WTF; |
46 | 47 |
47 namespace WebCore { | 48 namespace WebCore { |
48 | 49 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 271 |
271 if (listenersVector) { | 272 if (listenersVector) { |
272 fireEventListeners(event, d, *listenersVector); | 273 fireEventListeners(event, d, *listenersVector); |
273 } else if (legacyListenersVector) { | 274 } else if (legacyListenersVector) { |
274 AtomicString unprefixedTypeName = event->type(); | 275 AtomicString unprefixedTypeName = event->type(); |
275 event->setType(legacyTypeName); | 276 event->setType(legacyTypeName); |
276 fireEventListeners(event, d, *legacyListenersVector); | 277 fireEventListeners(event, d, *legacyListenersVector); |
277 event->setType(unprefixedTypeName); | 278 event->setType(unprefixedTypeName); |
278 } | 279 } |
279 | 280 |
| 281 Editor::countEvent(executionContext(), event); |
280 countLegacyEvents(legacyTypeName, listenersVector, legacyListenersVector); | 282 countLegacyEvents(legacyTypeName, listenersVector, legacyListenersVector); |
281 return !event->defaultPrevented(); | 283 return !event->defaultPrevented(); |
282 } | 284 } |
283 | 285 |
284 void EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList
enerVector& entry) | 286 void EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList
enerVector& entry) |
285 { | 287 { |
286 RefPtrWillBeRawPtr<EventTarget> protect(this); | 288 RefPtrWillBeRawPtr<EventTarget> protect(this); |
287 | 289 |
288 // Fire all listeners registered for this event. Don't fire listeners remove
d | 290 // Fire all listeners registered for this event. Don't fire listeners remove
d |
289 // during event dispatch. Also, don't fire event listeners added during even
t | 291 // during event dispatch. Also, don't fire event listeners added during even
t |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 // they have one less listener to invoke. | 372 // they have one less listener to invoke. |
371 if (d->firingEventIterators) { | 373 if (d->firingEventIterators) { |
372 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { | 374 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { |
373 d->firingEventIterators->at(i).iterator = 0; | 375 d->firingEventIterators->at(i).iterator = 0; |
374 d->firingEventIterators->at(i).end = 0; | 376 d->firingEventIterators->at(i).end = 0; |
375 } | 377 } |
376 } | 378 } |
377 } | 379 } |
378 | 380 |
379 } // namespace WebCore | 381 } // namespace WebCore |
OLD | NEW |