mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 918863 - MutationObserver doesnt recognize all deleted elements, keypress is fired if keydown is canceled. r=yxl, r=kanru
This commit is contained in:
parent
ed8efdf3a8
commit
c43a7623dc
@ -283,7 +283,7 @@ let FormAssistant = {
|
||||
this._observer = new MutationObserver(function(mutations) {
|
||||
var del = [].some.call(mutations, function(m) {
|
||||
return [].some.call(m.removedNodes, function(n) {
|
||||
return n === element;
|
||||
return n.contains(element);
|
||||
});
|
||||
});
|
||||
if (del && element === self.focusedElement) {
|
||||
@ -292,8 +292,9 @@ let FormAssistant = {
|
||||
}
|
||||
});
|
||||
|
||||
this._observer.observe(element.parentNode, {
|
||||
childList: true
|
||||
this._observer.observe(element.ownerDocument.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
|
||||
@ -517,10 +518,16 @@ let FormAssistant = {
|
||||
case "Forms:Input:SendKey":
|
||||
CompositionManager.endComposition('');
|
||||
|
||||
["keydown", "keypress", "keyup"].forEach(function(type) {
|
||||
domWindowUtils.sendKeyEvent(type, json.keyCode, json.charCode,
|
||||
json.modifiers);
|
||||
});
|
||||
this._editing = true;
|
||||
let doKeypress = domWindowUtils.sendKeyEvent('keydown', json.keyCode,
|
||||
json.charCode, json.modifiers);
|
||||
if (doKeypress) {
|
||||
domWindowUtils.sendKeyEvent('keypress', json.keyCode,
|
||||
json.charCode, json.modifiers);
|
||||
}
|
||||
domWindowUtils.sendKeyEvent('keyup', json.keyCode,
|
||||
json.charCode, json.modifiers);
|
||||
this._editing = false;
|
||||
|
||||
if (json.requestId) {
|
||||
sendAsyncMessage("Forms:SendKey:Result:OK", {
|
||||
|
Loading…
Reference in New Issue
Block a user