| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // at the current target. It should only be used to influence UMA metrics | 122 // at the current target. It should only be used to influence UMA metrics |
| 123 // and not change functionality since observing the presence of listeners | 123 // and not change functionality since observing the presence of listeners |
| 124 // is dangerous. | 124 // is dangerous. |
| 125 virtual void doneDispatchingEventAtCurrentTarget() {} | 125 virtual void doneDispatchingEventAtCurrentTarget() {} |
| 126 | 126 |
| 127 unsigned short eventPhase() const { return m_eventPhase; } | 127 unsigned short eventPhase() const { return m_eventPhase; } |
| 128 void setEventPhase(unsigned short eventPhase) { m_eventPhase = eventPhase; } | 128 void setEventPhase(unsigned short eventPhase) { m_eventPhase = eventPhase; } |
| 129 | 129 |
| 130 bool bubbles() const { return m_canBubble; } | 130 bool bubbles() const { return m_canBubble; } |
| 131 bool cancelable() const { return m_cancelable; } | 131 bool cancelable() const { return m_cancelable; } |
| 132 bool scoped() const { return m_scoped; } | 132 bool composed() const { return m_composed; } |
| 133 bool isScopedInV0() const; |
| 133 bool relatedTargetScoped() const { return m_relatedTargetScoped; } | 134 bool relatedTargetScoped() const { return m_relatedTargetScoped; } |
| 134 | 135 |
| 135 // Event creation timestamp in milliseconds. If |HiResEventTimeStamp| | 136 // Event creation timestamp in milliseconds. If |HiResEventTimeStamp| |
| 136 // runtime feature is enabled it returns a DOMHighResTimeStamp using the | 137 // runtime feature is enabled it returns a DOMHighResTimeStamp using the |
| 137 // platform timestamp (see |m_platformTimeStamp|) otherwise it returns a | 138 // platform timestamp (see |m_platformTimeStamp|) otherwise it returns a |
| 138 // DOMTimeStamp that represents the current object's construction time (see | 139 // DOMTimeStamp that represents the current object's construction time (see |
| 139 // |m_createTime|). For more info see http://crbug.com/160524 | 140 // |m_createTime|). For more info see http://crbug.com/160524 |
| 140 double timeStamp(ScriptState*) const; | 141 double timeStamp(ScriptState*) const; |
| 141 double platformTimeStamp() const { return m_platformTimeStamp; } | 142 double platformTimeStamp() const { return m_platformTimeStamp; } |
| 142 DOMTimeStamp createTime() const { return m_createTime; } | 143 DOMTimeStamp createTime() const { return m_createTime; } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 void setHandlingPassive(bool value) { m_handlingPassive = value; } | 213 void setHandlingPassive(bool value) { m_handlingPassive = value; } |
| 213 | 214 |
| 214 DECLARE_VIRTUAL_TRACE(); | 215 DECLARE_VIRTUAL_TRACE(); |
| 215 | 216 |
| 216 protected: | 217 protected: |
| 217 Event(); | 218 Event(); |
| 218 Event(const AtomicString& type, bool canBubble, bool cancelable); | 219 Event(const AtomicString& type, bool canBubble, bool cancelable); |
| 219 Event(const AtomicString& type, bool canBubble, bool cancelable, EventTarget
* relatedTarget); | 220 Event(const AtomicString& type, bool canBubble, bool cancelable, EventTarget
* relatedTarget); |
| 220 Event(const AtomicString& type, bool canBubble, bool cancelable, double plat
formTimeStamp); | 221 Event(const AtomicString& type, bool canBubble, bool cancelable, double plat
formTimeStamp); |
| 221 Event(const AtomicString& type, bool canBubble, bool cancelable, EventTarget
* relatedTarget, double platformTimeStamp); | 222 Event(const AtomicString& type, bool canBubble, bool cancelable, EventTarget
* relatedTarget, double platformTimeStamp); |
| 222 Event(const AtomicString& type, bool canBubble, bool cancelable, bool scoped
); | 223 Event(const AtomicString& type, bool canBubble, bool cancelable, bool compos
ed); |
| 223 Event(const AtomicString& type, bool canBubble, bool cancelable, bool scoped
, bool relatedTargetScoped, double platformTimeStamp); | 224 Event(const AtomicString& type, bool canBubble, bool cancelable, bool compos
ed, bool relatedTargetScoped, double platformTimeStamp); |
| 224 Event(const AtomicString& type, const EventInit&); | 225 Event(const AtomicString& type, const EventInit&); |
| 225 | 226 |
| 226 virtual void receivedTarget(); | 227 virtual void receivedTarget(); |
| 227 | 228 |
| 228 void setCanBubble(bool bubble) { m_canBubble = bubble; } | 229 void setCanBubble(bool bubble) { m_canBubble = bubble; } |
| 229 | 230 |
| 230 private: | 231 private: |
| 231 enum EventPathMode { | 232 enum EventPathMode { |
| 232 EmptyAfterDispatch, | 233 EmptyAfterDispatch, |
| 233 NonEmptyAfterDispatch | 234 NonEmptyAfterDispatch |
| 234 }; | 235 }; |
| 235 | 236 |
| 236 HeapVector<Member<EventTarget>> pathInternal(ScriptState*, EventPathMode) co
nst; | 237 HeapVector<Member<EventTarget>> pathInternal(ScriptState*, EventPathMode) co
nst; |
| 237 | 238 |
| 238 AtomicString m_type; | 239 AtomicString m_type; |
| 239 unsigned m_canBubble:1; | 240 unsigned m_canBubble:1; |
| 240 unsigned m_cancelable:1; | 241 unsigned m_cancelable:1; |
| 241 unsigned m_scoped:1; | 242 unsigned m_composed:1; |
| 242 unsigned m_relatedTargetScoped:1; | 243 unsigned m_relatedTargetScoped:1; |
| 243 | 244 |
| 244 unsigned m_propagationStopped:1; | 245 unsigned m_propagationStopped:1; |
| 245 unsigned m_immediatePropagationStopped:1; | 246 unsigned m_immediatePropagationStopped:1; |
| 246 unsigned m_defaultPrevented:1; | 247 unsigned m_defaultPrevented:1; |
| 247 unsigned m_defaultHandled:1; | 248 unsigned m_defaultHandled:1; |
| 248 unsigned m_cancelBubble:1; | 249 unsigned m_cancelBubble:1; |
| 249 unsigned m_wasInitialized:1; | 250 unsigned m_wasInitialized:1; |
| 250 unsigned m_isTrusted : 1; | 251 unsigned m_isTrusted : 1; |
| 251 unsigned m_handlingPassive : 1; | 252 unsigned m_handlingPassive : 1; |
| 252 | 253 |
| 253 unsigned short m_eventPhase; | 254 unsigned short m_eventPhase; |
| 254 Member<EventTarget> m_currentTarget; | 255 Member<EventTarget> m_currentTarget; |
| 255 Member<EventTarget> m_target; | 256 Member<EventTarget> m_target; |
| 256 DOMTimeStamp m_createTime; | 257 DOMTimeStamp m_createTime; |
| 257 Member<Event> m_underlyingEvent; | 258 Member<Event> m_underlyingEvent; |
| 258 Member<EventPath> m_eventPath; | 259 Member<EventPath> m_eventPath; |
| 259 // The monotonic platform time in seconds, for input events it is the | 260 // The monotonic platform time in seconds, for input events it is the |
| 260 // event timestamp provided by the host OS and reported in the original | 261 // event timestamp provided by the host OS and reported in the original |
| 261 // WebInputEvent instance. | 262 // WebInputEvent instance. |
| 262 double m_platformTimeStamp; | 263 double m_platformTimeStamp; |
| 263 }; | 264 }; |
| 264 | 265 |
| 265 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ | 266 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ |
| 266 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t
ypeName()) | 267 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t
ypeName()) |
| 267 | 268 |
| 268 } // namespace blink | 269 } // namespace blink |
| 269 | 270 |
| 270 #endif // Event_h | 271 #endif // Event_h |
| OLD | NEW |