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

Unified Diff: Source/core/svg/animation/SMILTime.h

Issue 406263002: Make sure that begin time cannot be greater than (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 | « LayoutTests/svg/animations/animateMotion-crash-with-large-begin-time-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/animation/SMILTime.h
diff --git a/Source/core/svg/animation/SMILTime.h b/Source/core/svg/animation/SMILTime.h
index cab9fe9d6123e19c3893b5da31c136c6a750c8f2..2d61fed383c8fde5f2ee035a93c02e6772a6ab3a 100644
--- a/Source/core/svg/animation/SMILTime.h
+++ b/Source/core/svg/animation/SMILTime.h
@@ -34,11 +34,11 @@ namespace blink {
class SMILTime {
public:
SMILTime() : m_time(0) { }
- SMILTime(double time) : m_time(time) { ASSERT(!std::isnan(time)); }
+ SMILTime(double time, bool checkRange = true) : m_time(checkRange && (time > indefiniteValue) ? indefiniteValue : time) { ASSERT(!std::isnan(time)); }
fs 2014/07/22 16:29:37 I think I'd prefer if this was done at parse-time
reni 2014/07/23 13:42:35 Do you mean using NaN and Inf instead FLT_MAX and
SMILTime(const SMILTime& o) : m_time(o.m_time) { }
- static SMILTime unresolved() { return unresolvedValue; }
- static SMILTime indefinite() { return indefiniteValue; }
+ static SMILTime unresolved() { return SMILTime(unresolvedValue, false); }
+ static SMILTime indefinite() { return SMILTime(indefiniteValue, false); }
SMILTime& operator=(const SMILTime& o) { m_time = o.m_time; return *this; }
double value() const { return m_time; }
« no previous file with comments | « LayoutTests/svg/animations/animateMotion-crash-with-large-begin-time-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698