diff --git a/view/src/nsView.cpp b/view/src/nsView.cpp index 494c6fb1071..371dbef9a07 100644 --- a/view/src/nsView.cpp +++ b/view/src/nsView.cpp @@ -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++; } }