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..0a496a711f76e23ba8c41b91bd14252fa0ab7b0b 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,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.) |
pdr.
2016/02/12 03:03:35
Nit: Can you shoot a quick email to www-svg to mak
davve
2016/02/12 07:26:14
I think fs may be aware of this already but there
fs
2016/02/12 11:49:58
Ah, there's where it was - I knew I had read it so
|
+ if (resolvedAttrName == XLinkNames::hrefAttr) |
+ return SVGNames::hrefAttr; |
+ return resolvedAttrName; |
} |
static inline void clearTimesWithDynamicOrigins(Vector<SMILTimeWithOrigin>& timeList) |
@@ -544,19 +548,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) |