bug 110555 Ignoring error when user css files not found. r=dveditz,

sr=hyatt
This commit is contained in:
dp%netscape.com 2001-12-09 16:14:02 +00:00
Родитель 87d028dd2e
Коммит 1a3b0b8915
4 изменённых файлов: 46 добавлений и 22 удалений

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

@ -2499,12 +2499,9 @@ nsChromeRegistry::GetProfileRoot(nsCString& aFileURL)
defaultUserChromeFile->Append("userChrome.css");
// copy along
rv = defaultUserContentFile->CopyTo(userChromeDir, nsnull);
if (NS_FAILED(rv))
return rv;
rv = defaultUserChromeFile->CopyTo(userChromeDir, nsnull);
if (NS_FAILED(rv))
return rv;
// It aint an error if these files dont exist
(void) defaultUserContentFile->CopyTo(userChromeDir, nsnull);
(void) defaultUserChromeFile->CopyTo(userChromeDir, nsnull);
}
}
if (NS_FAILED(rv))

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

@ -1605,13 +1605,28 @@ CSSLoaderImpl::LoadAgentSheet(nsIURI* aURL,
#ifdef DEBUG
else {
// Dump an error message to the console
PRBool ignoreError = PR_FALSE;
nsXPIDLCString url;
aURL->GetSpec(getter_Copies(url));
nsCAutoString errorMessage(NS_LITERAL_CSTRING("CSSLoaderImpl::LoadAgentSheet: Load of URL '") +
nsDependentCString(url) +
NS_LITERAL_CSTRING("' failed. Error code: "));
errorMessage.AppendInt(NS_ERROR_GET_CODE(result));
NS_WARNING(errorMessage.get());
// Ignore userChrome.css and userContent.css failures
#define USERCHROMECSS "userChrome.css"
#define USERCONTENTCSS "userContent.css"
if (url.Length() > sizeof(USERCHROMECSS) &&
Substring(url, url.Length()-sizeof(USERCHROMECSS)+1, sizeof(USERCHROMECSS)).Equals(NS_LITERAL_CSTRING(USERCHROMECSS)))
ignoreError = PR_TRUE;
if (!ignoreError &&
url.Length() > sizeof(USERCONTENTCSS) &&
Substring(url, url.Length()-sizeof(USERCONTENTCSS)+1, sizeof(USERCONTENTCSS)).Equals(NS_LITERAL_CSTRING(USERCONTENTCSS)))
ignoreError = PR_TRUE;
if (!ignoreError) {
nsCAutoString errorMessage(NS_LITERAL_CSTRING("CSSLoaderImpl::LoadAgentSheet: Load of URL '") +
nsDependentCString(url) +
NS_LITERAL_CSTRING("' failed. Error code: "));
errorMessage.AppendInt(NS_ERROR_GET_CODE(result));
NS_WARNING(errorMessage.get());
}
}
#endif
}

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

@ -1605,13 +1605,28 @@ CSSLoaderImpl::LoadAgentSheet(nsIURI* aURL,
#ifdef DEBUG
else {
// Dump an error message to the console
PRBool ignoreError = PR_FALSE;
nsXPIDLCString url;
aURL->GetSpec(getter_Copies(url));
nsCAutoString errorMessage(NS_LITERAL_CSTRING("CSSLoaderImpl::LoadAgentSheet: Load of URL '") +
nsDependentCString(url) +
NS_LITERAL_CSTRING("' failed. Error code: "));
errorMessage.AppendInt(NS_ERROR_GET_CODE(result));
NS_WARNING(errorMessage.get());
// Ignore userChrome.css and userContent.css failures
#define USERCHROMECSS "userChrome.css"
#define USERCONTENTCSS "userContent.css"
if (url.Length() > sizeof(USERCHROMECSS) &&
Substring(url, url.Length()-sizeof(USERCHROMECSS)+1, sizeof(USERCHROMECSS)).Equals(NS_LITERAL_CSTRING(USERCHROMECSS)))
ignoreError = PR_TRUE;
if (!ignoreError &&
url.Length() > sizeof(USERCONTENTCSS) &&
Substring(url, url.Length()-sizeof(USERCONTENTCSS)+1, sizeof(USERCONTENTCSS)).Equals(NS_LITERAL_CSTRING(USERCONTENTCSS)))
ignoreError = PR_TRUE;
if (!ignoreError) {
nsCAutoString errorMessage(NS_LITERAL_CSTRING("CSSLoaderImpl::LoadAgentSheet: Load of URL '") +
nsDependentCString(url) +
NS_LITERAL_CSTRING("' failed. Error code: "));
errorMessage.AppendInt(NS_ERROR_GET_CODE(result));
NS_WARNING(errorMessage.get());
}
}
#endif
}

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

@ -2499,12 +2499,9 @@ nsChromeRegistry::GetProfileRoot(nsCString& aFileURL)
defaultUserChromeFile->Append("userChrome.css");
// copy along
rv = defaultUserContentFile->CopyTo(userChromeDir, nsnull);
if (NS_FAILED(rv))
return rv;
rv = defaultUserChromeFile->CopyTo(userChromeDir, nsnull);
if (NS_FAILED(rv))
return rv;
// It aint an error if these files dont exist
(void) defaultUserContentFile->CopyTo(userChromeDir, nsnull);
(void) defaultUserChromeFile->CopyTo(userChromeDir, nsnull);
}
}
if (NS_FAILED(rv))