diff --git a/mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp
index a3005f73f26..7eeb02d91e6 100644
--- a/mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp
+++ b/mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp
@@ -3060,6 +3060,12 @@ nsEnderEventListener::KeyPress(nsIDOMEvent* aKeyEvent)
result = manager->PostHandleEvent(mContext, &event, gfxFrame, &status, mView);
}
NS_RELEASE(manager);
+
+ if(event.flags & NS_EVENT_FLAG_STOP_DISPATCH)
+ {
+ aKeyEvent->PreventCapture();
+ aKeyEvent->PreventBubble();
+ }
}
}
return result;