Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
| 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 class EventDispatcher; | 37 class EventDispatcher; |
| 38 class HTMLIFrameElement; | 38 class HTMLIFrameElement; |
| 39 | 39 |
| 40 struct EventInit { | 40 struct EventInit { |
| 41 EventInit(); | 41 EventInit(); |
| 42 | 42 |
| 43 bool bubbles; | 43 bool bubbles; |
| 44 bool cancelable; | 44 bool cancelable; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 class Event : public ScriptWrappable, public RefCounted<Event> { | 47 class Event : public RefCountedWillBeRefCountedGarbageCollected<Event>, public ScriptWrappable { |
| 48 public: | 48 public: |
| 49 enum PhaseType { | 49 enum PhaseType { |
| 50 NONE = 0, | 50 NONE = 0, |
| 51 CAPTURING_PHASE = 1, | 51 CAPTURING_PHASE = 1, |
| 52 AT_TARGET = 2, | 52 AT_TARGET = 2, |
| 53 BUBBLING_PHASE = 3 | 53 BUBBLING_PHASE = 3 |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 enum EventType { | 56 enum EventType { |
| 57 MOUSEDOWN = 1, | 57 MOUSEDOWN = 1, |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 Event* underlyingEvent() const { return m_underlyingEvent.get(); } | 172 Event* underlyingEvent() const { return m_underlyingEvent.get(); } |
| 173 void setUnderlyingEvent(PassRefPtr<Event>); | 173 void setUnderlyingEvent(PassRefPtr<Event>); |
| 174 | 174 |
| 175 EventPath& eventPath() { ASSERT(m_eventPath); return *m_eventPath; } | 175 EventPath& eventPath() { ASSERT(m_eventPath); return *m_eventPath; } |
| 176 EventPath& ensureEventPath(); | 176 EventPath& ensureEventPath(); |
| 177 | 177 |
| 178 PassRefPtr<NodeList> path() const; | 178 PassRefPtr<NodeList> path() const; |
| 179 | 179 |
| 180 bool isBeingDispatched() const { return eventPhase(); } | 180 bool isBeingDispatched() const { return eventPhase(); } |
| 181 | 181 |
| 182 virtual void trace(Visitor*); | |
| 183 | |
| 182 protected: | 184 protected: |
| 183 Event(); | 185 Event(); |
| 184 Event(const AtomicString& type, bool canBubble, bool cancelable); | 186 Event(const AtomicString& type, bool canBubble, bool cancelable); |
| 185 Event(const AtomicString& type, const EventInit&); | 187 Event(const AtomicString& type, const EventInit&); |
| 186 | 188 |
| 187 virtual void receivedTarget(); | 189 virtual void receivedTarget(); |
| 188 bool dispatched() const { return m_target; } | 190 bool dispatched() const { return m_target; } |
| 189 | 191 |
| 190 private: | 192 private: |
| 191 AtomicString m_type; | 193 AtomicString m_type; |
| 192 bool m_canBubble; | 194 bool m_canBubble; |
| 193 bool m_cancelable; | 195 bool m_cancelable; |
| 194 | 196 |
| 195 bool m_propagationStopped; | 197 bool m_propagationStopped; |
| 196 bool m_immediatePropagationStopped; | 198 bool m_immediatePropagationStopped; |
| 197 bool m_defaultPrevented; | 199 bool m_defaultPrevented; |
| 198 bool m_defaultHandled; | 200 bool m_defaultHandled; |
| 199 bool m_cancelBubble; | 201 bool m_cancelBubble; |
| 200 | 202 |
| 201 unsigned short m_eventPhase; | 203 unsigned short m_eventPhase; |
| 202 EventTarget* m_currentTarget; | 204 EventTarget* m_currentTarget; |
| 203 RefPtr<EventTarget> m_target; | 205 RefPtr<EventTarget> m_target; |
| 204 DOMTimeStamp m_createTime; | 206 DOMTimeStamp m_createTime; |
| 205 RefPtr<Event> m_underlyingEvent; | 207 RefPtr<Event> m_underlyingEvent; |
|
Erik Corry
2014/02/28 14:08:52
I wonder why this was not a traced Member?
| |
| 206 OwnPtr<EventPath> m_eventPath; | 208 OwnPtr<EventPath> m_eventPath; |
| 207 }; | 209 }; |
| 208 | 210 |
| 209 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ | 211 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ |
| 210 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName()) | 212 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName()) |
| 211 | 213 |
| 212 } // namespace WebCore | 214 } // namespace WebCore |
| 213 | 215 |
| 214 #endif // Event_h | 216 #endif // Event_h |
| OLD | NEW |