| Index: Source/core/platform/animation/TimingFunction.h
|
| diff --git a/Source/core/platform/animation/TimingFunction.h b/Source/core/platform/animation/TimingFunction.h
|
| index ecc9c7477f79897159b7525da372d91e786c83d2..abbaf4ed80228d32b76db7d9d2c0db8435178c66 100644
|
| --- a/Source/core/platform/animation/TimingFunction.h
|
| +++ b/Source/core/platform/animation/TimingFunction.h
|
| @@ -35,7 +35,6 @@
|
| #include "wtf/Vector.h"
|
| #include <algorithm>
|
|
|
| -
|
| namespace WebCore {
|
|
|
| class TimingFunction : public RefCounted<TimingFunction> {
|
| @@ -53,6 +52,7 @@ public:
|
| // accuracy and is not guaranteed.
|
| virtual double evaluate(double fraction, double accuracy) const = 0;
|
| virtual bool operator==(const TimingFunction& other) const = 0;
|
| + virtual bool operator!=(const TimingFunction& other) const { return !operator==(other); }
|
|
|
| protected:
|
| TimingFunction(Type type)
|
| @@ -153,14 +153,14 @@ public:
|
|
|
| virtual bool operator==(const TimingFunction& other) const
|
| {
|
| - if (other.type() == CubicBezierFunction) {
|
| - const CubicBezierTimingFunction* ctf = static_cast<const CubicBezierTimingFunction*>(&other);
|
| - if (m_subType != Custom)
|
| - return m_subType == ctf->m_subType;
|
| + if (other.type() != CubicBezierFunction)
|
| + return false;
|
|
|
| + const CubicBezierTimingFunction* ctf = static_cast<const CubicBezierTimingFunction*>(&other);
|
| + if (m_subType == Custom && ctf->m_subType == Custom)
|
| return m_x1 == ctf->m_x1 && m_y1 == ctf->m_y1 && m_x2 == ctf->m_x2 && m_y2 == ctf->m_y2;
|
| - }
|
| - return false;
|
| +
|
| + return m_subType == ctf->m_subType;
|
| }
|
|
|
| double x1() const { return m_x1; }
|
| @@ -233,13 +233,14 @@ public:
|
|
|
| virtual bool operator==(const TimingFunction& other) const
|
| {
|
| - if (other.type() == StepsFunction) {
|
| - const StepsTimingFunction* stf = static_cast<const StepsTimingFunction*>(&other);
|
| - if (m_subType != Custom)
|
| - return m_subType == stf->m_subType;
|
| + if (other.type() != StepsFunction)
|
| + return false;
|
| +
|
| + const StepsTimingFunction* stf = static_cast<const StepsTimingFunction*>(&other);
|
| + if (m_subType == Custom && stf->m_subType == Custom)
|
| return m_steps == stf->m_steps && m_stepAtStart == stf->m_stepAtStart;
|
| - }
|
| - return false;
|
| +
|
| + return m_subType == stf->m_subType;
|
| }
|
|
|
| int numberOfSteps() const { return m_steps; }
|
| @@ -274,6 +275,7 @@ public:
|
| ASSERT(upperBound > max);
|
| m_segments.append(Segment(max, upperBound, timingFunction));
|
| }
|
| +
|
| virtual double evaluate(double fraction, double accuracy) const
|
| {
|
| RELEASE_ASSERT_WITH_MESSAGE(fraction >= 0 && fraction <= 1, "Web Animations not yet implemented: Timing function behavior outside the range [0, 1] is not yet specified");
|
|
|