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 9076960682d9b4fd727f8bb2fb2aa9ed0e80924a..e0ae9802e58e59271744f5cdab015803c5f60dd0 100644 |
| --- a/third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp |
| +++ b/third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp |
| @@ -53,9 +53,9 @@ CSSPropertyID AnimationInputHelpers::keyframeAttributeToCSSProperty(const String |
| return cssPropertyID(builder.toString()); |
| } |
| -CSSPropertyID AnimationInputHelpers::keyframeAttributeToPresentationAttribute(const String& property, const Element& element) |
| +CSSPropertyID AnimationInputHelpers::keyframeAttributeToPresentationAttribute(const String& property) |
| { |
| - if (!RuntimeEnabledFeatures::webAnimationsSVGEnabled() || !element.isSVGElement() || !isSVGPrefixed(property)) |
| + if (!RuntimeEnabledFeatures::webAnimationsSVGEnabled() || !isSVGPrefixed(property)) |
| return CSSPropertyInvalid; |
| String unprefixedProperty = removeSVGPrefix(property); |
| @@ -184,26 +184,22 @@ QualifiedName svgAttributeName(const String& property) |
| return QualifiedName(nullAtom, AtomicString(property), nullAtom); |
| } |
| -const QualifiedName* AnimationInputHelpers::keyframeAttributeToSVGAttribute(const String& property, Element& element) |
| +const QualifiedName* AnimationInputHelpers::keyframeAttributeToSVGAttribute(const String& property) |
| { |
| - if (!RuntimeEnabledFeatures::webAnimationsSVGEnabled() || !element.isSVGElement() || !isSVGPrefixed(property)) |
|
suzyh_UTC10 (ex-contributor)
2016/07/07 05:59:44
Why do we no longer need the SVG element checks he
|
| - return nullptr; |
| - |
| - SVGElement& svgElement = toSVGElement(element); |
| - if (isSVGSMILElement(svgElement)) |
| + if (!RuntimeEnabledFeatures::webAnimationsSVGEnabled() || !isSVGPrefixed(property)) |
| return nullptr; |
| String unprefixedProperty = removeSVGPrefix(property); |
| QualifiedName attributeName = svgAttributeName(unprefixedProperty); |
| const AttributeNameMap& supportedAttributes = getSupportedAttributes(); |
| auto iter = supportedAttributes.find(attributeName); |
| - if (iter == supportedAttributes.end() || !svgElement.propertyFromAttribute(*iter->value)) |
| + if (iter == supportedAttributes.end()) |
| return nullptr; |
| return iter->value; |
| } |
| -PassRefPtr<TimingFunction> AnimationInputHelpers::parseTimingFunction(const String& string, Document* document, ExceptionState& exceptionState) |
| +PassRefPtr<TimingFunction> AnimationInputHelpers::parseTimingFunction(const String& string, Document& document, ExceptionState& exceptionState) |
| { |
| if (string.isEmpty()) { |
| exceptionState.throwTypeError("Easing may not be the empty string"); |
| @@ -214,24 +210,22 @@ PassRefPtr<TimingFunction> AnimationInputHelpers::parseTimingFunction(const Stri |
| if (!value || !value->isValueList()) { |
| ASSERT(!value || value->isCSSWideKeyword()); |
| bool throwTypeError = true; |
| - 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. See http://crbug.com/601672 |
| - if (string == "function (a){return a}") { |
| - Deprecation::countDeprecation(*document, UseCounter::WebAnimationsEasingAsFunctionLinear); |
| - throwTypeError = false; |
| - } else { |
| - UseCounter::count(*document, UseCounter::WebAnimationsEasingAsFunctionOther); |
| - } |
| + 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. See http://crbug.com/601672 |
| + if (string == "function (a){return a}") { |
| + Deprecation::countDeprecation(document, UseCounter::WebAnimationsEasingAsFunctionLinear); |
| + throwTypeError = false; |
| + } else { |
| + UseCounter::count(document, UseCounter::WebAnimationsEasingAsFunctionOther); |
| } |
| } |