Bug 700895 patch 3: Apply nsDataDocumentContentPolicy::ShouldLoad()'s external-resource-doc restrictions to image documents, too. r=roc
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 14 Nov 2011 11:21:41 +1300
changeset 80211 7ff1026f98809b300e9491fb62c8562e73447782
parent 80210 8abaa54efb2a3df4e7589056354790055115c6d0
child 80212 05a5faf71deff841e925a9e471efa6e19daf78f5
push id323
push userrcampbell@mozilla.com
push dateTue, 15 Nov 2011 21:58:36 +0000
treeherderfx-team@3ea216303184 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs700895
milestone11.0a1
Bug 700895 patch 3: Apply nsDataDocumentContentPolicy::ShouldLoad()'s external-resource-doc restrictions to image documents, too. r=roc
content/base/src/nsDataDocumentContentPolicy.cpp
--- a/content/base/src/nsDataDocumentContentPolicy.cpp
+++ b/content/base/src/nsDataDocumentContentPolicy.cpp
@@ -133,22 +133,22 @@ nsDataDocumentContentPolicy::ShouldLoad(
       if (NS_FAILED(rv) || isRecursiveLoad) {
         NS_WARNING("Refusing to recursively load image");
         *aDecision = nsIContentPolicy::REJECT_TYPE;
       }
     }
     return NS_OK;
   }
 
-  // Allow all loads for non-external-resource documents
-  if (!doc->GetDisplayDocument()) {
+  // Allow all loads for non-resource documents
+  if (!doc->IsResourceDoc()) {
     return NS_OK;
   }
 
-  // For external resources, blacklist some load types
+  // For resource documents, blacklist some load types
   if (aContentType == nsIContentPolicy::TYPE_OBJECT ||
       aContentType == nsIContentPolicy::TYPE_DOCUMENT ||
       aContentType == nsIContentPolicy::TYPE_SUBDOCUMENT ||
       aContentType == nsIContentPolicy::TYPE_SCRIPT) {
     *aDecision = nsIContentPolicy::REJECT_TYPE;
   }
 
   return NS_OK;