Check aHandled after event dispatch before accessing the view's children. b=113121 r=roc+moz sr=attinasi
This commit is contained in:
Родитель
2bd3152158
Коммит
6d394e0069
|
@ -345,18 +345,20 @@ NS_IMETHODIMP nsView::HandleEvent(nsGUIEvent *event, PRUint32 aEventFlags,
|
|||
event->point.y += trect.y;
|
||||
}
|
||||
|
||||
if (mChildRemoved) {
|
||||
// a child has been removed as the result of the HandleEvent
|
||||
// so pick up at the same relative position in the child list.
|
||||
// We may end up skipping over a child depending on which child
|
||||
// or the number of children removed from the list, but this should
|
||||
// not be an issue since it is unusual to have the views destroyed
|
||||
// while traversing this list and the only negative effect will be
|
||||
// that the event is dispatched to a view underneath the intended view.
|
||||
pKid = GetChild(cnt);
|
||||
} else {
|
||||
pKid = pKid->GetNextSibling();
|
||||
}
|
||||
if (!aHandled) {
|
||||
if (mChildRemoved) {
|
||||
// a child has been removed as the result of the HandleEvent
|
||||
// so pick up at the same relative position in the child list.
|
||||
// We may end up skipping over a child depending on which child
|
||||
// or the number of children removed from the list, but this should
|
||||
// not be an issue since it is unusual to have the views destroyed
|
||||
// while traversing this list and the only negative effect will be
|
||||
// that the event is dispatched to a view underneath the intended view.
|
||||
pKid = GetChild(cnt);
|
||||
} else {
|
||||
pKid = pKid->GetNextSibling();
|
||||
}
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче