Bug 770684, make sure chrome DOMParser doesn't load external resources, r=bz

This commit is contained in:
Olli Pettay 2012-07-09 21:24:58 +03:00
parent 713fec65d3
commit 1a5e02680d

View File

@ -69,9 +69,6 @@ nsDOMParser::ParseFromString(const PRUnichar *str,
rv = SetUpDocument(DocumentFlavorHTML, getter_AddRefs(domDocument));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocument> document = do_QueryInterface(domDocument);
nsDependentString sourceBuffer(str);
rv = nsContentUtils::ParseDocumentHTML(sourceBuffer, document, false);
NS_ENSURE_SUCCESS(rv, rv);
// Keep the XULXBL state, base URL and principal setting in sync with the
// XML case
@ -85,6 +82,10 @@ nsDOMParser::ParseFromString(const PRUnichar *str,
// And the right principal
document->SetPrincipal(mPrincipal);
nsDependentString sourceBuffer(str);
rv = nsContentUtils::ParseDocumentHTML(sourceBuffer, document, false);
NS_ENSURE_SUCCESS(rv, rv);
domDocument.forget(aResult);
return rv;
}