Fixing bug 79133 (by working around the real problem). Image onerror events cause window.onerror handlers to be called since the events bubble up the tree. r=brendan@mozilla.org, sr=vidur@netscape.com

This commit is contained in:
jst%netscape.com 2001-10-16 00:30:41 +00:00
Родитель 95643699a5
Коммит a59ab8bd75
1 изменённых файлов: 4 добавлений и 3 удалений

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

@ -1797,7 +1797,8 @@ nsGenericElement::HandleDOMEvent(nsIPresContext* aPresContext,
PRBool intermediateCapture = PR_FALSE;
//Capturing stage evaluation
if (NS_EVENT_FLAG_BUBBLE != aFlags && aEvent->message != NS_PAGE_LOAD
&& aEvent->message != NS_SCRIPT_LOAD) {
&& aEvent->message != NS_SCRIPT_LOAD &&
aEvent->message != NS_IMAGE_ERROR && aEvent->message != NS_IMAGE_LOAD) {
//Initiate capturing phase. Special case first call to document
if (parent) {
parent->HandleDOMEvent(aPresContext, aEvent, aDOMEvent, NS_EVENT_FLAG_CAPTURE, aEventStatus);
@ -1836,8 +1837,8 @@ nsGenericElement::HandleDOMEvent(nsIPresContext* aPresContext,
//Bubbling stage
if (NS_EVENT_FLAG_CAPTURE != aFlags && mDocument &&
aEvent->message != NS_PAGE_LOAD &&
aEvent->message != NS_SCRIPT_LOAD) {
aEvent->message != NS_PAGE_LOAD && aEvent->message != NS_SCRIPT_LOAD &&
aEvent->message != NS_IMAGE_ERROR && aEvent->message != NS_IMAGE_LOAD) {
if (parent) {
/*
* If there's a parent we pass the event to the parent...