Bug 780582. Ensure that mouse-up/touch-end events are processed by some frame, so that capture is released. r=smaug

This commit is contained in:
Robert O'Callahan 2012-08-07 23:07:54 +12:00
parent 3d2256832d
commit df4054d0e5

View File

@ -476,6 +476,13 @@ public:
mPresShell->FlushPendingNotifications(Flush_Layout);
}
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
if (!frame &&
(aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP ||
aVisitor.mEvent->message == NS_TOUCH_END)) {
// Redirect BUTTON_UP and TOUCH_END events to the root frame to ensure
// that capturing is released.
frame = mPresShell->GetRootFrame();
}
if (frame) {
frame->HandleEvent(aVisitor.mPresContext,
(nsGUIEvent*) aVisitor.mEvent,