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

Side by Side Diff: Source/core/dom/Event.h

Issue 23944012: [SVG] Avoid unnecessarily populating hashmap for repeat(n) event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | Source/core/svg/animation/SVGSMILElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 Event* underlyingEvent() const { return m_underlyingEvent.get(); } 172 Event* underlyingEvent() const { return m_underlyingEvent.get(); }
173 void setUnderlyingEvent(PassRefPtr<Event>); 173 void setUnderlyingEvent(PassRefPtr<Event>);
174 174
175 EventPath& eventPath() { return m_eventPath; } 175 EventPath& eventPath() { return m_eventPath; }
176 PassRefPtr<NodeList> path() const; 176 PassRefPtr<NodeList> path() const;
177 177
178 virtual Clipboard* clipboard() const { return 0; } 178 virtual Clipboard* clipboard() const { return 0; }
179 179
180 bool isBeingDispatched() const { return eventPhase(); } 180 bool isBeingDispatched() const { return eventPhase(); }
181 181
182 virtual int repeat() const { return -1; }
pdr. 2013/09/17 22:40:01 I don't think this is necessary and I'd prefer to
183
182 protected: 184 protected:
183 Event(); 185 Event();
184 Event(const AtomicString& type, bool canBubble, bool cancelable); 186 Event(const AtomicString& type, bool canBubble, bool cancelable);
185 Event(const AtomicString& type, const EventInit&); 187 Event(const AtomicString& type, const EventInit&);
186 188
187 virtual void receivedTarget(); 189 virtual void receivedTarget();
188 bool dispatched() const { return m_target; } 190 bool dispatched() const { return m_target; }
189 191
190 private: 192 private:
191 AtomicString m_type; 193 AtomicString m_type;
192 bool m_canBubble; 194 bool m_canBubble;
193 bool m_cancelable; 195 bool m_cancelable;
194 196
195 bool m_propagationStopped; 197 bool m_propagationStopped;
196 bool m_immediatePropagationStopped; 198 bool m_immediatePropagationStopped;
197 bool m_defaultPrevented; 199 bool m_defaultPrevented;
198 bool m_defaultHandled; 200 bool m_defaultHandled;
199 bool m_cancelBubble; 201 bool m_cancelBubble;
200 202
201 unsigned short m_eventPhase; 203 unsigned short m_eventPhase;
202 EventTarget* m_currentTarget; 204 EventTarget* m_currentTarget;
203 RefPtr<EventTarget> m_target; 205 RefPtr<EventTarget> m_target;
204 DOMTimeStamp m_createTime; 206 DOMTimeStamp m_createTime;
205 RefPtr<Event> m_underlyingEvent; 207 RefPtr<Event> m_underlyingEvent;
206 EventPath m_eventPath; 208 EventPath m_eventPath;
207 }; 209 };
208 210
211 class RepeatEvent : public Event {
pdr. 2013/09/17 22:40:01 Can this be placed in SVGSMILElement?
212 public:
213 static PassRefPtr<RepeatEvent> create(const AtomicString& type, int repeat)
214 {
215 return adoptRef(new RepeatEvent(type, false, false, repeat));
216 }
217
218 ~RepeatEvent() { }
219
220 int repeat() const { return m_repeat; }
221 protected:
222 RepeatEvent(const AtomicString& type, bool canBubble, bool cancelable, int r epeat = -1)
223 : Event(type, canBubble, cancelable)
224 , m_repeat(repeat)
225 {
226 }
227 private:
228 int m_repeat;
229 };
230
209 } // namespace WebCore 231 } // namespace WebCore
210 232
211 #endif // Event_h 233 #endif // Event_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/svg/animation/SVGSMILElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698