Index: Source/core/platform/animation/TimingFunction.h |
diff --git a/Source/core/platform/animation/TimingFunction.h b/Source/core/platform/animation/TimingFunction.h |
index abbaf4ed80228d32b76db7d9d2c0db8435178c66..52b791168da3d1c866ac6a2789faf4deea7e8490 100644 |
--- a/Source/core/platform/animation/TimingFunction.h |
+++ b/Source/core/platform/animation/TimingFunction.h |
@@ -291,9 +291,21 @@ public: |
virtual bool operator==(const TimingFunction& other) const |
{ |
- // This class is not exposed to CSS, so this method is not required. |
- ASSERT_NOT_REACHED(); |
- return false; |
+ if (other.type() != ChainedFunction) |
+ return false; |
+ |
+ if (this == &other) |
+ return true; |
+ |
+ const ChainedTimingFunction* ctf = static_cast<const ChainedTimingFunction*>(&other); |
+ if (ctf->m_segments.size() != m_segments.size()) |
+ return false; |
+ |
+ for (size_t i = 0; i < m_segments.size(); i++) { |
+ if (m_segments[i] != ctf->m_segments[i]) |
+ return false; |
+ } |
+ return true; |
} |
private: |
@@ -311,6 +323,27 @@ private: |
return scaleFromLocal(m_timingFunction->evaluate(scaleToLocal(fraction), accuracy)); |
} |
+ bool operator==(const Segment& other) const |
+ { |
+ if (this == &other) |
+ return true; |
+ |
+ bool minMaxEq = m_min == other.m_min && m_max == other.m_max; |
+ if (!minMaxEq) |
+ return false; |
+ |
+ if (m_timingFunction == other.m_timingFunction) |
+ return true; |
+ |
+ if (!m_timingFunction || !other.m_timingFunction) |
+ return false; |
+ |
+ return (*m_timingFunction.get()) == (*other.m_timingFunction.get()); |
+ } |
+ bool operator!=(const Segment& other) const |
+ { |
+ return !operator==(other); |
+ } |
private: |
double scaleToLocal(double x) const { return (x - m_min) / (m_max - m_min); } |
double scaleFromLocal(double x) const { return blend(m_min, m_max, x); } |