Index: Source/core/svg/SVGDocumentExtensions.cpp |
diff --git a/Source/core/svg/SVGDocumentExtensions.cpp b/Source/core/svg/SVGDocumentExtensions.cpp |
index 6f678e64e5167d0c64efa8a5029687b7485050a9..a1344f842d0c214c89b48c80b61ffa3ced765536 100644 |
--- a/Source/core/svg/SVGDocumentExtensions.cpp |
+++ b/Source/core/svg/SVGDocumentExtensions.cpp |
@@ -31,6 +31,7 @@ |
#include "core/svg/SVGViewSpec.h" |
#include "core/svg/SVGZoomAndPan.h" |
#include "core/svg/animation/SMILTimeContainer.h" |
+#include "core/svg/animation/SVGSMILElement.h" |
#include "wtf/TemporaryChange.h" |
#include "wtf/text/AtomicString.h" |
@@ -351,7 +352,7 @@ void SVGDocumentExtensions::removeAllTargetReferencesForElement(SVGElement* refe |
m_elementDependencies.removeAll(toBeRemoved); |
} |
-void SVGDocumentExtensions::rebuildAllElementReferencesForTarget(SVGElement* referencedElement) |
+void SVGDocumentExtensions::rebuildAllElementReferencesForTarget(SVGElement* referencedElement, bool onlySMILElements) |
esprehn
2014/05/23 04:38:17
An enum would be nicer, then it's more clear. Smil
kouhei (in TOK)
2014/05/23 07:17:15
Done.
|
{ |
ASSERT(referencedElement); |
HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*> > >::iterator it = m_elementDependencies.find(referencedElement); |
@@ -369,13 +370,22 @@ void SVGDocumentExtensions::rebuildAllElementReferencesForTarget(SVGElement* ref |
Vector<SVGElement*>::iterator vectorEnd = toBeNotified.end(); |
for (Vector<SVGElement*>::iterator vectorIt = toBeNotified.begin(); vectorIt != vectorEnd; ++vectorIt) { |
// Before rebuilding referencingElement ensure it was not removed from under us. |
- if (HashSet<SVGElement*>* referencingElements = setOfElementsReferencingTarget(referencedElement)) { |
- if (referencingElements->contains(*vectorIt)) |
- (*vectorIt)->svgAttributeChanged(XLinkNames::hrefAttr); |
- } |
+ HashSet<SVGElement*>* referencingElements = setOfElementsReferencingTarget(referencedElement); |
+ if (!referencingElements || !referencingElements->contains(*vectorIt)) |
+ continue; |
+ |
+ if (onlySMILElements && !isSVGSMILElement(**vectorIt)) |
+ continue; |
+ |
+ (*vectorIt)->svgAttributeChanged(XLinkNames::hrefAttr); |
} |
} |
+void SVGDocumentExtensions::rebuildSMILElementReferencesForTarget(SVGElement* referencedElement) |
+{ |
+ rebuildAllElementReferencesForTarget(referencedElement, true); |
+} |
+ |
void SVGDocumentExtensions::removeAllElementReferencesForTarget(SVGElement* referencedElement) |
{ |
ASSERT(referencedElement); |