| 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 19 matching lines...) Expand all Loading... |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #include "core/events/EventTarget.h" | 32 #include "core/events/EventTarget.h" |
| 33 | 33 |
| 34 #include "bindings/core/v8/ExceptionState.h" | 34 #include "bindings/core/v8/ExceptionState.h" |
| 35 #include "bindings/core/v8/V8AbstractEventListener.h" | 35 #include "bindings/core/v8/V8AbstractEventListener.h" |
| 36 #include "bindings/core/v8/V8DOMActivityLogger.h" | 36 #include "bindings/core/v8/V8DOMActivityLogger.h" |
| 37 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
| 38 #include "core/editing/Editor.h" | 38 #include "core/editing/Editor.h" |
| 39 #include "core/events/Event.h" | 39 #include "core/events/Event.h" |
| 40 #include "core/events/EventUtil.h" |
| 40 #include "core/inspector/InspectorInstrumentation.h" | 41 #include "core/inspector/InspectorInstrumentation.h" |
| 41 #include "core/frame/LocalDOMWindow.h" | 42 #include "core/frame/LocalDOMWindow.h" |
| 42 #include "core/frame/UseCounter.h" | 43 #include "core/frame/UseCounter.h" |
| 43 #include "platform/EventDispatchForbiddenScope.h" | 44 #include "platform/EventDispatchForbiddenScope.h" |
| 44 #include "wtf/StdLibExtras.h" | 45 #include "wtf/StdLibExtras.h" |
| 45 #include "wtf/Threading.h" | 46 #include "wtf/Threading.h" |
| 46 #include "wtf/Vector.h" | 47 #include "wtf/Vector.h" |
| 47 | 48 |
| 48 using namespace WTF; | 49 using namespace WTF; |
| 49 | 50 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 178 |
| 178 RegisteredEventListener registeredListener; | 179 RegisteredEventListener registeredListener; |
| 179 bool added = ensureEventTargetData().eventListenerMap.add(eventType, listene
r, options, ®isteredListener); | 180 bool added = ensureEventTargetData().eventListenerMap.add(eventType, listene
r, options, ®isteredListener); |
| 180 if (added) | 181 if (added) |
| 181 addedEventListener(eventType, registeredListener); | 182 addedEventListener(eventType, registeredListener); |
| 182 return added; | 183 return added; |
| 183 } | 184 } |
| 184 | 185 |
| 185 void EventTarget::addedEventListener(const AtomicString& eventType, RegisteredEv
entListener& registeredListener) | 186 void EventTarget::addedEventListener(const AtomicString& eventType, RegisteredEv
entListener& registeredListener) |
| 186 { | 187 { |
| 188 if (EventUtil::isPointerEventType(eventType)) { |
| 189 if (LocalDOMWindow* executingWindow = this->executingWindow()) { |
| 190 UseCounter::count(executingWindow->document(), UseCounter::PointerEv
entAddListenerCount); |
| 191 } |
| 192 } |
| 187 } | 193 } |
| 188 | 194 |
| 189 bool EventTarget::removeEventListener(const AtomicString& eventType, const Event
Listener* listener, bool useCapture) | 195 bool EventTarget::removeEventListener(const AtomicString& eventType, const Event
Listener* listener, bool useCapture) |
| 190 { | 196 { |
| 191 EventListenerOptions options; | 197 EventListenerOptions options; |
| 192 setDefaultEventListenerOptionsLegacy(options, useCapture); | 198 setDefaultEventListenerOptionsLegacy(options, useCapture); |
| 193 return removeEventListenerInternal(eventType, listener, options); | 199 return removeEventListenerInternal(eventType, listener, options); |
| 194 } | 200 } |
| 195 | 201 |
| 196 bool EventTarget::removeEventListener(const AtomicString& eventType, const Event
Listener* listener, const EventListenerOptionsOrBoolean& optionsUnion) | 202 bool EventTarget::removeEventListener(const AtomicString& eventType, const Event
Listener* listener, const EventListenerOptionsOrBoolean& optionsUnion) |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 // they have one less listener to invoke. | 524 // they have one less listener to invoke. |
| 519 if (d->firingEventIterators) { | 525 if (d->firingEventIterators) { |
| 520 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { | 526 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { |
| 521 d->firingEventIterators->at(i).iterator = 0; | 527 d->firingEventIterators->at(i).iterator = 0; |
| 522 d->firingEventIterators->at(i).end = 0; | 528 d->firingEventIterators->at(i).end = 0; |
| 523 } | 529 } |
| 524 } | 530 } |
| 525 } | 531 } |
| 526 | 532 |
| 527 } // namespace blink | 533 } // namespace blink |
| OLD | NEW |