@@ -147,6 +147,10 @@ nsresult SVGImageElement::LoadSVGImage(bool aForce, bool aNotify) {
147147 return LoadImage (href, aForce, aNotify, eImageLoadType_Normal);
148148}
149149
150+ bool SVGImageElement::ShouldLoadImage () const {
151+ return LoadingEnabled () && OwnerDoc ()->ShouldLoadImages ();
152+ }
153+
150154// ----------------------------------------------------------------------
151155// EventTarget methods:
152156
@@ -180,7 +184,9 @@ nsresult SVGImageElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
180184 if (aName == nsGkAtoms::href && (aNamespaceID == kNameSpaceID_None ||
181185 aNamespaceID == kNameSpaceID_XLink )) {
182186 if (aValue) {
183- LoadSVGImage (true , aNotify);
187+ if (ShouldLoadImage ()) {
188+ LoadSVGImage (true , aNotify);
189+ }
184190 } else {
185191 CancelImageRequests (aNotify);
186192 }
@@ -209,8 +215,9 @@ nsresult SVGImageElement::BindToTree(BindContext& aContext, nsINode& aParent) {
209215
210216 nsImageLoadingContent::BindToTree (aContext, aParent);
211217
212- if (mStringAttributes [HREF].IsExplicitlySet () ||
213- mStringAttributes [XLINK_HREF].IsExplicitlySet ()) {
218+ if ((mStringAttributes [HREF].IsExplicitlySet () ||
219+ mStringAttributes [XLINK_HREF].IsExplicitlySet ()) &&
220+ ShouldLoadImage ()) {
214221 nsContentUtils::AddScriptRunner (
215222 NewRunnableMethod (" dom::SVGImageElement::MaybeLoadSVGImage" , this ,
216223 &SVGImageElement::MaybeLoadSVGImage));
0 commit comments