diff --git a/content/xslt/src/base/txURIUtils.cpp b/content/xslt/src/base/txURIUtils.cpp index e3c2569ad99e..912215d37980 100644 --- a/content/xslt/src/base/txURIUtils.cpp +++ b/content/xslt/src/base/txURIUtils.cpp @@ -298,7 +298,7 @@ PRBool URIUtils::CanCallerAccess(nsIDOMNode *aNode) } if (!principal) { - doc->GetPrincipal(getter_AddRefs(principal)); + principal = doc->GetPrincipal(); } if (!principal) { @@ -336,22 +336,18 @@ URIUtils::ResetWithSource(nsIDocument *aNewDoc, nsIDOMNode *aSourceNode) return; } - nsCOMPtr loadGroup; nsCOMPtr channel; - sourceDoc->GetDocumentLoadGroup(getter_AddRefs(loadGroup)); + nsCOMPtr loadGroup = sourceDoc->GetDocumentLoadGroup(); nsCOMPtr serv = do_GetService(NS_IOSERVICE_CONTRACTID); if (serv) { // Create a temporary channel to get nsIDocument->Reset to // do the right thing. We want the output document to get // much of the input document's characteristics. - nsCOMPtr docURL; - sourceDoc->GetDocumentURL(getter_AddRefs(docURL)); - serv->NewChannelFromURI(docURL, getter_AddRefs(channel)); + serv->NewChannelFromURI(sourceDoc->GetDocumentURL(), + getter_AddRefs(channel)); } aNewDoc->Reset(channel, loadGroup); - nsCOMPtr baseURL; - sourceDoc->GetBaseURL(getter_AddRefs(baseURL)); - aNewDoc->SetBaseURL(baseURL); + aNewDoc->SetBaseURL(sourceDoc->GetBaseURL()); } diff --git a/content/xslt/src/xml/txXMLParser.cpp b/content/xslt/src/xml/txXMLParser.cpp index b1d71bacb038..c14c80c005fd 100644 --- a/content/xslt/src/xml/txXMLParser.cpp +++ b/content/xslt/src/xml/txXMLParser.cpp @@ -81,10 +81,8 @@ txParseDocumentFromURI(const nsAString& aHref, const nsAString& aReferrer, nsCOMPtr theDocument; nsCOMPtr loaderDocument = do_QueryInterface(aLoader->getNSObj()); - nsCOMPtr loadGroup; - nsCOMPtr loaderUri; - loaderDocument->GetDocumentLoadGroup(getter_AddRefs(loadGroup)); - loaderDocument->GetDocumentURL(getter_AddRefs(loaderUri)); + nsCOMPtr loadGroup = loaderDocument->GetDocumentLoadGroup(); + nsIURI *loaderUri = loaderDocument->GetDocumentURL(); NS_ENSURE_TRUE(loaderUri, NS_ERROR_FAILURE); nsCOMPtr channel; diff --git a/content/xslt/src/xpath/Makefile.in b/content/xslt/src/xpath/Makefile.in index 11ab87526aea..97e1f9741b95 100644 --- a/content/xslt/src/xpath/Makefile.in +++ b/content/xslt/src/xpath/Makefile.in @@ -34,6 +34,7 @@ REQUIRES = string \ ifndef TX_EXE REQUIRES += dom \ content \ + necko \ widget \ xpconnect \ js \ diff --git a/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp b/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp index 1b71209a1274..4014ae7d4bf1 100644 --- a/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp +++ b/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp @@ -756,8 +756,7 @@ TX_CompileStylesheet(nsIDOMNode* aNode, txStylesheet** aStylesheet) } nsCOMPtr doc = do_QueryInterface(document); - nsCOMPtr uri; - doc->GetBaseURL(getter_AddRefs(uri)); + nsIURI *uri = doc->GetBaseURL(); nsCAutoString baseURI; uri->GetSpec(baseURI); diff --git a/content/xslt/src/xslt/txMozillaTextOutput.cpp b/content/xslt/src/xslt/txMozillaTextOutput.cpp index 1142f5c86daa..8e3780aaa8cd 100644 --- a/content/xslt/src/xslt/txMozillaTextOutput.cpp +++ b/content/xslt/src/xslt/txMozillaTextOutput.cpp @@ -168,23 +168,19 @@ void txMozillaTextOutput::createResultDocument(nsIDOMDocument* aSourceDocument, } // Reset and set up document - nsCOMPtr loadGroup; nsCOMPtr channel; nsCOMPtr sourceDoc = do_QueryInterface(aSourceDocument); - sourceDoc->GetDocumentLoadGroup(getter_AddRefs(loadGroup)); + nsCOMPtr loadGroup = sourceDoc->GetDocumentLoadGroup(); nsCOMPtr serv = do_GetService(NS_IOSERVICE_CONTRACTID); if (serv) { // Create a temporary channel to get nsIDocument->Reset to // do the right thing. We want the output document to get // much of the input document's characteristics. - nsCOMPtr docURL; - sourceDoc->GetDocumentURL(getter_AddRefs(docURL)); - serv->NewChannelFromURI(docURL, getter_AddRefs(channel)); + serv->NewChannelFromURI(sourceDoc->GetDocumentURL(), + getter_AddRefs(channel)); } doc->Reset(channel, loadGroup); - nsCOMPtr baseURL; - sourceDoc->GetBaseURL(getter_AddRefs(baseURL)); - doc->SetBaseURL(baseURL); + doc->SetBaseURL(sourceDoc->GetBaseURL()); // Notify the contentsink that the document is created nsCOMPtr observer = do_QueryReferent(mObserver); @@ -236,11 +232,7 @@ void txMozillaTextOutput::createResultDocument(nsIDOMDocument* aSourceDocument, return; } - rv = doc->SetRootContent(rootContent); - NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to set the root content"); - if (NS_FAILED(rv)) { - return; - } + doc->SetRootContent(rootContent); mDocument->CreateElementNS(XHTML_NSURI, NS_LITERAL_STRING("head"), diff --git a/content/xslt/src/xslt/txMozillaXMLOutput.cpp b/content/xslt/src/xslt/txMozillaXMLOutput.cpp index c8a6b9a01ca2..280e5ed1dc7f 100644 --- a/content/xslt/src/xslt/txMozillaXMLOutput.cpp +++ b/content/xslt/src/xslt/txMozillaXMLOutput.cpp @@ -208,16 +208,14 @@ void txMozillaXMLOutput::endDocument() if (!mRefreshString.IsEmpty()) { nsCOMPtr doc = do_QueryInterface(mDocument); - nsCOMPtr sgo; - doc->GetScriptGlobalObject(getter_AddRefs(sgo)); + nsIScriptGlobalObject *sgo = doc->GetScriptGlobalObject(); if (sgo) { nsCOMPtr docShell; sgo->GetDocShell(getter_AddRefs(docShell)); nsCOMPtr refURI = do_QueryInterface(docShell); if (refURI) { - nsCOMPtr baseURI; - doc->GetBaseURL(getter_AddRefs(baseURI)); - refURI->SetupRefreshURIFromHeader(baseURI, mRefreshString); + refURI->SetupRefreshURIFromHeader(doc->GetBaseURL(), + mRefreshString); } } } @@ -739,8 +737,7 @@ txMozillaXMLOutput::createResultDocument(const nsAString& aName, PRInt32 aNsID, } // Set up script loader of the result document. - nsCOMPtr loader; - doc->GetScriptLoader(getter_AddRefs(loader)); + nsIScriptLoader *loader = doc->GetScriptLoader(); if (loader) { if (mNotifier) { loader->AddObserver(mNotifier); @@ -904,9 +901,8 @@ txTransformNotifier::SignalTransformEnd() // XXX Need a better way to determine transform success/failure if (mDocument) { - nsCOMPtr loader; nsCOMPtr doc = do_QueryInterface(mDocument); - doc->GetScriptLoader(getter_AddRefs(loader)); + nsIScriptLoader *loader = doc->GetScriptLoader(); if (loader) { loader->RemoveObserver(this); }