Chromium Code Reviews| 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; } |