зеркало из https://github.com/mozilla/pjs.git
Removed #ifdef NECKO noise; added text/css
This commit is contained in:
Родитель
147322f9aa
Коммит
bf044a59ce
|
@ -21,9 +21,7 @@
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "nsIDocumentViewer.h"
|
#include "nsIDocumentViewer.h"
|
||||||
#include "nsIURL.h"
|
#include "nsIURL.h"
|
||||||
#ifdef NECKO
|
|
||||||
#include "nsNeckoUtil.h"
|
#include "nsNeckoUtil.h"
|
||||||
#endif // NECKO
|
|
||||||
#include "nsICSSLoader.h"
|
#include "nsICSSLoader.h"
|
||||||
#include "nsICSSStyleSheet.h"
|
#include "nsICSSStyleSheet.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
|
@ -62,6 +60,7 @@ static char* gHTMLTypes[] = {
|
||||||
"text/html",
|
"text/html",
|
||||||
"application/rtf",
|
"application/rtf",
|
||||||
"text/plain",
|
"text/plain",
|
||||||
|
"text/css",
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -123,12 +122,8 @@ public:
|
||||||
|
|
||||||
// for nsIDocumentLoaderFactory
|
// for nsIDocumentLoaderFactory
|
||||||
NS_IMETHOD CreateInstance(const char* aCommand,
|
NS_IMETHOD CreateInstance(const char* aCommand,
|
||||||
#ifdef NECKO
|
|
||||||
nsIChannel* aChannel,
|
nsIChannel* aChannel,
|
||||||
nsILoadGroup* aLoadGroup,
|
nsILoadGroup* aLoadGroup,
|
||||||
#else
|
|
||||||
nsIURI* aURL,
|
|
||||||
#endif
|
|
||||||
const char* aContentType,
|
const char* aContentType,
|
||||||
nsIContentViewerContainer* aContainer,
|
nsIContentViewerContainer* aContainer,
|
||||||
nsISupports* aExtraInfo,
|
nsISupports* aExtraInfo,
|
||||||
|
@ -151,24 +146,16 @@ public:
|
||||||
nsresult InitUAStyleSheet();
|
nsresult InitUAStyleSheet();
|
||||||
|
|
||||||
nsresult CreateDocument(const char* aCommand,
|
nsresult CreateDocument(const char* aCommand,
|
||||||
#ifdef NECKO
|
|
||||||
nsIChannel* aChannel,
|
nsIChannel* aChannel,
|
||||||
nsILoadGroup* aLoadGroup,
|
nsILoadGroup* aLoadGroup,
|
||||||
#else
|
|
||||||
nsIURI* aURL,
|
|
||||||
#endif
|
|
||||||
nsIContentViewerContainer* aContainer,
|
nsIContentViewerContainer* aContainer,
|
||||||
const nsCID& aDocumentCID,
|
const nsCID& aDocumentCID,
|
||||||
nsIStreamListener** aDocListener,
|
nsIStreamListener** aDocListener,
|
||||||
nsIContentViewer** aDocViewer);
|
nsIContentViewer** aDocViewer);
|
||||||
|
|
||||||
nsresult CreateRDFDocument(const char* aCommand,
|
nsresult CreateRDFDocument(const char* aCommand,
|
||||||
#ifdef NECKO
|
|
||||||
nsIChannel* aChannel,
|
nsIChannel* aChannel,
|
||||||
nsILoadGroup* aLoadGroup,
|
nsILoadGroup* aLoadGroup,
|
||||||
#else
|
|
||||||
nsIURI* aURL,
|
|
||||||
#endif
|
|
||||||
const char* aContentType,
|
const char* aContentType,
|
||||||
nsIContentViewerContainer* aContainer,
|
nsIContentViewerContainer* aContainer,
|
||||||
nsISupports* aExtraInfo,
|
nsISupports* aExtraInfo,
|
||||||
|
@ -244,12 +231,8 @@ nsLayoutDLF::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsLayoutDLF::CreateInstance(const char *aCommand,
|
nsLayoutDLF::CreateInstance(const char *aCommand,
|
||||||
#ifdef NECKO
|
|
||||||
nsIChannel* aChannel,
|
nsIChannel* aChannel,
|
||||||
nsILoadGroup* aLoadGroup,
|
nsILoadGroup* aLoadGroup,
|
||||||
#else
|
|
||||||
nsIURI* aURL,
|
|
||||||
#endif
|
|
||||||
const char* aContentType,
|
const char* aContentType,
|
||||||
nsIContentViewerContainer* aContainer,
|
nsIContentViewerContainer* aContainer,
|
||||||
nsISupports* aExtraInfo,
|
nsISupports* aExtraInfo,
|
||||||
|
@ -272,11 +255,7 @@ nsLayoutDLF::CreateInstance(const char *aCommand,
|
||||||
while(gHTMLTypes[typeIndex]) {
|
while(gHTMLTypes[typeIndex]) {
|
||||||
if (0== PL_strcmp(gHTMLTypes[typeIndex++], aContentType)) {
|
if (0== PL_strcmp(gHTMLTypes[typeIndex++], aContentType)) {
|
||||||
return CreateDocument(aCommand,
|
return CreateDocument(aCommand,
|
||||||
#ifdef NECKO
|
|
||||||
aChannel, aLoadGroup,
|
aChannel, aLoadGroup,
|
||||||
#else
|
|
||||||
aURL,
|
|
||||||
#endif
|
|
||||||
aContainer, kHTMLDocumentCID,
|
aContainer, kHTMLDocumentCID,
|
||||||
aDocListener, aDocViewer);
|
aDocListener, aDocViewer);
|
||||||
}
|
}
|
||||||
|
@ -287,11 +266,7 @@ nsLayoutDLF::CreateInstance(const char *aCommand,
|
||||||
while(gXMLTypes[typeIndex]) {
|
while(gXMLTypes[typeIndex]) {
|
||||||
if (0== PL_strcmp(gXMLTypes[typeIndex++], aContentType)) {
|
if (0== PL_strcmp(gXMLTypes[typeIndex++], aContentType)) {
|
||||||
return CreateDocument(aCommand,
|
return CreateDocument(aCommand,
|
||||||
#ifdef NECKO
|
|
||||||
aChannel, aLoadGroup,
|
aChannel, aLoadGroup,
|
||||||
#else
|
|
||||||
aURL,
|
|
||||||
#endif
|
|
||||||
aContainer, kXMLDocumentCID,
|
aContainer, kXMLDocumentCID,
|
||||||
aDocListener, aDocViewer);
|
aDocListener, aDocViewer);
|
||||||
}
|
}
|
||||||
|
@ -302,11 +277,7 @@ nsLayoutDLF::CreateInstance(const char *aCommand,
|
||||||
while (gRDFTypes[typeIndex]) {
|
while (gRDFTypes[typeIndex]) {
|
||||||
if (0 == PL_strcmp(gRDFTypes[typeIndex++], aContentType)) {
|
if (0 == PL_strcmp(gRDFTypes[typeIndex++], aContentType)) {
|
||||||
return CreateRDFDocument(aCommand,
|
return CreateRDFDocument(aCommand,
|
||||||
#ifdef NECKO
|
|
||||||
aChannel, aLoadGroup,
|
aChannel, aLoadGroup,
|
||||||
#else
|
|
||||||
aURL,
|
|
||||||
#endif
|
|
||||||
aContentType, aContainer,
|
aContentType, aContainer,
|
||||||
aExtraInfo, aDocListener, aDocViewer);
|
aExtraInfo, aDocListener, aDocViewer);
|
||||||
}
|
}
|
||||||
|
@ -317,11 +288,7 @@ nsLayoutDLF::CreateInstance(const char *aCommand,
|
||||||
while(gImageTypes[typeIndex]) {
|
while(gImageTypes[typeIndex]) {
|
||||||
if (0== PL_strcmp(gImageTypes[typeIndex++], aContentType)) {
|
if (0== PL_strcmp(gImageTypes[typeIndex++], aContentType)) {
|
||||||
return CreateDocument(aCommand,
|
return CreateDocument(aCommand,
|
||||||
#ifdef NECKO
|
|
||||||
aChannel, aLoadGroup,
|
aChannel, aLoadGroup,
|
||||||
#else
|
|
||||||
aURL,
|
|
||||||
#endif
|
|
||||||
aContainer, kImageDocumentCID,
|
aContainer, kImageDocumentCID,
|
||||||
aDocListener, aDocViewer);
|
aDocListener, aDocViewer);
|
||||||
}
|
}
|
||||||
|
@ -371,12 +338,8 @@ nsLayoutDLF::CreateInstanceForDocument(nsIContentViewerContainer* aContainer,
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsLayoutDLF::CreateDocument(const char* aCommand,
|
nsLayoutDLF::CreateDocument(const char* aCommand,
|
||||||
#ifdef NECKO
|
|
||||||
nsIChannel* aChannel,
|
nsIChannel* aChannel,
|
||||||
nsILoadGroup* aLoadGroup,
|
nsILoadGroup* aLoadGroup,
|
||||||
#else
|
|
||||||
nsIURI* aURL,
|
|
||||||
#endif
|
|
||||||
nsIContentViewerContainer* aContainer,
|
nsIContentViewerContainer* aContainer,
|
||||||
const nsCID& aDocumentCID,
|
const nsCID& aDocumentCID,
|
||||||
nsIStreamListener** aDocListener,
|
nsIStreamListener** aDocListener,
|
||||||
|
@ -384,11 +347,9 @@ nsLayoutDLF::CreateDocument(const char* aCommand,
|
||||||
{
|
{
|
||||||
nsresult rv = NS_ERROR_FAILURE;
|
nsresult rv = NS_ERROR_FAILURE;
|
||||||
|
|
||||||
#ifdef NECKO
|
|
||||||
nsCOMPtr<nsIURI> aURL;
|
nsCOMPtr<nsIURI> aURL;
|
||||||
rv = aChannel->GetURI(getter_AddRefs(aURL));
|
rv = aChannel->GetURI(getter_AddRefs(aURL));
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NOISY_CREATE_DOC
|
#ifdef NOISY_CREATE_DOC
|
||||||
if (nsnull != aURL) {
|
if (nsnull != aURL) {
|
||||||
|
@ -423,11 +384,7 @@ nsLayoutDLF::CreateDocument(const char* aCommand,
|
||||||
// Initialize the document to begin loading the data. An
|
// Initialize the document to begin loading the data. An
|
||||||
// nsIStreamListener connected to the parser is returned in
|
// nsIStreamListener connected to the parser is returned in
|
||||||
// aDocListener.
|
// aDocListener.
|
||||||
#ifdef NECKO
|
|
||||||
rv = doc->StartDocumentLoad(aCommand, aChannel, aLoadGroup, aContainer, aDocListener);
|
rv = doc->StartDocumentLoad(aCommand, aChannel, aLoadGroup, aContainer, aDocListener);
|
||||||
#else
|
|
||||||
rv = doc->StartDocumentLoad(aCommand, aURL, aContainer, aDocListener);
|
|
||||||
#endif
|
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -533,12 +490,8 @@ nsLayoutDLF::CreateRDFDocument(nsISupports* aExtraInfo,
|
||||||
// ...note, this RDF document _may_ be XUL :-)
|
// ...note, this RDF document _may_ be XUL :-)
|
||||||
nsresult
|
nsresult
|
||||||
nsLayoutDLF::CreateRDFDocument(const char* aCommand,
|
nsLayoutDLF::CreateRDFDocument(const char* aCommand,
|
||||||
#ifdef NECKO
|
|
||||||
nsIChannel* aChannel,
|
nsIChannel* aChannel,
|
||||||
nsILoadGroup* aLoadGroup,
|
nsILoadGroup* aLoadGroup,
|
||||||
#else
|
|
||||||
nsIURI* aURL,
|
|
||||||
#endif
|
|
||||||
const char* aContentType,
|
const char* aContentType,
|
||||||
nsIContentViewerContainer* aContainer,
|
nsIContentViewerContainer* aContainer,
|
||||||
nsISupports* aExtraInfo,
|
nsISupports* aExtraInfo,
|
||||||
|
@ -552,11 +505,9 @@ nsLayoutDLF::CreateRDFDocument(const char* aCommand,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NECKO
|
|
||||||
nsCOMPtr<nsIURI> aURL;
|
nsCOMPtr<nsIURI> aURL;
|
||||||
rv = aChannel->GetURI(getter_AddRefs(aURL));
|
rv = aChannel->GetURI(getter_AddRefs(aURL));
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the document to begin loading the data...
|
* Initialize the document to begin loading the data...
|
||||||
|
@ -564,11 +515,7 @@ nsLayoutDLF::CreateRDFDocument(const char* aCommand,
|
||||||
* An nsIStreamListener connected to the parser is returned in
|
* An nsIStreamListener connected to the parser is returned in
|
||||||
* aDocListener.
|
* aDocListener.
|
||||||
*/
|
*/
|
||||||
#ifdef NECKO
|
|
||||||
rv = doc->StartDocumentLoad(aCommand, aChannel, aLoadGroup, aContainer, aDocListener);
|
rv = doc->StartDocumentLoad(aCommand, aChannel, aLoadGroup, aContainer, aDocListener);
|
||||||
#else
|
|
||||||
rv = doc->StartDocumentLoad(aCommand, aURL, aContainer, aDocListener);
|
|
||||||
#endif
|
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
/*
|
/*
|
||||||
* Bind the document to the Content Viewer...
|
* Bind the document to the Content Viewer...
|
||||||
|
@ -622,11 +569,7 @@ nsLayoutDLF::InitUAStyleSheet()
|
||||||
|
|
||||||
if (nsnull == gUAStyleSheet) { // snarf one
|
if (nsnull == gUAStyleSheet) { // snarf one
|
||||||
nsIURI* uaURL;
|
nsIURI* uaURL;
|
||||||
#ifndef NECKO
|
|
||||||
rv = NS_NewURL(&uaURL, nsString(UA_CSS_URL)); // XXX this bites, fix it
|
|
||||||
#else
|
|
||||||
rv = NS_NewURI(&uaURL, UA_CSS_URL); // XXX this bites, fix it
|
rv = NS_NewURI(&uaURL, UA_CSS_URL); // XXX this bites, fix it
|
||||||
#endif // NECKO
|
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
nsICSSLoader* cssLoader;
|
nsICSSLoader* cssLoader;
|
||||||
rv = NS_NewCSSLoader(&cssLoader);
|
rv = NS_NewCSSLoader(&cssLoader);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче