mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1092549 - Only allow FocusChange message to change formMM. r=yxl
This commit is contained in:
parent
31904bcdd4
commit
263b3e2ca6
@ -251,22 +251,22 @@ this.Keyboard = {
|
||||
forwardEvent: function keyboardForwardEvent(newEventName, msg) {
|
||||
let mm = msg.target.QueryInterface(Ci.nsIFrameLoaderOwner)
|
||||
.frameLoader.messageManager;
|
||||
if (newEventName === 'Keyboard:FocusChange' &&
|
||||
msg.data.type === 'blur') {
|
||||
// A blur message can't be sent to the keyboard if the focus has
|
||||
// already taken away at first place.
|
||||
// This check is here to prevent problem caused by out-of-order
|
||||
// ipc messages from two processes.
|
||||
if (mm !== this.formMM) {
|
||||
return false;
|
||||
if (newEventName === 'Keyboard:FocusChange') {
|
||||
if (msg.data.type !== 'blur') { // Focus on a new input field
|
||||
// Set the formMM to the new message manager so that
|
||||
// message gets to the right form now on.
|
||||
this.formMM = mm;
|
||||
} else { // input is blurred
|
||||
// A blur message can't be sent to the keyboard if the focus has
|
||||
// already been taken away at first place.
|
||||
// This check is here to prevent problem caused by out-of-order
|
||||
// ipc messages from two processes.
|
||||
if (mm !== this.formMM) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
this.sendToKeyboard(newEventName, msg.data);
|
||||
return true;
|
||||
}
|
||||
|
||||
this.formMM = mm;
|
||||
|
||||
this.sendToKeyboard(newEventName, msg.data);
|
||||
return true;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user