mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
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:
parent
5dcdd16255
commit
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
|
||||
|
Loading…
Reference in New Issue
Block a user