Bug 221335: Speed up output by using internal methods and interfaces rather than nsIDOMNode and friends. r/sr=peterv
git-svn-id: svn://10.0.0.236/trunk@213051 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -346,33 +346,36 @@ nsXMLContentSink::DidBuildModel()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXMLContentSink::OnDocumentCreated(nsIDOMDocument* aResultDocument)
|
||||
nsXMLContentSink::OnDocumentCreated(nsIDocument* aResultDocument)
|
||||
{
|
||||
NS_ENSURE_ARG(aResultDocument);
|
||||
|
||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||
mDocShell->GetContentViewer(getter_AddRefs(contentViewer));
|
||||
if (contentViewer) {
|
||||
return contentViewer->SetDOMDocument(aResultDocument);
|
||||
nsCOMPtr<nsIDOMDocument> doc = do_QueryInterface(aResultDocument);
|
||||
return contentViewer->SetDOMDocument(doc);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXMLContentSink::OnTransformDone(nsresult aResult,
|
||||
nsIDOMDocument* aResultDocument)
|
||||
nsIDocument* aResultDocument)
|
||||
{
|
||||
NS_ASSERTION(NS_FAILED(aResult) || aResultDocument,
|
||||
"Don't notify about transform success without a document.");
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aResultDocument);
|
||||
|
||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||
mDocShell->GetContentViewer(getter_AddRefs(contentViewer));
|
||||
|
||||
if (NS_FAILED(aResult) && contentViewer) {
|
||||
// Transform failed.
|
||||
if (aResultDocument) {
|
||||
if (domDoc) {
|
||||
// We have an error document.
|
||||
contentViewer->SetDOMDocument(aResultDocument);
|
||||
contentViewer->SetDOMDocument(domDoc);
|
||||
}
|
||||
else {
|
||||
// We don't have an error document, display the
|
||||
@@ -386,7 +389,7 @@ nsXMLContentSink::OnTransformDone(nsresult aResult,
|
||||
if (NS_SUCCEEDED(aResult) || aResultDocument) {
|
||||
// Transform succeeded or it failed and we have an error
|
||||
// document to display.
|
||||
mDocument = do_QueryInterface(aResultDocument);
|
||||
mDocument = aResultDocument;
|
||||
}
|
||||
|
||||
nsIScriptLoader *loader = originalDocument->GetScriptLoader();
|
||||
|
||||
@@ -89,8 +89,8 @@ public:
|
||||
virtual nsISupports *GetTarget();
|
||||
|
||||
// nsITransformObserver
|
||||
NS_IMETHOD OnDocumentCreated(nsIDOMDocument *aResultDocument);
|
||||
NS_IMETHOD OnTransformDone(nsresult aResult, nsIDOMDocument *aResultDocument);
|
||||
NS_IMETHOD OnDocumentCreated(nsIDocument *aResultDocument);
|
||||
NS_IMETHOD OnTransformDone(nsresult aResult, nsIDocument *aResultDocument);
|
||||
|
||||
static void ParsePIData(const nsString &aData, nsString &aHref,
|
||||
nsString &aTitle, nsString &aMedia,
|
||||
|
||||
Reference in New Issue
Block a user