| 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 22 matching lines...) Expand all Loading... |
| 33 #define EventTarget_h | 33 #define EventTarget_h |
| 34 | 34 |
| 35 #include "bindings/core/v8/ScriptWrappable.h" | 35 #include "bindings/core/v8/ScriptWrappable.h" |
| 36 #include "bindings/core/v8/UnionTypesCore.h" | 36 #include "bindings/core/v8/UnionTypesCore.h" |
| 37 #include "core/CoreExport.h" | 37 #include "core/CoreExport.h" |
| 38 #include "core/EventNames.h" | 38 #include "core/EventNames.h" |
| 39 #include "core/EventTargetNames.h" | 39 #include "core/EventTargetNames.h" |
| 40 #include "core/EventTypeNames.h" | 40 #include "core/EventTypeNames.h" |
| 41 #include "core/events/EventListenerMap.h" | 41 #include "core/events/EventListenerMap.h" |
| 42 #include "platform/heap/Handle.h" | 42 #include "platform/heap/Handle.h" |
| 43 #include "public/platform/WebInputEventResult.h" |
| 43 #include "wtf/Allocator.h" | 44 #include "wtf/Allocator.h" |
| 44 #include "wtf/text/AtomicString.h" | 45 #include "wtf/text/AtomicString.h" |
| 45 | 46 |
| 46 namespace blink { | 47 namespace blink { |
| 47 | 48 |
| 48 class LocalDOMWindow; | 49 class LocalDOMWindow; |
| 49 class Event; | 50 class Event; |
| 50 class ExceptionState; | 51 class ExceptionState; |
| 51 class MessagePort; | 52 class MessagePort; |
| 52 class Node; | 53 class Node; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 132 |
| 132 bool addEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<
EventListener>, bool useCapture = false); | 133 bool addEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<
EventListener>, bool useCapture = false); |
| 133 bool addEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<
EventListener>, const EventListenerOptionsOrBoolean&); | 134 bool addEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<
EventListener>, const EventListenerOptionsOrBoolean&); |
| 134 bool addEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<
EventListener>, EventListenerOptions&); | 135 bool addEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<
EventListener>, EventListenerOptions&); |
| 135 | 136 |
| 136 bool removeEventListener(const AtomicString& eventType, PassRefPtrWillBeRawP
tr<EventListener>, bool useCapture = false); | 137 bool removeEventListener(const AtomicString& eventType, PassRefPtrWillBeRawP
tr<EventListener>, bool useCapture = false); |
| 137 bool removeEventListener(const AtomicString& eventType, PassRefPtrWillBeRawP
tr<EventListener>, const EventListenerOptionsOrBoolean&); | 138 bool removeEventListener(const AtomicString& eventType, PassRefPtrWillBeRawP
tr<EventListener>, const EventListenerOptionsOrBoolean&); |
| 138 bool removeEventListener(const AtomicString& eventType, PassRefPtrWillBeRawP
tr<EventListener>, EventListenerOptions&); | 139 bool removeEventListener(const AtomicString& eventType, PassRefPtrWillBeRawP
tr<EventListener>, EventListenerOptions&); |
| 139 virtual void removeAllEventListeners(); | 140 virtual void removeAllEventListeners(); |
| 140 | 141 |
| 141 bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 142 WebInputEventResult dispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
| 142 | 143 |
| 143 // dispatchEventForBindings is intended to only be called from | 144 // dispatchEventForBindings is intended to only be called from |
| 144 // javascript originated calls. This method will validate and may adjust | 145 // javascript originated calls. This method will validate and may adjust |
| 145 // the Event object before dispatching. | 146 // the Event object before dispatching. |
| 146 bool dispatchEventForBindings(PassRefPtrWillBeRawPtr<Event>, ExceptionState&
); | 147 bool dispatchEventForBindings(PassRefPtrWillBeRawPtr<Event>, ExceptionState&
); |
| 147 virtual void uncaughtExceptionInEventHandler(); | 148 virtual void uncaughtExceptionInEventHandler(); |
| 148 | 149 |
| 149 // Used for legacy "onEvent" attribute APIs. | 150 // Used for legacy "onEvent" attribute APIs. |
| 150 bool setAttributeEventListener(const AtomicString& eventType, PassRefPtrWill
BeRawPtr<EventListener>); | 151 bool setAttributeEventListener(const AtomicString& eventType, PassRefPtrWill
BeRawPtr<EventListener>); |
| 151 EventListener* getAttributeEventListener(const AtomicString& eventType); | 152 EventListener* getAttributeEventListener(const AtomicString& eventType); |
| 152 | 153 |
| 153 bool hasEventListeners() const; | 154 bool hasEventListeners() const; |
| 154 bool hasEventListeners(const AtomicString& eventType) const; | 155 bool hasEventListeners(const AtomicString& eventType) const; |
| 155 bool hasCapturingEventListeners(const AtomicString& eventType); | 156 bool hasCapturingEventListeners(const AtomicString& eventType); |
| 156 EventListenerVector* getEventListeners(const AtomicString& eventType); | 157 EventListenerVector* getEventListeners(const AtomicString& eventType); |
| 157 Vector<AtomicString> eventTypes(); | 158 Vector<AtomicString> eventTypes(); |
| 158 | 159 |
| 159 bool fireEventListeners(Event*); | 160 WebInputEventResult fireEventListeners(Event*); |
| 160 | 161 |
| 161 DEFINE_INLINE_VIRTUAL_TRACE() { } | 162 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 162 | 163 |
| 163 virtual bool keepEventInNode(Event*) { return false; } | 164 virtual bool keepEventInNode(Event*) { return false; } |
| 164 | 165 |
| 165 protected: | 166 protected: |
| 166 EventTarget(); | 167 EventTarget(); |
| 167 | 168 |
| 168 virtual bool addEventListenerInternal(const AtomicString& eventType, PassRef
PtrWillBeRawPtr<EventListener>, const EventListenerOptions&); | 169 virtual bool addEventListenerInternal(const AtomicString& eventType, PassRef
PtrWillBeRawPtr<EventListener>, const EventListenerOptions&); |
| 169 virtual bool removeEventListenerInternal(const AtomicString& eventType, Pass
RefPtrWillBeRawPtr<EventListener>, const EventListenerOptions&); | 170 virtual bool removeEventListenerInternal(const AtomicString& eventType, Pass
RefPtrWillBeRawPtr<EventListener>, const EventListenerOptions&); |
| 170 virtual bool dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>); | 171 virtual WebInputEventResult dispatchEventInternal(PassRefPtrWillBeRawPtr<Eve
nt>); |
| 171 | 172 |
| 172 // Subclasses should likely not override these themselves; instead, they sho
uld subclass EventTargetWithInlineData. | 173 // Subclasses should likely not override these themselves; instead, they sho
uld subclass EventTargetWithInlineData. |
| 173 virtual EventTargetData* eventTargetData() = 0; | 174 virtual EventTargetData* eventTargetData() = 0; |
| 174 virtual EventTargetData& ensureEventTargetData() = 0; | 175 virtual EventTargetData& ensureEventTargetData() = 0; |
| 175 | 176 |
| 176 private: | 177 private: |
| 177 #if !ENABLE(OILPAN) | 178 #if !ENABLE(OILPAN) |
| 178 // Subclasses should likely not override these themselves; instead, they sho
uld use the REFCOUNTED_EVENT_TARGET() macro. | 179 // Subclasses should likely not override these themselves; instead, they sho
uld use the REFCOUNTED_EVENT_TARGET() macro. |
| 179 virtual void refEventTarget() = 0; | 180 virtual void refEventTarget() = 0; |
| 180 virtual void derefEventTarget() = 0; | 181 virtual void derefEventTarget() = 0; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 using baseClass::deref; \ | 320 using baseClass::deref; \ |
| 320 private: \ | 321 private: \ |
| 321 void refEventTarget() final { ref(); } \ | 322 void refEventTarget() final { ref(); } \ |
| 322 void derefEventTarget() final { deref(); } \ | 323 void derefEventTarget() final { deref(); } \ |
| 323 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro | 324 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro |
| 324 #define REFCOUNTED_EVENT_TARGET(baseClass) DEFINE_EVENT_TARGET_REFCOUNTING(RefCo
unted<baseClass>) | 325 #define REFCOUNTED_EVENT_TARGET(baseClass) DEFINE_EVENT_TARGET_REFCOUNTING(RefCo
unted<baseClass>) |
| 325 #define REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(baseClass) DEFINE_EVENT_TARGET
_REFCOUNTING(RefCountedGarbageCollected<baseClass>) | 326 #define REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(baseClass) DEFINE_EVENT_TARGET
_REFCOUNTING(RefCountedGarbageCollected<baseClass>) |
| 326 #endif // ENABLE(OILPAN) | 327 #endif // ENABLE(OILPAN) |
| 327 | 328 |
| 328 #endif // EventTarget_h | 329 #endif // EventTarget_h |
| OLD | NEW |