# HG changeset patch # User Daniel Holbert # Parent 63ad56438630b389efdb01632e153143cf3008ec Bug 1319122 followup: Add code-comment and mochitest for this bug. r?xidorn MozReview-Commit-ID: IJRPOD5jMFh diff --git a/dom/base/nsDataDocumentContentPolicy.cpp b/dom/base/nsDataDocumentContentPolicy.cpp --- a/dom/base/nsDataDocumentContentPolicy.cpp +++ b/dom/base/nsDataDocumentContentPolicy.cpp @@ -70,16 +70,19 @@ nsDataDocumentContentPolicy::ShouldLoad( if (doc->IsLoadedAsData()) { // ...but let static (print/print preview) documents to load fonts. if (!doc->IsStaticDocument() || aContentType != nsIContentPolicy::TYPE_FONT) { *aDecision = nsIContentPolicy::REJECT_TYPE; return NS_OK; } } + // If |doc| is an external resources document (i.e. if it has a + // non-null display document), then we need to perform our SVG-image-specific + // checks on its display document, rather than on |doc| itself. nsIDocument* docToCheckForImage = doc->GetDisplayDocument(); if (!docToCheckForImage) { docToCheckForImage = doc; } if (docToCheckForImage->IsBeingUsedAsImage()) { // We only allow SVG images to load content from URIs that are local and // also satisfy one of the following conditions: diff --git a/dom/svg/test/mochitest.ini b/dom/svg/test/mochitest.ini --- a/dom/svg/test/mochitest.ini +++ b/dom/svg/test/mochitest.ini @@ -34,16 +34,18 @@ support-files = [test_animLengthObjectIdentity.xhtml] [test_animLengthReadonly.xhtml] [test_animLengthUnits.xhtml] [test_bbox-with-invalid-viewBox.xhtml] [test_bbox.xhtml] [test_bbox-changes.xhtml] [test_bounds.html] [test_bug872812.html] +[test_bug1319122.html] +support-files = red.png svg-with-external-resource-datauri.svg [test_getBBox-method.html] [test_dataTypes.html] [test_dataTypesModEvents.html] [test_fragments.html] [test_getCTM.html] [test_getElementById.xhtml] [test_getSubStringLength.xhtml] [test_lang.xhtml] diff --git a/dom/html/reftests/red.png b/dom/svg/test/red.png copy from dom/html/reftests/red.png copy to dom/svg/test/red.png diff --git a/dom/svg/test/svg-with-external-resource-datauri.svg b/dom/svg/test/svg-with-external-resource-datauri.svg new file mode 100644 --- /dev/null +++ b/dom/svg/test/svg-with-external-resource-datauri.svg @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/dom/svg/test/test_bug1319122.html b/dom/svg/test/test_bug1319122.html new file mode 100644 --- /dev/null +++ b/dom/svg/test/test_bug1319122.html @@ -0,0 +1,135 @@ + + + + + + Test for Bug 1319122 + + + + + + +Mozilla Bug 1319122 +

+
+ + +
+
+
+
+ + +