summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGUseElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
commitcd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch)
tree8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Source/WebCore/svg/SVGUseElement.cpp
parentd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff)
downloadqtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Source/WebCore/svg/SVGUseElement.cpp')
-rw-r--r--Source/WebCore/svg/SVGUseElement.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/Source/WebCore/svg/SVGUseElement.cpp b/Source/WebCore/svg/SVGUseElement.cpp
index 55f70f453..272e01d38 100644
--- a/Source/WebCore/svg/SVGUseElement.cpp
+++ b/Source/WebCore/svg/SVGUseElement.cpp
@@ -198,18 +198,10 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
return;
if (SVGURIReference::isKnownAttribute(attrName)) {
- if (hasPendingResources()) {
- OwnPtr<SVGDocumentExtensions::SVGPendingElements> clients(document()->accessSVGExtensions()->removePendingResource(m_resourceId));
- ASSERT(!clients->isEmpty());
-
- const SVGDocumentExtensions::SVGPendingElements::const_iterator end = clients->end();
- for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients->begin(); it != end; ++it) {
- ASSERT((*it)->hasPendingResources());
- (*it)->clearHasPendingResourcesIfPossible();
- }
-
+ SVGDocumentExtensions* extensions = document()->accessSVGExtensions();
+ if (hasPendingResources() && extensions->isElementPendingResource(this, m_resourceId)) {
+ extensions->removePendingResourceForElement(m_resourceId, this);
m_resourceId = String();
- clearHasPendingResourcesIfPossible();
}
m_targetElementInstance = 0;
@@ -460,19 +452,18 @@ void SVGUseElement::buildPendingResource()
String id;
Element* targetElement = SVGURIReference::targetElementFromIRIString(href(), document(), &id);
ASSERT(!m_targetElementInstance);
+ SVGDocumentExtensions* extensions = document()->accessSVGExtensions();
if (!targetElement) {
- if (hasPendingResources() || id.isEmpty())
+ if ((hasPendingResources() && extensions->isElementPendingResource(this, id)) || id.isEmpty())
return;
m_resourceId = id;
- ASSERT(!hasPendingResources());
- document()->accessSVGExtensions()->addPendingResource(id, this);
+ extensions->addPendingResource(id, this);
ASSERT(hasPendingResources());
return;
}
-
if (hasPendingResources()) {
ASSERT(!m_targetElementInstance);
m_resourceId = String();