Bug 335251, prevent load events to propagate to window, r=bz, sr=jst

This commit is contained in:
Olli.Pettay%helsinki.fi 2006-07-12 17:59:16 +00:00
parent dd95e269cd
commit 1b31151599
2 changed files with 8 additions and 4 deletions

View File

@ -3974,7 +3974,13 @@ nsDocument::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
// FIXME! This is a hack to make middle mouse paste working also in Editor.
// Bug 329119
aVisitor.mForceContentDispatch = PR_TRUE;
aVisitor.mParentTarget = GetWindow();
// Load events must not propagate to |window| object, see bug 335251.
if (!(aVisitor.mEvent->message == NS_IMAGE_LOAD ||
aVisitor.mEvent->message == NS_PAGE_LOAD ||
aVisitor.mEvent->message == NS_SCRIPT_LOAD)) {
aVisitor.mParentTarget = GetWindow();
}
return NS_OK;
}

View File

@ -1721,9 +1721,7 @@ nsGlobalWindow::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
}
// Check chrome document capture here.
// XXX The chrome can not handle this, see bug 51211
// FIXME Fix this for other *LOAD events, bug 329514.
if (mChromeEventHandler && msg != NS_IMAGE_LOAD) {
if (mChromeEventHandler) {
aVisitor.mParentTarget = mChromeEventHandler;
aVisitor.mParentIsChromeHandler = PR_TRUE;
}