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

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

Issue 1728093007: Make Event.deepPath() return an empty array if an event is no longer being dispatched (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 years, 9 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
226 WillBeHeapVector<RefPtrWillBeMember<EventTarget>> pathInternal(ScriptState*, EventPathMode) const;
227
220 AtomicString m_type; 228 AtomicString m_type;
221 unsigned m_canBubble:1; 229 unsigned m_canBubble:1;
222 unsigned m_cancelable:1; 230 unsigned m_cancelable:1;
223 unsigned m_scoped:1; 231 unsigned m_scoped:1;
224 232
225 unsigned m_propagationStopped:1; 233 unsigned m_propagationStopped:1;
226 unsigned m_immediatePropagationStopped:1; 234 unsigned m_immediatePropagationStopped:1;
227 unsigned m_defaultPrevented:1; 235 unsigned m_defaultPrevented:1;
228 unsigned m_defaultHandled:1; 236 unsigned m_defaultHandled:1;
229 unsigned m_cancelBubble:1; 237 unsigned m_cancelBubble:1;
(...skipping 11 matching lines...) Expand all
241 // WebInputEvent instance. 249 // WebInputEvent instance.
242 double m_platformTimeStamp; 250 double m_platformTimeStamp;
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698