Index: third_party/WebKit/Source/core/svg/SVGMPathElement.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGMPathElement.cpp b/third_party/WebKit/Source/core/svg/SVGMPathElement.cpp |
index 5ce2f931b40015922af34a03daee3f72499928b6..7de98e4f75fcf902f17a1deb484dc67c61a1c2f8 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGMPathElement.cpp |
+++ b/third_party/WebKit/Source/core/svg/SVGMPathElement.cpp |
@@ -19,10 +19,11 @@ |
#include "core/svg/SVGMPathElement.h" |
+#include "core/SVGNames.h" |
#include "core/dom/Document.h" |
+#include "core/dom/IdTargetObserver.h" |
#include "core/svg/SVGAnimateMotionElement.h" |
#include "core/svg/SVGPathElement.h" |
-#include "core/svg/SVGTreeScopeResources.h" |
namespace blink { |
@@ -32,6 +33,7 @@ inline SVGMPathElement::SVGMPathElement(Document& document) |
} |
DEFINE_TRACE(SVGMPathElement) { |
+ visitor->trace(m_targetIdObserver); |
SVGElement::trace(visitor); |
SVGURIReference::trace(visitor); |
} |
@@ -44,30 +46,18 @@ void SVGMPathElement::buildPendingResource() { |
clearResourceReferences(); |
if (!isConnected()) |
return; |
- |
- AtomicString id; |
- Element* target = SVGURIReference::targetElementFromIRIString( |
- hrefString(), treeScope(), &id); |
- if (!target) { |
- // Do not register as pending if we are already pending this resource. |
- if (treeScope().ensureSVGTreeScopedResources().isElementPendingResource( |
- *this, id)) |
- return; |
- if (!id.isEmpty()) { |
- treeScope().ensureSVGTreeScopedResources().addPendingResource(id, *this); |
- DCHECK(hasPendingResources()); |
- } |
- } else if (isSVGPathElement(target)) { |
+ Element* target = observeTarget(m_targetIdObserver, *this); |
+ if (isSVGPathElement(target)) { |
// Register us with the target in the dependencies map. Any change of |
// hrefElement that leads to relayout/repainting now informs us, so we can |
// react to it. |
addReferenceTo(toSVGElement(target)); |
} |
- |
targetPathChanged(); |
} |
void SVGMPathElement::clearResourceReferences() { |
+ unobserveTarget(m_targetIdObserver); |
removeAllOutgoingReferences(); |
} |