Chromium Code Reviews| Index: Source/core/animation/EffectInput.cpp |
| diff --git a/Source/core/animation/EffectInput.cpp b/Source/core/animation/EffectInput.cpp |
| index 7aebdfb6bc241f5280c21797be809363ff34d101..82d9db38b47b621e9e29b2f877ea76411d219b3c 100644 |
| --- a/Source/core/animation/EffectInput.cpp |
| +++ b/Source/core/animation/EffectInput.cpp |
| @@ -44,6 +44,7 @@ |
| #include "core/dom/Element.h" |
| #include "core/dom/NodeComputedStyle.h" |
| #include "core/svg/animation/SVGSMILElement.h" |
| +#include "wtf/ASCIICType.h" |
| #include "wtf/HashSet.h" |
| #include "wtf/NonCopyingSort.h" |
| @@ -51,13 +52,18 @@ namespace blink { |
| namespace { |
| +bool svgPrefixed(const String& property) |
| +{ |
| + return property.length() >= 4 && property.startsWith("svg") && isASCIIUpper(property[3]); |
| +} |
| + |
| QualifiedName svgAttributeName(String property) |
| { |
| - if (property.length() >= 4 && property.startsWith("svg")) { |
| - // Replace 'svgTransform' with 'transform', etc. |
| - property.remove(0, 3); |
| - property = property.lower(); |
| - } |
| + // Replace 'svgTransform' with 'transform', etc. |
| + ASSERT(svgPrefixed(property)); |
| + UChar first = toASCIILower(property[3]); |
| + property.remove(0, 4); |
| + property.insert(&first, 1, 0); |
|
shans
2015/06/07 06:42:06
This differs from the previous behaviour, but I as
Eric Willigers
2015/06/09 04:02:12
Yes, I was sloppy before, it is now correct.
alancutter (OOO until 2018)
2015/06/09 06:25:05
So we no longer support animating things like svgc
|
| if (property == "href") |
| return XLinkNames::hrefAttr; |
| @@ -260,7 +266,7 @@ PassRefPtrWillBeRawPtr<EffectModel> EffectInput::convert(Element* element, const |
| continue; |
| } |
| - if (!RuntimeEnabledFeatures::webAnimationsSVGEnabled() || !element->isSVGElement()) |
| + if (!RuntimeEnabledFeatures::webAnimationsSVGEnabled() || !element->isSVGElement() || !svgPrefixed(property)) |
| continue; |
| SVGElement* svgElement = toSVGElement(element); |