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:
cvshook%sicking.cc
2006-10-03 02:22:22 +00:00
parent 94dfc843e3
commit b6bee32b30
23 changed files with 934 additions and 674 deletions

View File

@@ -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();

View File

@@ -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,