Chromium Code Reviews| Index: Source/core/svg/SVGDocumentExtensions.cpp |
| diff --git a/Source/core/svg/SVGDocumentExtensions.cpp b/Source/core/svg/SVGDocumentExtensions.cpp |
| index 6f678e64e5167d0c64efa8a5029687b7485050a9..b05c0ba5ee43044e814311ccd76cc2118e57a7e6 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, RebuildTargetFilter filter) |
|
pdr.
2014/05/27 00:45:32
I think this is better but I still have the same q
|
| { |
| ASSERT(referencedElement); |
| HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*> > >::iterator it = m_elementDependencies.find(referencedElement); |
| @@ -369,10 +370,14 @@ 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 (filter == ExcludeUseElements && isSVGUseElement(**vectorIt)) |
| + continue; |
| + |
| + (*vectorIt)->svgAttributeChanged(XLinkNames::hrefAttr); |
| } |
| } |