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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 | 117 |
| 118 EventTarget* currentTarget() const; | 118 EventTarget* currentTarget() const; |
| 119 void setCurrentTarget(EventTarget* currentTarget) { m_currentTarget = curren tTarget; } | 119 void setCurrentTarget(EventTarget* currentTarget) { m_currentTarget = curren tTarget; } |
| 120 | 120 |
| 121 unsigned short eventPhase() const { return m_eventPhase; } | 121 unsigned short eventPhase() const { return m_eventPhase; } |
| 122 void setEventPhase(unsigned short eventPhase) { m_eventPhase = eventPhase; } | 122 void setEventPhase(unsigned short eventPhase) { m_eventPhase = eventPhase; } |
| 123 | 123 |
| 124 bool bubbles() const { return m_canBubble; } | 124 bool bubbles() const { return m_canBubble; } |
| 125 bool cancelable() const { return m_cancelable; } | 125 bool cancelable() const { return m_cancelable; } |
| 126 bool scoped() const { return m_scoped; } | 126 bool scoped() const { return m_scoped; } |
| 127 bool relatedTargetScoped() const { return m_relatedTargetScoped; } | |
| 127 | 128 |
| 128 // Event creation timestamp in milliseconds. If |HiResEventTimeStamp| | 129 // Event creation timestamp in milliseconds. If |HiResEventTimeStamp| |
| 129 // runtime feature is enabled it returns a DOMHighResTimeStamp using the | 130 // runtime feature is enabled it returns a DOMHighResTimeStamp using the |
| 130 // platform timestamp (see |m_platformTimeStamp|) otherwise it returns a | 131 // platform timestamp (see |m_platformTimeStamp|) otherwise it returns a |
| 131 // DOMTimeStamp that represents the current object's construction time (see | 132 // DOMTimeStamp that represents the current object's construction time (see |
| 132 // |m_createTime|). For more info see http://crbug.com/160524 | 133 // |m_createTime|). For more info see http://crbug.com/160524 |
| 133 double timeStamp(ScriptState*) const; | 134 double timeStamp(ScriptState*) const; |
| 134 double platformTimeStamp() const { return m_platformTimeStamp; } | 135 double platformTimeStamp() const { return m_platformTimeStamp; } |
| 135 DOMTimeStamp createTime() const { return m_createTime; } | 136 DOMTimeStamp createTime() const { return m_createTime; } |
| 136 | 137 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 bool isTrusted() const { return m_isTrusted; } | 201 bool isTrusted() const { return m_isTrusted; } |
| 201 void setTrusted(bool value) { m_isTrusted = value; } | 202 void setTrusted(bool value) { m_isTrusted = value; } |
| 202 | 203 |
| 203 void setHandlingPassive(bool value) { m_handlingPassive = value; } | 204 void setHandlingPassive(bool value) { m_handlingPassive = value; } |
| 204 | 205 |
| 205 DECLARE_VIRTUAL_TRACE(); | 206 DECLARE_VIRTUAL_TRACE(); |
| 206 | 207 |
| 207 protected: | 208 protected: |
| 208 Event(); | 209 Event(); |
| 209 Event(const AtomicString& type, bool canBubble, bool cancelable); | 210 Event(const AtomicString& type, bool canBubble, bool cancelable); |
| 211 Event(const AtomicString& type, bool canBubble, bool cancelable, EventTarget * relatedTarget); | |
| 210 Event(const AtomicString& type, bool canBubble, bool cancelable, double plat formTimeStamp); | 212 Event(const AtomicString& type, bool canBubble, bool cancelable, double plat formTimeStamp); |
| 213 Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg, EventTarget* relatedTarget, double platformTimeStamp); | |
|
kochi
2016/03/18 05:43:43
nit: s/eventType/type/, s/canBubbleArg/canBubble/,
yuzuchan
2016/03/18 07:20:15
Fixed.
| |
| 211 Event(const AtomicString& type, bool canBubble, bool cancelable, bool scoped ); | 214 Event(const AtomicString& type, bool canBubble, bool cancelable, bool scoped ); |
| 212 Event(const AtomicString& type, bool canBubble, bool cancelable, bool scoped , double platformTimeStamp); | 215 Event(const AtomicString& type, bool canBubble, bool cancelable, bool scoped , bool relatedTargetScoped, double platformTimeStamp); |
| 213 Event(const AtomicString& type, const EventInit&); | 216 Event(const AtomicString& type, const EventInit&); |
| 214 | 217 |
| 215 virtual void receivedTarget(); | 218 virtual void receivedTarget(); |
| 216 bool dispatched() const { return m_target; } | 219 bool dispatched() const { return m_target; } |
| 217 | 220 |
| 218 void setCanBubble(bool bubble) { m_canBubble = bubble; } | 221 void setCanBubble(bool bubble) { m_canBubble = bubble; } |
| 219 | 222 |
| 220 private: | 223 private: |
| 221 enum EventPathMode { | 224 enum EventPathMode { |
| 222 EmptyAfterDispatch, | 225 EmptyAfterDispatch, |
| 223 NonEmptyAfterDispatch | 226 NonEmptyAfterDispatch |
| 224 }; | 227 }; |
| 225 | 228 |
| 226 WillBeHeapVector<RefPtrWillBeMember<EventTarget>> pathInternal(ScriptState*, EventPathMode) const; | 229 WillBeHeapVector<RefPtrWillBeMember<EventTarget>> pathInternal(ScriptState*, EventPathMode) const; |
| 227 | 230 |
| 228 AtomicString m_type; | 231 AtomicString m_type; |
| 229 unsigned m_canBubble:1; | 232 unsigned m_canBubble:1; |
| 230 unsigned m_cancelable:1; | 233 unsigned m_cancelable:1; |
| 231 unsigned m_scoped:1; | 234 unsigned m_scoped:1; |
| 235 unsigned m_relatedTargetScoped:1; | |
| 232 | 236 |
| 233 unsigned m_propagationStopped:1; | 237 unsigned m_propagationStopped:1; |
| 234 unsigned m_immediatePropagationStopped:1; | 238 unsigned m_immediatePropagationStopped:1; |
| 235 unsigned m_defaultPrevented:1; | 239 unsigned m_defaultPrevented:1; |
| 236 unsigned m_defaultHandled:1; | 240 unsigned m_defaultHandled:1; |
| 237 unsigned m_cancelBubble:1; | 241 unsigned m_cancelBubble:1; |
| 238 unsigned m_isTrusted : 1; | 242 unsigned m_isTrusted : 1; |
| 239 unsigned m_handlingPassive : 1; | 243 unsigned m_handlingPassive : 1; |
| 240 | 244 |
| 241 unsigned short m_eventPhase; | 245 unsigned short m_eventPhase; |
| 242 RefPtrWillBeMember<EventTarget> m_currentTarget; | 246 RefPtrWillBeMember<EventTarget> m_currentTarget; |
| 243 RefPtrWillBeMember<EventTarget> m_target; | 247 RefPtrWillBeMember<EventTarget> m_target; |
| 244 DOMTimeStamp m_createTime; | 248 DOMTimeStamp m_createTime; |
| 245 RefPtrWillBeMember<Event> m_underlyingEvent; | 249 RefPtrWillBeMember<Event> m_underlyingEvent; |
| 246 OwnPtrWillBeMember<EventPath> m_eventPath; | 250 OwnPtrWillBeMember<EventPath> m_eventPath; |
| 247 // The monotonic platform time in seconds, for input events it is the | 251 // The monotonic platform time in seconds, for input events it is the |
| 248 // event timestamp provided by the host OS and reported in the original | 252 // event timestamp provided by the host OS and reported in the original |
| 249 // WebInputEvent instance. | 253 // WebInputEvent instance. |
| 250 double m_platformTimeStamp; | 254 double m_platformTimeStamp; |
| 251 }; | 255 }; |
| 252 | 256 |
| 253 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ | 257 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ |
| 254 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName()) | 258 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName()) |
| 255 | 259 |
| 256 } // namespace blink | 260 } // namespace blink |
| 257 | 261 |
| 258 #endif // Event_h | 262 #endif // Event_h |
| OLD | NEW |