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 e572de3b38dd6465e8ebde4c0b1bb955082b623d..c5627d6e77e486d66a2db9ce1da576463ed82aae 100644 |
| --- a/Source/core/svg/animation/SMILTime.h |
| +++ b/Source/core/svg/animation/SMILTime.h |
| @@ -80,6 +80,14 @@ private: |
| Origin m_origin; |
| }; |
| +struct SMILInterval { |
| + SMILInterval() { } |
| + SMILInterval(const SMILTime& begin, const SMILTime& end) : begin(begin), end(end) { } |
| + |
| + SMILTime begin; |
| + SMILTime end; |
| +}; |
| + |
| inline bool operator==(const SMILTime& a, const SMILTime& b) { return a.isFinite() && a.value() == b.value(); } |
| inline bool operator!(const SMILTime& a) { return !a.isFinite() || !a.value(); } |
| inline bool operator!=(const SMILTime& a, const SMILTime& b) { return !operator==(a, b); } |
| @@ -94,6 +102,13 @@ SMILTime operator-(const SMILTime&, const SMILTime&); |
| // So multiplying times does not make too much sense but SMIL defines it for duration * repeatCount |
| SMILTime operator*(const SMILTime&, const SMILTime&); |
| +inline bool operator!=(const SMILInterval& a, const SMILInterval& b) |
| +{ |
| + // Compare the "raw" values since the operator!= for SMILTime always return |
|
pdr.
2014/05/28 21:56:24
Please file a bug about this. This is crazy:
inlin
fs
2014/05/30 08:02:47
I'm not sure it's 100% crazy (maybe 84% crazy) - a
|
| + // true for non-finite times. |
| + return a.begin.value() != b.begin.value() || a.end.value() != b.end.value(); |
| +} |
| + |
| } |
| #endif // SMILTime_h |