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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/svg/animation/SVGSMILElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Event.h
diff --git a/Source/core/dom/Event.h b/Source/core/dom/Event.h
index 56dd5f96892cca8d5181c6b3694df0575342cb26..f91e4268e573b3a417e0e103b8e8746968fcbf99 100644
--- a/Source/core/dom/Event.h
+++ b/Source/core/dom/Event.h
@@ -179,6 +179,8 @@ public:
bool isBeingDispatched() const { return eventPhase(); }
+ 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
+
protected:
Event();
Event(const AtomicString& type, bool canBubble, bool cancelable);
@@ -206,6 +208,26 @@ private:
EventPath m_eventPath;
};
+class RepeatEvent : public Event {
pdr. 2013/09/17 22:40:01 Can this be placed in SVGSMILElement?
+public:
+ static PassRefPtr<RepeatEvent> create(const AtomicString& type, int repeat)
+ {
+ return adoptRef(new RepeatEvent(type, false, false, repeat));
+ }
+
+ ~RepeatEvent() { }
+
+ int repeat() const { return m_repeat; }
+protected:
+ RepeatEvent(const AtomicString& type, bool canBubble, bool cancelable, int repeat = -1)
+ : Event(type, canBubble, cancelable)
+ , m_repeat(repeat)
+ {
+ }
+private:
+ int m_repeat;
+};
+
} // namespace WebCore
#endif // Event_h
« 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