Index: Source/core/svg/SVGImageElement.cpp |
diff --git a/Source/core/svg/SVGImageElement.cpp b/Source/core/svg/SVGImageElement.cpp |
index 0a318b46d683374e6d5bf78210232a13e5389986..4e6cbd0e0050aa5f2d215e89d60f62a37ea5a852 100644 |
--- a/Source/core/svg/SVGImageElement.cpp |
+++ b/Source/core/svg/SVGImageElement.cpp |
@@ -39,7 +39,7 @@ SVGImageElement::SVGImageElement(Document& document) |
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths)) |
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths)) |
, m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())) |
- , m_imageLoader(this) |
+ , m_imageLoader(SVGImageLoader::create(this)) |
, m_needsLoaderURIUpdate(true) |
{ |
ScriptWrappable::init(this); |
@@ -51,6 +51,12 @@ SVGImageElement::SVGImageElement(Document& document) |
addToPropertyMap(m_preserveAspectRatio); |
} |
+void SVGImageElement::trace(Visitor* visitor) |
+{ |
+ visitor->trace(m_imageLoader); |
+ SVGGraphicsElement::trace(visitor); |
+} |
+ |
bool SVGImageElement::currentFrameHasSingleSecurityOrigin() const |
{ |
if (RenderSVGImage* renderSVGImage = toRenderSVGImage(renderer())) { |
@@ -137,7 +143,7 @@ void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName) |
if (SVGURIReference::isKnownAttribute(attrName)) { |
if (inDocument()) |
- m_imageLoader.updateFromElementIgnoringPreviousError(); |
+ imageLoader().updateFromElementIgnoringPreviousError(); |
else |
m_needsLoaderURIUpdate = true; |
return; |
@@ -176,7 +182,7 @@ RenderObject* SVGImageElement::createRenderer(RenderStyle*) |
bool SVGImageElement::haveLoadedRequiredResources() |
{ |
- return !m_needsLoaderURIUpdate && !m_imageLoader.hasPendingActivity(); |
+ return !m_needsLoaderURIUpdate && !imageLoader().hasPendingActivity(); |
} |
void SVGImageElement::attach(const AttachContext& context) |
@@ -187,7 +193,7 @@ void SVGImageElement::attach(const AttachContext& context) |
if (imageObj->imageResource()->hasImage()) |
return; |
- imageObj->imageResource()->setImageResource(m_imageLoader.image()); |
+ imageObj->imageResource()->setImageResource(imageLoader().image()); |
} |
} |
@@ -200,13 +206,13 @@ Node::InsertionNotificationRequest SVGImageElement::insertedInto(ContainerNode* |
// We can only resolve base URIs properly after tree insertion - hence, URI mutations while |
// detached are deferred until this point. |
if (m_needsLoaderURIUpdate) { |
- m_imageLoader.updateFromElementIgnoringPreviousError(); |
+ imageLoader().updateFromElementIgnoringPreviousError(); |
m_needsLoaderURIUpdate = false; |
} else { |
// A previous loader update may have failed to actually fetch the image if the document |
// was inactive. In that case, force a re-update (but don't clear previous errors). |
- if (!m_imageLoader.image()) |
- m_imageLoader.updateFromElement(); |
+ if (!imageLoader().image()) |
+ imageLoader().updateFromElement(); |
} |
return InsertionDone; |
@@ -219,7 +225,7 @@ const AtomicString SVGImageElement::imageSourceURL() const |
void SVGImageElement::didMoveToNewDocument(Document& oldDocument) |
{ |
- m_imageLoader.elementDidMoveToNewDocument(); |
+ imageLoader().elementDidMoveToNewDocument(); |
SVGGraphicsElement::didMoveToNewDocument(oldDocument); |
} |