Checked in from wrong tree, backing out, sorry.

This commit is contained in:
doronr%us.ibm.com 2005-02-18 21:28:20 +00:00
Родитель 49534b8c41
Коммит 8e0413d060
8 изменённых файлов: 3 добавлений и 142 удалений

Просмотреть файл

@ -61,9 +61,6 @@
#include "nsContentUtils.h"
#include "nsUnicharUtils.h"
#include "nsAutoPtr.h"
#include "nsIConsoleService.h"
#include "nsIScriptError.h"
#include "nsIStringBundle.h"
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
@ -522,8 +519,6 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement,
request->mWasPending = PR_TRUE;
request->mLoading = PR_TRUE;
request->mLineNo = aElement->GetScriptLineNumber();
// Add the request to our pending requests list
mPendingRequests.AppendObject(request);
@ -787,98 +782,6 @@ DetectByteOrderMark(const unsigned char* aBytes, PRInt32 aLen, nsCString& oChars
return !oCharset.IsEmpty();
}
/**
* Report an error to the error console.
* @param aErrorName The name of a string in css.properties.
* @param aParams The parameters for that string in css.properties.
* @param aParamsLength The length of aParams.
* @param aErrorFlags Error/warning flag to pass to nsIScriptError::Init.
*
*/
static nsresult
ReportToConsole2(const PRUnichar* aMessageName, const PRUnichar **aParams,
PRUint32 aParamsLength, PRUint32 aErrorFlags, PRInt32* aLineNum,
const PRUnichar* aSrcFileName)
{
nsresult rv;
nsCOMPtr<nsIConsoleService> consoleService =
do_GetService(NS_CONSOLESERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIScriptError> errorObject =
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStringBundleService> stringBundleService =
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStringBundle> bundle;
rv = stringBundleService->CreateBundle(
"chrome://global/locale/layout/MediaDocument.properties", getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
nsXPIDLString errorText;
rv = bundle->FormatStringFromName(aMessageName, aParams, aParamsLength,
getter_Copies(errorText));
NS_ENSURE_SUCCESS(rv, rv);
rv = errorObject->Init(errorText.get(),
aSrcFileName, /* file name */
EmptyString().get(), /* source line */
*aLineNum, /* line number */
0, /* column number */
aErrorFlags,
"CSS Loader");
NS_ENSURE_SUCCESS(rv, rv);
consoleService->LogMessage(errorObject);
return NS_OK;
}
static nsresult
ReportToConsole(nsIURI* aScriptURI, nsIURI* aDocumentURI, PRInt32* aLineNum)
{
nsresult rv;
nsCOMPtr<nsIConsoleService> consoleService =
do_GetService(NS_CONSOLESERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIScriptError> errorObject =
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStringBundleService> stringBundleService =
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStringBundle> bundle;
rv = stringBundleService->CreateBundle(
"chrome://global/locale/content/content.properties", getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
nsXPIDLString errorText;
nsCAutoString url;
rv = aScriptURI->GetSpec(url);
NS_ConvertUTF8toUTF16 ucsString(url);
const PRUnichar *strings[] = { ucsString.get() };
rv = bundle->FormatStringFromName(NS_LITERAL_STRING("InvalidScriptSrc").get(),
strings, 1,
getter_Copies(errorText));
NS_ENSURE_SUCCESS(rv, rv);
nsCAutoString documentUrl;
aDocumentURI->GetSpec(documentUrl);
NS_ConvertUTF8toUTF16 srcDocumentUrl(documentUrl);
rv = errorObject->Init(errorText.get(),
srcDocumentUrl.get(), /* file name */
EmptyString().get(), /* source line */
*aLineNum, /* line number */
0, /* column number */
nsIScriptError::warningFlag,
"Script Loader");
NS_ENSURE_SUCCESS(rv, rv);
consoleService->LogMessage(errorObject);
return NS_OK;
}
NS_IMETHODIMP
nsScriptLoader::OnStreamComplete(nsIStreamLoader* aLoader,
@ -895,14 +798,6 @@ nsScriptLoader::OnStreamComplete(nsIStreamLoader* aLoader,
}
if (NS_FAILED(aStatus)) {
if (mDocument){
// since aStatus shows we failed, a script file failed to load.
// Report this to the JavaScript console.
ReportToConsole(request->mURI, mDocument->GetDocumentURI(), &request->mLineNo);
}
mPendingRequests.RemoveObject(request);
FireScriptAvailable(aStatus, request, EmptyString());
ProcessPendingReqests();
@ -929,14 +824,6 @@ nsScriptLoader::OnStreamComplete(nsIStreamLoader* aLoader,
PRBool requestSucceeded;
rv = httpChannel->GetRequestSucceeded(&requestSucceeded);
if (NS_SUCCEEDED(rv) && !requestSucceeded) {
if (mDocument){
// since requestSucceeded is false, it means that the file couldn't be loaded.
// report this to the JavaScript console.
ReportToConsole(request->mURI, mDocument->GetDocumentURI(), &request->mLineNo);
}
mPendingRequests.RemoveObject(request);
FireScriptAvailable(NS_ERROR_NOT_AVAILABLE, request,
EmptyString());

Просмотреть файл

@ -652,6 +652,7 @@ nsHTMLScriptElement::MaybeProcessScript()
rv = loader->ProcessScriptElement(this, this);
mEvaluating = PR_FALSE;
}
if (rv == NS_CONTENT_SCRIPT_IS_EVENTHANDLER) {
// If the script has NOT been executed yet then create a script

Просмотреть файл

@ -43,7 +43,7 @@
#include "nsAutoPtr.h"
#include "nsIStringBundle.h"
#define NSMEDIADOCUMENT_PROPERTIES_URI "chrome://global/locale/layout/MediaDocument.properties"
#define NSMEDIADOCUMENT_PROPERTIES_URI "chrome://communicator/locale/layout/MediaDocument.properties"
class nsMediaDocument : public nsHTMLDocument
{

Просмотреть файл

@ -70,7 +70,6 @@ REQUIRES = xpcom \
unicharutil \
windowwatcher \
locale \
xuldoc \
$(NULL)
CPPSRCS = \

Просмотреть файл

@ -42,6 +42,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src tests
DIRS = public src
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -50,7 +50,6 @@
#include "nsISupports.h"
#include "nsString.h"
#include "nsIDocument.h"
class nsForwardReference;
class nsIAtom;
@ -161,6 +160,5 @@ public:
// factory functions
nsresult NS_NewXULDocument(nsIXULDocument** result);
nsresult NS_NewXULDocument(nsIDocument** result);
#endif // nsIXULDocument_h___

Просмотреть файл

@ -467,28 +467,6 @@ NS_NewXULDocument(nsIXULDocument** result)
}
nsresult
NS_NewXULDocument(nsIDocument** result)
{
NS_PRECONDITION(result != nsnull, "null ptr");
if (! result)
return NS_ERROR_NULL_POINTER;
nsXULDocument* doc = new nsXULDocument();
if (! doc)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(doc);
nsresult rv;
if (NS_FAILED(rv = doc->Init())) {
NS_RELEASE(doc);
return rv;
}
*result = doc;
return NS_OK;
}
//----------------------------------------------------------------------
//
// nsISupports interface

Просмотреть файл

@ -55,7 +55,6 @@
#include "nsIXULPrototypeDocument.h"
#include "nsScriptLoader.h"
#include "nsIStreamListener.h"
#include "nsIDocument.h"
class nsIRDFResource;
class nsIRDFService;
@ -174,7 +173,6 @@ protected:
// Implementation methods
friend nsresult
NS_NewXULDocument(nsIXULDocument** aResult);
friend nsresult NS_NewXULDocument(nsIDocument** aResult);
nsresult Init(void);
nsresult StartLayout(void);