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, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 virtual bool dispatchEvent(PassRefPtr<Event>); | 114 virtual bool dispatchEvent(PassRefPtr<Event>); |
115 bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&); // DOM API | 115 bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&); // DOM API |
116 virtual void uncaughtExceptionInEventHandler(); | 116 virtual void uncaughtExceptionInEventHandler(); |
117 | 117 |
118 // Used for legacy "onEvent" attribute APIs. | 118 // Used for legacy "onEvent" attribute APIs. |
119 bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr
<EventListener>, DOMWrapperWorld* isolatedWorld = 0); | 119 bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr
<EventListener>, DOMWrapperWorld* isolatedWorld = 0); |
120 EventListener* getAttributeEventListener(const AtomicString& eventType,
DOMWrapperWorld* isolatedWorld = 0); | 120 EventListener* getAttributeEventListener(const AtomicString& eventType,
DOMWrapperWorld* isolatedWorld = 0); |
121 | 121 |
122 bool hasEventListeners(); | 122 bool hasEventListeners(); |
123 bool hasEventListeners(const AtomicString& eventType); | 123 bool hasEventListeners(const AtomicString& eventType); |
| 124 bool hasCapturingEventListeners(const AtomicString& eventType); |
124 const EventListenerVector& getEventListeners(const AtomicString& eventTy
pe); | 125 const EventListenerVector& getEventListeners(const AtomicString& eventTy
pe); |
125 | 126 |
126 bool fireEventListeners(Event*); | 127 bool fireEventListeners(Event*); |
127 bool isFiringEventListeners(); | 128 bool isFiringEventListeners(); |
128 | 129 |
129 protected: | 130 protected: |
130 virtual ~EventTarget(); | 131 virtual ~EventTarget(); |
131 | 132 |
132 virtual EventTargetData* eventTargetData() = 0; | 133 virtual EventTargetData* eventTargetData() = 0; |
133 virtual EventTargetData* ensureEventTargetData() = 0; | 134 virtual EventTargetData* ensureEventTargetData() = 0; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 191 } |
191 | 192 |
192 inline bool EventTarget::hasEventListeners(const AtomicString& eventType) | 193 inline bool EventTarget::hasEventListeners(const AtomicString& eventType) |
193 { | 194 { |
194 EventTargetData* d = eventTargetData(); | 195 EventTargetData* d = eventTargetData(); |
195 if (!d) | 196 if (!d) |
196 return false; | 197 return false; |
197 return d->eventListenerMap.contains(eventType); | 198 return d->eventListenerMap.contains(eventType); |
198 } | 199 } |
199 | 200 |
| 201 inline bool EventTarget::hasCapturingEventListeners(const AtomicString& even
tType) |
| 202 { |
| 203 EventTargetData* d = eventTargetData(); |
| 204 if (!d) |
| 205 return false; |
| 206 return d->eventListenerMap.containsCapturing(eventType); |
| 207 } |
| 208 |
200 } // namespace WebCore | 209 } // namespace WebCore |
201 | 210 |
202 #endif // EventTarget_h | 211 #endif // EventTarget_h |
OLD | NEW |