author | Cameron McCormack <cam@mcc.id.au> |
Tue, 29 Sep 2015 12:20:14 +1000 | |
changeset 264868 | b76051a05ab88ad3ff8d20377f39af04faf809e5 |
parent 264867 | 53fa8554d2f6bc08642ebea57fb3caf25bef8d8d |
child 264869 | 25f358c13bfdd19251c1e696c56dc1fb8f09caaa |
push id | 65767 |
push user | cmccormack@mozilla.com |
push date | Tue, 29 Sep 2015 02:20:08 +0000 |
treeherder | mozilla-inbound@b829122b753b [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | birtles |
bugs | 1198708 |
milestone | 44.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
dom/animation/KeyframeEffect.cpp | file | annotate | diff | comparison | revisions | |
dom/animation/KeyframeEffect.h | file | annotate | diff | comparison | revisions |
--- a/dom/animation/KeyframeEffect.cpp +++ b/dom/animation/KeyframeEffect.cpp @@ -5,16 +5,17 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/dom/KeyframeEffect.h" #include "mozilla/dom/KeyframeEffectBinding.h" #include "mozilla/FloatingPoint.h" #include "AnimationCommon.h" #include "nsCSSPropertySet.h" #include "nsCSSProps.h" // For nsCSSProps::PropHasFlags +#include "nsStyleUtil.h" namespace mozilla { void ComputedTimingFunction::Init(const nsTimingFunction &aFunction) { mType = aFunction.mType; if (nsTimingFunction::IsSplineType(mType)) { @@ -48,16 +49,38 @@ ComputedTimingFunction::GetValue(double // up to zero, so we can't do that. And it's not clear the spec // really meant it. return 1.0 - StepEnd(mSteps, 1.0 - aPortion); } MOZ_ASSERT(mType == nsTimingFunction::Type::StepEnd, "bad type"); return StepEnd(mSteps, aPortion); } +void +ComputedTimingFunction::AppendToString(nsAString& aResult) const +{ + switch (mType) { + case nsTimingFunction::Type::CubicBezier: + nsStyleUtil::AppendCubicBezierTimingFunction(mTimingFunction.X1(), + mTimingFunction.Y1(), + mTimingFunction.X2(), + mTimingFunction.Y2(), + aResult); + break; + case nsTimingFunction::Type::StepStart: + case nsTimingFunction::Type::StepEnd: + nsStyleUtil::AppendStepsTimingFunction(mType, mSteps, mStepSyntax, + aResult); + break; + default: + nsStyleUtil::AppendCubicBezierKeywordTimingFunction(mType, aResult); + break; + } +} + // In the Web Animations model, the iteration progress can be outside the range // [0.0, 1.0] but it shouldn't be Infinity. const double ComputedTiming::kNullProgress = PositiveInfinity<double>(); namespace dom { NS_IMPL_CYCLE_COLLECTION_INHERITED(KeyframeEffectReadOnly, AnimationEffectReadOnly,
--- a/dom/animation/KeyframeEffect.h +++ b/dom/animation/KeyframeEffect.h @@ -125,16 +125,17 @@ public: (HasSpline() ? mTimingFunction == aOther.mTimingFunction : (mSteps == aOther.mSteps && mStepSyntax == aOther.mStepSyntax)); } bool operator!=(const ComputedTimingFunction& aOther) const { return !(*this == aOther); } + void AppendToString(nsAString& aResult) const; private: Type mType; nsSMILKeySpline mTimingFunction; uint32_t mSteps; StepSyntax mStepSyntax; };