зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1267075
- Part 2: bail out early if it's for data document. r=bz
Check the document earlier before calling into imageLoader, this could save us tons of time if in the end the document isn't allowed to load images.
This commit is contained in:
Родитель
5dcdd16255
Коммит
83ef929df9
|
@ -809,6 +809,14 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
|
|||
}
|
||||
}
|
||||
|
||||
// Data documents, or documents from DOMParser shouldn't perform image loading.
|
||||
if (aDocument->IsLoadedAsData()) {
|
||||
SetBlockedRequest(nsIContentPolicy::REJECT_REQUEST);
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
FireEvent(NS_LITERAL_STRING("loadend"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// URI equality check.
|
||||
//
|
||||
// We skip the equality check if our current image was blocked, since in that
|
||||
|
|
Загрузка…
Ссылка в новой задаче