Show alt text for images blocked by security checks. Bug 285981, r=mvl, sr=jst

git-svn-id: svn://10.0.0.236/trunk@171233 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2005-03-26 02:26:58 +00:00
parent 2c0d748f2a
commit 40ce30bcaa
2 changed files with 6 additions and 5 deletions

View File

@@ -1832,7 +1832,9 @@ nsContentUtils::CanLoadImage(nsIURI* aURI, nsISupports* aContext,
nsIScriptSecurityManager::ALLOW_CHROME);
if (NS_FAILED(rv)) {
if (aImageBlockingStatus) {
*aImageBlockingStatus = nsIContentPolicy::REJECT_SERVER;
// Reject the request itself, not all requests to the relevant
// server...
*aImageBlockingStatus = nsIContentPolicy::REJECT_REQUEST;
}
return PR_FALSE;
}

View File

@@ -450,9 +450,8 @@ nsresult
nsImageFrame::HandleLoadError(PRInt16 aImageStatus)
{
if (!NS_CP_ACCEPTED(aImageStatus) &&
aImageStatus != nsIContentPolicy::REJECT_TYPE) {
// The image is blocked, but not because all images are blocked.
// don't display any alt feedback in this case; we're blocking images
aImageStatus == nsIContentPolicy::REJECT_SERVER) {
// Don't display any alt feedback in this case; we're blocking images
// from that site and don't care to see anything from them
return NS_OK;
}
@@ -1348,7 +1347,7 @@ nsImageFrame::Paint(nsPresContext* aPresContext,
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer &&
(NS_CP_ACCEPTED(imageStatus) ||
imageStatus == nsIContentPolicy::REJECT_TYPE)) {
imageStatus != nsIContentPolicy::REJECT_SERVER)) {
DisplayAltFeedback(aPresContext, aRenderingContext,
(loadStatus & imgIRequest::STATUS_ERROR)
? gIconLoad->mBrokenImage