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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 bool cancelBubble() const { return m_cancelBubble; } | 180 bool cancelBubble() const { return m_cancelBubble; } |
| 181 void setCancelBubble(bool cancel) { m_cancelBubble = cancel; } | 181 void setCancelBubble(bool cancel) { m_cancelBubble = cancel; } |
| 182 | 182 |
| 183 Event* underlyingEvent() const { return m_underlyingEvent.get(); } | 183 Event* underlyingEvent() const { return m_underlyingEvent.get(); } |
| 184 void setUnderlyingEvent(PassRefPtrWillBeRawPtr<Event>); | 184 void setUnderlyingEvent(PassRefPtrWillBeRawPtr<Event>); |
| 185 | 185 |
| 186 EventPath& eventPath() { ASSERT(m_eventPath); return *m_eventPath; } | 186 EventPath& eventPath() { ASSERT(m_eventPath); return *m_eventPath; } |
| 187 void initEventPath(Node&); | 187 void initEventPath(Node&); |
| 188 | 188 |
| 189 WillBeHeapVector<RefPtrWillBeMember<EventTarget>> path(ScriptState*) const; | 189 WillBeHeapVector<RefPtrWillBeMember<EventTarget>> path(ScriptState*) const; |
| 190 WillBeHeapVector<RefPtrWillBeMember<EventTarget>> deepPath(ScriptState*) con st; | |
| 190 | 191 |
| 191 bool isBeingDispatched() const { return eventPhase(); } | 192 bool isBeingDispatched() const { return eventPhase(); } |
| 192 | 193 |
| 193 // Events that must not leak across isolated world, similar to how | 194 // Events that must not leak across isolated world, similar to how |
| 194 // ErrorEvent behaves, can override this method. | 195 // ErrorEvent behaves, can override this method. |
| 195 virtual bool canBeDispatchedInWorld(const DOMWrapperWorld&) const { return t rue; } | 196 virtual bool canBeDispatchedInWorld(const DOMWrapperWorld&) const { return t rue; } |
| 196 | 197 |
| 197 virtual PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator(); | 198 virtual PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator(); |
| 198 | 199 |
| 199 bool isTrusted() const { return m_isTrusted; } | 200 bool isTrusted() const { return m_isTrusted; } |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 210 Event(const AtomicString& type, bool canBubble, bool cancelable, bool scoped ); | 211 Event(const AtomicString& type, bool canBubble, bool cancelable, bool scoped ); |
| 211 Event(const AtomicString& type, bool canBubble, bool cancelable, bool scoped , double platformTimeStamp); | 212 Event(const AtomicString& type, bool canBubble, bool cancelable, bool scoped , double platformTimeStamp); |
| 212 Event(const AtomicString& type, const EventInit&); | 213 Event(const AtomicString& type, const EventInit&); |
| 213 | 214 |
| 214 virtual void receivedTarget(); | 215 virtual void receivedTarget(); |
| 215 bool dispatched() const { return m_target; } | 216 bool dispatched() const { return m_target; } |
| 216 | 217 |
| 217 void setCanBubble(bool bubble) { m_canBubble = bubble; } | 218 void setCanBubble(bool bubble) { m_canBubble = bubble; } |
| 218 | 219 |
| 219 private: | 220 private: |
| 221 enum EventPathMode { | |
| 222 EmptyAfterDispatch, | |
| 223 NonEmptyAfterDispatch | |
| 224 }; | |
| 225 | |
| 220 AtomicString m_type; | 226 AtomicString m_type; |
| 221 unsigned m_canBubble:1; | 227 unsigned m_canBubble:1; |
| 222 unsigned m_cancelable:1; | 228 unsigned m_cancelable:1; |
| 223 unsigned m_scoped:1; | 229 unsigned m_scoped:1; |
| 224 | 230 |
| 225 unsigned m_propagationStopped:1; | 231 unsigned m_propagationStopped:1; |
| 226 unsigned m_immediatePropagationStopped:1; | 232 unsigned m_immediatePropagationStopped:1; |
| 227 unsigned m_defaultPrevented:1; | 233 unsigned m_defaultPrevented:1; |
| 228 unsigned m_defaultHandled:1; | 234 unsigned m_defaultHandled:1; |
| 229 unsigned m_cancelBubble:1; | 235 unsigned m_cancelBubble:1; |
| 230 unsigned m_isTrusted : 1; | 236 unsigned m_isTrusted : 1; |
| 231 unsigned m_handlingPassive : 1; | 237 unsigned m_handlingPassive : 1; |
| 232 | 238 |
| 233 unsigned short m_eventPhase; | 239 unsigned short m_eventPhase; |
| 234 RefPtrWillBeMember<EventTarget> m_currentTarget; | 240 RefPtrWillBeMember<EventTarget> m_currentTarget; |
| 235 RefPtrWillBeMember<EventTarget> m_target; | 241 RefPtrWillBeMember<EventTarget> m_target; |
| 236 DOMTimeStamp m_createTime; | 242 DOMTimeStamp m_createTime; |
| 237 RefPtrWillBeMember<Event> m_underlyingEvent; | 243 RefPtrWillBeMember<Event> m_underlyingEvent; |
| 238 OwnPtrWillBeMember<EventPath> m_eventPath; | 244 OwnPtrWillBeMember<EventPath> m_eventPath; |
| 239 // The monotonic platform time in seconds, for input events it is the | 245 // The monotonic platform time in seconds, for input events it is the |
| 240 // event timestamp provided by the host OS and reported in the original | 246 // event timestamp provided by the host OS and reported in the original |
| 241 // WebInputEvent instance. | 247 // WebInputEvent instance. |
| 242 double m_platformTimeStamp; | 248 double m_platformTimeStamp; |
| 249 | |
| 250 WillBeHeapVector<RefPtrWillBeMember<EventTarget>> pathInternal(ScriptState*, EventPathMode) const; | |
|
kochi
2016/02/25 09:49:40
nit: usually method declaration comes after enum a
hayato
2016/02/25 10:22:55
Done.
| |
| 243 }; | 251 }; |
| 244 | 252 |
| 245 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ | 253 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ |
| 246 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName()) | 254 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName()) |
| 247 | 255 |
| 248 } // namespace blink | 256 } // namespace blink |
| 249 | 257 |
| 250 #endif // Event_h | 258 #endif // Event_h |
| OLD | NEW |