From a5e9725c843a02f92204dc381ac740fc6ec7aa6f Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Wed, 16 Jun 1999 06:16:53 +0000 Subject: [PATCH] dont emit error messages when sheets canceled after doc disconnect --- content/html/style/src/nsCSSLoader.cpp | 22 +++++++++++++--------- layout/html/style/src/nsCSSLoader.cpp | 22 +++++++++++++--------- layout/style/nsCSSLoader.cpp | 22 +++++++++++++--------- 3 files changed, 39 insertions(+), 27 deletions(-) diff --git a/content/html/style/src/nsCSSLoader.cpp b/content/html/style/src/nsCSSLoader.cpp index 6f689d1d56b..7299c3a31e6 100644 --- a/content/html/style/src/nsCSSLoader.cpp +++ b/content/html/style/src/nsCSSLoader.cpp @@ -748,15 +748,19 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader, Cleanup(key, aLoadData); } } - else { // load failed, cleanup - // Dump error message to console. - const char *url; - if (nsnull != aLoadData->mURL) - aLoadData->mURL->GetSpec(&url); - else - url = ""; - cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url - << "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n"; + else { // load failed or document now gone, cleanup + if (mDocument) { // still have doc, must have failed + // Dump error message to console. + const char *url; + if (nsnull != aLoadData->mURL) { + aLoadData->mURL->GetSpec(&url); + } + else { + url = ""; + } + cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url + << "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n"; + } URLKey key(aLoadData->mURL); Cleanup(key, aLoadData); diff --git a/layout/html/style/src/nsCSSLoader.cpp b/layout/html/style/src/nsCSSLoader.cpp index 6f689d1d56b..7299c3a31e6 100644 --- a/layout/html/style/src/nsCSSLoader.cpp +++ b/layout/html/style/src/nsCSSLoader.cpp @@ -748,15 +748,19 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader, Cleanup(key, aLoadData); } } - else { // load failed, cleanup - // Dump error message to console. - const char *url; - if (nsnull != aLoadData->mURL) - aLoadData->mURL->GetSpec(&url); - else - url = ""; - cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url - << "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n"; + else { // load failed or document now gone, cleanup + if (mDocument) { // still have doc, must have failed + // Dump error message to console. + const char *url; + if (nsnull != aLoadData->mURL) { + aLoadData->mURL->GetSpec(&url); + } + else { + url = ""; + } + cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url + << "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n"; + } URLKey key(aLoadData->mURL); Cleanup(key, aLoadData); diff --git a/layout/style/nsCSSLoader.cpp b/layout/style/nsCSSLoader.cpp index 6f689d1d56b..7299c3a31e6 100644 --- a/layout/style/nsCSSLoader.cpp +++ b/layout/style/nsCSSLoader.cpp @@ -748,15 +748,19 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader, Cleanup(key, aLoadData); } } - else { // load failed, cleanup - // Dump error message to console. - const char *url; - if (nsnull != aLoadData->mURL) - aLoadData->mURL->GetSpec(&url); - else - url = ""; - cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url - << "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n"; + else { // load failed or document now gone, cleanup + if (mDocument) { // still have doc, must have failed + // Dump error message to console. + const char *url; + if (nsnull != aLoadData->mURL) { + aLoadData->mURL->GetSpec(&url); + } + else { + url = ""; + } + cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url + << "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n"; + } URLKey key(aLoadData->mURL); Cleanup(key, aLoadData);