Fix for 108486, XUL images should fire onload. r=jkeiser, sr=jst

git-svn-id: svn://10.0.0.236/trunk@107324 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hyatt%netscape.com
2001-11-05 08:27:01 +00:00
parent 250742ac78
commit 124acde668
2 changed files with 6 additions and 1 deletions

View File

@@ -3285,6 +3285,9 @@ nsXULElement::HandleDOMEvent(nsIPresContext* aPresContext,
else return NS_ERROR_FAILURE;
}
}
else if (aEvent->message == NS_IMAGE_LOAD)
return NS_OK; // Don't let these events bubble or be captured. Just allow them
// on the target image.
// Find out if we're anonymous.
nsCOMPtr<nsIContent> bindingParent;

View File

@@ -762,8 +762,10 @@ NS_IMETHODIMP nsImageBoxFrame::OnStopContainer(imgIRequest *request, nsIPresCont
NS_IMETHODIMP nsImageBoxFrame::OnStopDecode(imgIRequest *request, nsIPresContext *aPresContext, nsresult aStatus, const PRUnichar *statusArg)
{
if (NS_FAILED(aStatus))
if (NS_SUCCEEDED(aStatus))
// Fire an onerror DOM event.
FireDOMEvent(mContent, NS_IMAGE_LOAD);
else // Fire an onload DOM event.
FireDOMEvent(mContent, NS_IMAGE_ERROR);
return NS_OK;