Necko Only!! Yuck. something was pretty bogus here...whenever we were parsing a url we'd create an empty

base url then try to turn the empty url into an absolute url which was returning an error. Looks like ParseURL would
never work.
This commit is contained in:
mscott%netscape.com 1999-07-20 23:53:03 +00:00
Родитель 65b3084270
Коммит 10605b7823
3 изменённых файлов: 15 добавлений и 57 удалений

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

@ -33,6 +33,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#include "nsCOMPtr.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
@ -2459,25 +2460,10 @@ PRBool CSSParserImpl::ParseURL(PRInt32& aErrorCode, nsCSSValue& aValue)
nsString baseURL;
nsresult rv;
#ifdef NECKO
nsIURI* base;
if (baseURL.Length() == 0) {
rv = NS_NewURI(&base, baseURL);
}
else {
rv = mURL->Clone(&base);
}
if (NS_FAILED(rv)) return PR_FALSE;
char* str = tk->mIdent.ToNewCString();
if (!str) {
NS_RELEASE(base);
aErrorCode = NS_ERROR_OUT_OF_MEMORY;
return PR_FALSE;
}
rv = NS_MakeAbsoluteURI(str, base, absURL);
NS_RELEASE(base);
delete [] str;
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv))
rv = NS_MakeAbsoluteURI(nsCAutoString(tk->mIdent), base, absURL);
#else
rv = NS_MakeAbsoluteURL(mURL, baseURL, tk->mIdent, absURL);
#endif // NECKO

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

@ -33,6 +33,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#include "nsCOMPtr.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
@ -2459,25 +2460,10 @@ PRBool CSSParserImpl::ParseURL(PRInt32& aErrorCode, nsCSSValue& aValue)
nsString baseURL;
nsresult rv;
#ifdef NECKO
nsIURI* base;
if (baseURL.Length() == 0) {
rv = NS_NewURI(&base, baseURL);
}
else {
rv = mURL->Clone(&base);
}
if (NS_FAILED(rv)) return PR_FALSE;
char* str = tk->mIdent.ToNewCString();
if (!str) {
NS_RELEASE(base);
aErrorCode = NS_ERROR_OUT_OF_MEMORY;
return PR_FALSE;
}
rv = NS_MakeAbsoluteURI(str, base, absURL);
NS_RELEASE(base);
delete [] str;
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv))
rv = NS_MakeAbsoluteURI(nsCAutoString(tk->mIdent), base, absURL);
#else
rv = NS_MakeAbsoluteURL(mURL, baseURL, tk->mIdent, absURL);
#endif // NECKO

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

@ -33,6 +33,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#include "nsCOMPtr.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
@ -2459,25 +2460,10 @@ PRBool CSSParserImpl::ParseURL(PRInt32& aErrorCode, nsCSSValue& aValue)
nsString baseURL;
nsresult rv;
#ifdef NECKO
nsIURI* base;
if (baseURL.Length() == 0) {
rv = NS_NewURI(&base, baseURL);
}
else {
rv = mURL->Clone(&base);
}
if (NS_FAILED(rv)) return PR_FALSE;
char* str = tk->mIdent.ToNewCString();
if (!str) {
NS_RELEASE(base);
aErrorCode = NS_ERROR_OUT_OF_MEMORY;
return PR_FALSE;
}
rv = NS_MakeAbsoluteURI(str, base, absURL);
NS_RELEASE(base);
delete [] str;
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv))
rv = NS_MakeAbsoluteURI(nsCAutoString(tk->mIdent), base, absURL);
#else
rv = NS_MakeAbsoluteURL(mURL, baseURL, tk->mIdent, absURL);
#endif // NECKO