mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-22 02:09:28 +00:00
Fix bug 289022: every other click in a text field unfocusses it, so you can't type. Fixed by retargeting keyboard events to a parent view, if their target view has no frame. r=roc, sr=dbaron, a=dbaron.
This commit is contained in:
parent
5a9624f05e
commit
ae9618de13
@ -53,6 +53,7 @@
|
||||
*/
|
||||
|
||||
#define PL_ARENA_CONST_ALIGN_MASK 3
|
||||
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIContent.h"
|
||||
@ -5977,6 +5978,22 @@ PresShell::HandleEvent(nsIView *aView,
|
||||
|
||||
nsIFrame* frame = NS_STATIC_CAST(nsIFrame*, aView->GetClientData());
|
||||
|
||||
// if this event has no frame, we need to retarget it at a parent
|
||||
// view that has a frame.
|
||||
if (!frame &&
|
||||
((NS_IS_KEY_EVENT(aEvent) || NS_IS_IME_EVENT(aEvent)))) {
|
||||
nsIView* targetView = aView;
|
||||
while (targetView && !targetView->GetClientData()) {
|
||||
targetView = targetView->GetParent();
|
||||
}
|
||||
|
||||
if (targetView) {
|
||||
aEvent->point += aView->GetOffsetTo(targetView);
|
||||
aView = targetView;
|
||||
frame = NS_STATIC_CAST(nsIFrame*, aView->GetClientData());
|
||||
}
|
||||
}
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (frame) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user