Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Source/core/events/Event.h

Issue 2030513002: Remove Event.relatedTargetScoped and update event path calculation for relatedTarget (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 composed() const { return m_composed; } 132 bool composed() const { return m_composed; }
133 bool isScopedInV0() const; 133 bool isScopedInV0() const;
134 bool relatedTargetScoped() const { return m_relatedTargetScoped; }
135 134
136 // Event creation timestamp in milliseconds. If |HiResEventTimeStamp| 135 // Event creation timestamp in milliseconds. If |HiResEventTimeStamp|
137 // runtime feature is enabled it returns a DOMHighResTimeStamp using the 136 // runtime feature is enabled it returns a DOMHighResTimeStamp using the
138 // platform timestamp (see |m_platformTimeStamp|) otherwise it returns a 137 // platform timestamp (see |m_platformTimeStamp|) otherwise it returns a
139 // DOMTimeStamp that represents the current object's construction time (see 138 // DOMTimeStamp that represents the current object's construction time (see
140 // |m_createTime|). For more info see http://crbug.com/160524 139 // |m_createTime|). For more info see http://crbug.com/160524
141 double timeStamp(ScriptState*) const; 140 double timeStamp(ScriptState*) const;
142 double platformTimeStamp() const { return m_platformTimeStamp; } 141 double platformTimeStamp() const { return m_platformTimeStamp; }
143 DOMTimeStamp createTime() const { return m_createTime; } 142 DOMTimeStamp createTime() const { return m_createTime; }
144 143
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 208
210 bool isTrusted() const { return m_isTrusted; } 209 bool isTrusted() const { return m_isTrusted; }
211 void setTrusted(bool value) { m_isTrusted = value; } 210 void setTrusted(bool value) { m_isTrusted = value; }
212 211
213 void setHandlingPassive(bool value) { m_handlingPassive = value; } 212 void setHandlingPassive(bool value) { m_handlingPassive = value; }
214 213
215 DECLARE_VIRTUAL_TRACE(); 214 DECLARE_VIRTUAL_TRACE();
216 215
217 protected: 216 protected:
218 Event(); 217 Event();
218 Event(const AtomicString& type, bool canBubble, bool cancelable, double plat formTimeStamp);
219 Event(const AtomicString& type, bool canBubble, bool cancelable); 219 Event(const AtomicString& type, bool canBubble, bool cancelable);
220 Event(const AtomicString& type, bool canBubble, bool cancelable, EventTarget * relatedTarget);
221 Event(const AtomicString& type, bool canBubble, bool cancelable, double plat formTimeStamp);
222 Event(const AtomicString& type, bool canBubble, bool cancelable, EventTarget * relatedTarget, double platformTimeStamp);
223 Event(const AtomicString& type, bool canBubble, bool cancelable, bool compos ed);
224 Event(const AtomicString& type, bool canBubble, bool cancelable, bool compos ed, bool relatedTargetScoped, double platformTimeStamp);
225 Event(const AtomicString& type, const EventInit&); 220 Event(const AtomicString& type, const EventInit&);
226 221
227 virtual void receivedTarget(); 222 virtual void receivedTarget();
228 223
229 void setCanBubble(bool bubble) { m_canBubble = bubble; } 224 void setCanBubble(bool bubble) { m_canBubble = bubble; }
230 225
231 private: 226 private:
227 Event(const AtomicString& type, bool canBubble, bool cancelable, bool compos ed, double platformTimeStamp);
228
232 enum EventPathMode { 229 enum EventPathMode {
233 EmptyAfterDispatch, 230 EmptyAfterDispatch,
234 NonEmptyAfterDispatch 231 NonEmptyAfterDispatch
235 }; 232 };
236 233
237 HeapVector<Member<EventTarget>> pathInternal(ScriptState*, EventPathMode) co nst; 234 HeapVector<Member<EventTarget>> pathInternal(ScriptState*, EventPathMode) co nst;
238 235
239 AtomicString m_type; 236 AtomicString m_type;
240 unsigned m_canBubble:1; 237 unsigned m_canBubble:1;
241 unsigned m_cancelable:1; 238 unsigned m_cancelable:1;
242 unsigned m_composed:1; 239 unsigned m_composed:1;
243 unsigned m_relatedTargetScoped:1;
244 240
245 unsigned m_propagationStopped:1; 241 unsigned m_propagationStopped:1;
246 unsigned m_immediatePropagationStopped:1; 242 unsigned m_immediatePropagationStopped:1;
247 unsigned m_defaultPrevented:1; 243 unsigned m_defaultPrevented:1;
248 unsigned m_defaultHandled:1; 244 unsigned m_defaultHandled:1;
249 unsigned m_cancelBubble:1; 245 unsigned m_cancelBubble:1;
250 unsigned m_wasInitialized:1; 246 unsigned m_wasInitialized:1;
251 unsigned m_isTrusted : 1; 247 unsigned m_isTrusted : 1;
252 unsigned m_handlingPassive : 1; 248 unsigned m_handlingPassive : 1;
253 249
254 unsigned short m_eventPhase; 250 unsigned short m_eventPhase;
255 Member<EventTarget> m_currentTarget; 251 Member<EventTarget> m_currentTarget;
256 Member<EventTarget> m_target; 252 Member<EventTarget> m_target;
257 DOMTimeStamp m_createTime; 253 DOMTimeStamp m_createTime;
258 Member<Event> m_underlyingEvent; 254 Member<Event> m_underlyingEvent;
259 Member<EventPath> m_eventPath; 255 Member<EventPath> m_eventPath;
260 // The monotonic platform time in seconds, for input events it is the 256 // The monotonic platform time in seconds, for input events it is the
261 // event timestamp provided by the host OS and reported in the original 257 // event timestamp provided by the host OS and reported in the original
262 // WebInputEvent instance. 258 // WebInputEvent instance.
263 double m_platformTimeStamp; 259 double m_platformTimeStamp;
264 }; 260 };
265 261
266 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ 262 #define DEFINE_EVENT_TYPE_CASTS(typeName) \
267 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName()) 263 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName())
268 264
269 } // namespace blink 265 } // namespace blink
270 266
271 #endif // Event_h 267 #endif // Event_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698