зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1198708 - Part 5: Add method to serialize a ComputedTimingFunction. r=birtles
This commit is contained in:
Родитель
e441526821
Коммит
45eb434b3e
|
@ -10,6 +10,7 @@
|
|||
#include "AnimationCommon.h"
|
||||
#include "nsCSSPropertySet.h"
|
||||
#include "nsCSSProps.h" // For nsCSSProps::PropHasFlags
|
||||
#include "nsStyleUtil.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -53,6 +54,28 @@ ComputedTimingFunction::GetValue(double aPortion) const
|
|||
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>();
|
||||
|
|
|
@ -130,6 +130,7 @@ public:
|
|||
bool operator!=(const ComputedTimingFunction& aOther) const {
|
||||
return !(*this == aOther);
|
||||
}
|
||||
void AppendToString(nsAString& aResult) const;
|
||||
|
||||
private:
|
||||
Type mType;
|
||||
|
|
Загрузка…
Ссылка в новой задаче