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..ecfbc709bf0ef80354af26eda7abbbc6d61acf89 100644 |
--- a/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp |
+++ b/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp |
@@ -239,7 +239,7 @@ void SVGSMILElement::buildPendingResource() |
} |
AtomicString id; |
- AtomicString href = getAttribute(XLinkNames::hrefAttr); |
+ const AtomicString& href = SVGURIReference::legacyHrefString(*this); |
Element* target; |
if (href.isEmpty()) |
target = parentNode() && parentNode()->isElementNode() ? toElement(parentNode()) : nullptr; |
@@ -287,7 +287,13 @@ static inline QualifiedName constructQualifiedName(const SVGElement* svgElement, |
if (namespaceURI.isEmpty()) |
return anyQName(); |
- return QualifiedName(nullAtom, localName, namespaceURI); |
+ QualifiedName resolvedAttrName(nullAtom, localName, namespaceURI); |
+ // "Animation elements treat attributeName='xlink:href' as being an alias |
+ // for targetting the 'href' attribute." |
+ // https://svgwg.org/svg2-draft/types.html#__svg__SVGURIReference__href |
+ 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) |