Chromium Code Reviews| Index: third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp |
| diff --git a/third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp b/third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp |
| index 532cd58c4c39e71b101bb16206f6383603285b0a..474f2343f2a91e7eb76aa6bf38d6ec0d6054127c 100644 |
| --- a/third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp |
| +++ b/third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp |
| @@ -202,7 +202,7 @@ const QualifiedName* AnimationInputHelpers::keyframeAttributeToSVGAttribute(cons |
| return iter->value; |
| } |
| -PassRefPtr<TimingFunction> AnimationInputHelpers::parseTimingFunction(const String& string) |
| +PassRefPtr<TimingFunction> AnimationInputHelpers::parseTimingFunction(const String& string, Document* document) |
| { |
| if (string.isEmpty()) |
| return nullptr; |
| @@ -210,6 +210,24 @@ PassRefPtr<TimingFunction> AnimationInputHelpers::parseTimingFunction(const Stri |
| CSSValue* value = CSSParser::parseSingleValue(CSSPropertyTransitionTimingFunction, string); |
| if (!value || !value->isValueList()) { |
| ASSERT(!value || value->isCSSWideKeyword()); |
| + if (document) { |
| + if (string.startsWith("function")) { |
| + // Due to a bug in old versions of the web-animations-next |
| + // polyfill, in some circumstances the string passed in here |
| + // may be a Javascript function instead of the allowed values |
| + // from the spec |
| + // (http://w3c.github.io/web-animations/#dom-animationeffecttimingreadonly-easing) |
| + // This bug was fixed in |
| + // https://github.com/web-animations/web-animations-next/pull/423 |
| + // and we want to track how often it is still being hit. The |
| + // linear case is special because 'linear' is the default value |
| + // for easing. |
| + if (string == "function(a) {return a}") |
|
alancutter (OOO until 2018)
2016/04/07 07:36:20
According to https://luci-logdog.appspot.com/v/?s=
|
| + UseCounter::count(*document, UseCounter::WebAnimationsEasingAsFunctionLinear); |
| + else |
| + UseCounter::count(*document, UseCounter::WebAnimationsEasingAsFunctionOther); |
| + } |
| + } |
| return nullptr; |
| } |
| CSSValueList* valueList = toCSSValueList(value); |