Bug 1263060, part 2 - Prevent nsFrameLoader from loading sub-documents in XBL bindings documents. r=smaug
authorJonathan Watt <jwatt@jwatt.org>
Thu, 12 May 2016 17:22:25 +0100
changeset 297798 bb06914d6e8b96ea7d5c318da326febad908ab7c
parent 297797 b83624df78b34c6914ea89c9b364f63e921130ec
child 297799 59d454cec87fd6ddc8ea92bba1dcd79aa8256e82
push id19274
push userryanvm@gmail.com
push dateWed, 18 May 2016 16:14:35 +0000
treeherderfx-team@4cfa7a2cefa7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1263060
milestone49.0a1
Bug 1263060, part 2 - Prevent nsFrameLoader from loading sub-documents in XBL bindings documents. r=smaug
dom/base/nsFrameLoader.cpp
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -220,16 +220,21 @@ nsFrameLoader::LoadFrame()
     }
   }
 
   nsIDocument* doc = mOwnerContent->OwnerDoc();
   if (doc->IsStaticDocument()) {
     return NS_OK;
   }
 
+  if (doc->IsLoadedAsInteractiveData()) {
+    // XBL bindings doc shouldn't load sub-documents.
+    return NS_OK;
+  }
+
   nsCOMPtr<nsIURI> base_uri = mOwnerContent->GetBaseURI();
   const nsAFlatCString &doc_charset = doc->GetDocumentCharacterSet();
   const char *charset = doc_charset.IsEmpty() ? nullptr : doc_charset.get();
 
   nsCOMPtr<nsIURI> uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), src, charset, base_uri);
 
   // If the URI was malformed, try to recover by loading about:blank.