diff --git a/content/base/src/nsDataDocumentContentPolicy.cpp b/content/base/src/nsDataDocumentContentPolicy.cpp
index 4f198cfe6a64..f9da09b4202c 100644
--- a/content/base/src/nsDataDocumentContentPolicy.cpp
+++ b/content/base/src/nsDataDocumentContentPolicy.cpp
@@ -78,8 +78,8 @@ nsDataDocumentContentPolicy::ShouldLoad(PRUint32 aContentType,
return NS_OK;
}
- // Nothing else is OK to load for data documents
- if (doc->IsLoadedAsData()) {
+ // Nothing else is OK to load for data documents or SVG-as-an-image documents
+ if (doc->IsLoadedAsData() || doc->IsBeingUsedAsImage()) {
*aDecision = nsIContentPolicy::REJECT_TYPE;
return NS_OK;
}
diff --git a/layout/reftests/svg/as-image/img-and-image-1-ref.svg b/layout/reftests/svg/as-image/img-and-image-1-ref.svg
index 275ed35ea634..022a907aadbb 100644
--- a/layout/reftests/svg/as-image/img-and-image-1-ref.svg
+++ b/layout/reftests/svg/as-image/img-and-image-1-ref.svg
@@ -29,10 +29,18 @@
+
diff --git a/layout/reftests/svg/as-image/reftest.list b/layout/reftests/svg/as-image/reftest.list
index 2eb5cb18efd6..b554c8f3ad99 100644
--- a/layout/reftests/svg/as-image/reftest.list
+++ b/layout/reftests/svg/as-image/reftest.list
@@ -52,8 +52,8 @@ fails == canvas-drawImage-slice-1b.html lime100x100-ref.html # XXX all edges fuz
# Test with mix of and referring to the same images,
# with a variety of preserveAspectRatio values in play.
-# NOTE: The reference cases in this test triggers 72 assertions (bug 563481)
-asserts(72) == img-and-image-1.html img-and-image-1-ref.svg
+# NOTE: The reference cases in this test triggers 30 assertions (bug 563481)
+asserts(30) == img-and-image-1.html img-and-image-1-ref.svg
# More complex tests
random-if(gtk2Widget) == img-anim-1.html lime100x100-ref.html # bug 612214