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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 bool clearAttributeEventListener(const AtomicString& eventType); | 120 bool clearAttributeEventListener(const AtomicString& eventType); |
121 EventListener* getAttributeEventListener(const AtomicString& eventType); | 121 EventListener* getAttributeEventListener(const AtomicString& eventType); |
122 | 122 |
123 bool hasEventListeners(); | 123 bool hasEventListeners(); |
124 bool hasEventListeners(const AtomicString& eventType); | 124 bool hasEventListeners(const AtomicString& eventType); |
125 const EventListenerVector& getEventListeners(const AtomicString& eventTy
pe); | 125 const EventListenerVector& getEventListeners(const AtomicString& eventTy
pe); |
126 | 126 |
127 bool fireEventListeners(Event*); | 127 bool fireEventListeners(Event*); |
128 bool isFiringEventListeners(); | 128 bool isFiringEventListeners(); |
129 | 129 |
130 // We can't pass an EventTarget pointer into Visitor::visit directly | 130 // We can't pass an EventTarget pointer into Visitor::mark directly |
131 // because it does not coincide with the actual start of the object and | 131 // because it does not coincide with the actual start of the object and |
132 // the visitor has to access the object header. Thus we need a helper | 132 // the visitor has to access the object header. Thus we need a helper |
133 // method that correctly adjusts the pointer before passing it into the | 133 // method that correctly adjusts the pointer before passing it into the |
134 // visitor. | 134 // visitor. |
135 virtual void visitWith(Visitor*) const = 0; | 135 virtual void adjustAndMark(Visitor*) const = 0; |
136 | 136 |
137 protected: | 137 protected: |
138 virtual ~EventTarget(); | 138 virtual ~EventTarget(); |
139 | 139 |
140 virtual EventTargetData* eventTargetData() = 0; | 140 virtual EventTargetData* eventTargetData() = 0; |
141 virtual EventTargetData* ensureEventTargetData() = 0; | 141 virtual EventTargetData* ensureEventTargetData() = 0; |
142 | 142 |
143 private: | 143 private: |
144 void fireEventListeners(Event*, EventTargetData*, EventListenerVector&); | 144 void fireEventListeners(Event*, EventTargetData*, EventListenerVector&); |
145 | 145 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 inline bool EventTarget::hasEventListeners(const AtomicString& eventType) | 191 inline bool EventTarget::hasEventListeners(const AtomicString& eventType) |
192 { | 192 { |
193 EventTargetData* d = eventTargetData(); | 193 EventTargetData* d = eventTargetData(); |
194 if (!d) | 194 if (!d) |
195 return false; | 195 return false; |
196 return d->eventListenerMap.contains(eventType); | 196 return d->eventListenerMap.contains(eventType); |
197 } | 197 } |
198 | 198 |
199 template<> class TraceTrait<EventTarget> { | 199 template<> class TraceTrait<EventTarget> { |
200 public: | 200 public: |
201 static void visit(Visitor* visitor, const EventTarget* self) { self->vis
itWith(visitor); } | 201 static void mark(Visitor* visitor, const EventTarget* self) { self->adju
stAndMark(visitor); } |
202 | 202 |
203 static intptr_t getTypeMarker() { return 0; } | 203 static intptr_t getTypeMarker() { return 0; } |
204 | 204 |
205 #ifndef NDEBUG | 205 #ifndef NDEBUG |
206 static void checkTypeMarker(Visitor* visitor, const EventTarget* t) { } | 206 static void checkTypeMarker(Visitor* visitor, const EventTarget* t) { } |
207 #endif | 207 #endif |
208 }; | 208 }; |
209 | 209 |
210 } // namespace WebCore | 210 } // namespace WebCore |
211 | 211 |
212 #endif // EventTarget_h | 212 #endif // EventTarget_h |
OLD | NEW |