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
Родитель dd95e269cd
Коммит 1b31151599
2 изменённых файлов: 8 добавлений и 4 удалений

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

@ -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;
}

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

@ -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;
}