| Index: third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp b/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp
|
| index 2f4c6b338876ab592123f9a37c06fff7e66ad0e6..d7b95a2b1eba1641ad68194c37b562bbcaa77589 100644
|
| --- a/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp
|
| +++ b/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp
|
| @@ -239,7 +239,9 @@ void SVGSMILElement::buildPendingResource()
|
| }
|
|
|
| AtomicString id;
|
| - AtomicString href = getAttribute(XLinkNames::hrefAttr);
|
| + AtomicString href = getAttribute(SVGNames::hrefAttr);
|
| + if (href.isNull())
|
| + href = getAttribute(XLinkNames::hrefAttr);
|
| Element* target;
|
| if (href.isEmpty())
|
| target = parentNode() && parentNode()->isElementNode() ? toElement(parentNode()) : nullptr;
|
| @@ -287,7 +289,11 @@ static inline QualifiedName constructQualifiedName(const SVGElement* svgElement,
|
| if (namespaceURI.isEmpty())
|
| return anyQName();
|
|
|
| - return QualifiedName(nullAtom, localName, namespaceURI);
|
| + QualifiedName resolvedAttrName(nullAtom, localName, namespaceURI);
|
| + // 'xlink:href' should map to 'href' for animation purposes. (It's possible that I just dreamt this.)
|
| + if (resolvedAttrName == XLinkNames::hrefAttr)
|
| + return SVGNames::hrefAttr;
|
| + return resolvedAttrName;
|
| }
|
|
|
| static inline void clearTimesWithDynamicOrigins(Vector<SMILTimeWithOrigin>& timeList)
|
| @@ -544,19 +550,20 @@ void SVGSMILElement::parseAttribute(const QualifiedName& name, const AtomicStrin
|
|
|
| void SVGSMILElement::svgAttributeChanged(const QualifiedName& attrName)
|
| {
|
| - if (attrName == SVGNames::durAttr)
|
| + if (attrName == SVGNames::durAttr) {
|
| m_cachedDur = invalidCachedTime;
|
| - else if (attrName == SVGNames::repeatDurAttr)
|
| + } else if (attrName == SVGNames::repeatDurAttr) {
|
| m_cachedRepeatDur = invalidCachedTime;
|
| - else if (attrName == SVGNames::repeatCountAttr)
|
| + } else if (attrName == SVGNames::repeatCountAttr) {
|
| m_cachedRepeatCount = invalidCachedTime;
|
| - else if (attrName == SVGNames::minAttr)
|
| + } else if (attrName == SVGNames::minAttr) {
|
| m_cachedMin = invalidCachedTime;
|
| - else if (attrName == SVGNames::maxAttr)
|
| + } else if (attrName == SVGNames::maxAttr) {
|
| m_cachedMax = invalidCachedTime;
|
| - else if (attrName == SVGNames::attributeNameAttr)
|
| + } else if (attrName == SVGNames::attributeNameAttr) {
|
| setAttributeName(constructQualifiedName(this, fastGetAttribute(SVGNames::attributeNameAttr)));
|
| - else if (attrName.matches(XLinkNames::hrefAttr)) {
|
| + } else if (attrName.matches(SVGNames::hrefAttr) || attrName.matches(XLinkNames::hrefAttr)) {
|
| + // TODO(fs): Could be smarter here when 'href' is specified and 'xlink:href' is changed.
|
| SVGElement::InvalidationGuard invalidationGuard(this);
|
| buildPendingResource();
|
| if (m_targetElement)
|
|
|