Bug 29148. Don't abort in the case where an invalid stylesheet reference has somehow made it into the prototype document, but the stylesheet was never put into the cache (an empty CSS file will cause this to happen). Instead, just keep on truckin'. r=rjc, a=jar

This commit is contained in:
waterson%netscape.com 2000-03-03 23:14:09 +00:00
Родитель db16fa08a6
Коммит 0c4fe6e173
2 изменённых файлов: 22 добавлений и 4 удалений

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

@ -5383,9 +5383,18 @@ nsXULDocument::AddPrototypeSheets()
rv = gXULCache->GetStyleSheet(uri, getter_AddRefs(sheet));
if (NS_FAILED(rv)) return rv;
NS_ASSERTION(sheet != nsnull, "uh oh, sheet wasn't in the cache. go reload it");
// If we don't get a style sheet from the cache, then the
// really rigorous thing to do here would be to go out and try
// to load it again. (This would allow us to do partial
// invalidation of the cache, which would be cool, but would
// also require some more thinking.)
//
// Reality is, we end up in this situation if, when parsing
// the original XUL document, there -was- no style sheet at
// the specified URL, or the stylesheet was empty. So, just
// skip it.
if (! sheet)
return NS_ERROR_UNEXPECTED;
continue;
nsCOMPtr<nsICSSStyleSheet> newsheet;
rv = sheet->Clone(*getter_AddRefs(newsheet));

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

@ -5383,9 +5383,18 @@ nsXULDocument::AddPrototypeSheets()
rv = gXULCache->GetStyleSheet(uri, getter_AddRefs(sheet));
if (NS_FAILED(rv)) return rv;
NS_ASSERTION(sheet != nsnull, "uh oh, sheet wasn't in the cache. go reload it");
// If we don't get a style sheet from the cache, then the
// really rigorous thing to do here would be to go out and try
// to load it again. (This would allow us to do partial
// invalidation of the cache, which would be cool, but would
// also require some more thinking.)
//
// Reality is, we end up in this situation if, when parsing
// the original XUL document, there -was- no style sheet at
// the specified URL, or the stylesheet was empty. So, just
// skip it.
if (! sheet)
return NS_ERROR_UNEXPECTED;
continue;
nsCOMPtr<nsICSSStyleSheet> newsheet;
rv = sheet->Clone(*getter_AddRefs(newsheet));