mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backing out d4c725db7369 (bug 683736).
This commit is contained in:
parent
6a60e22cca
commit
e6e2e4304b
@ -182,7 +182,6 @@ var Browser = {
|
||||
/* handles web progress management for open browsers */
|
||||
Elements.browsers.webProgress = new Browser.WebProgress();
|
||||
|
||||
this.keyFilter = new KeyFilter(Elements.browsers);
|
||||
let mouseModule = new MouseModule();
|
||||
let gestureModule = new GestureModule(Elements.browsers);
|
||||
let scrollWheelModule = new ScrollwheelModule(Elements.browsers);
|
||||
@ -1226,19 +1225,14 @@ var Browser = {
|
||||
break;
|
||||
}
|
||||
|
||||
case "Browser:KeyPress": {
|
||||
let keyset = document.getElementById("mainKeyset");
|
||||
keyset.setAttribute("disabled", "false");
|
||||
if (json.preventDefault)
|
||||
break;
|
||||
|
||||
case "Browser:KeyPress":
|
||||
let event = document.createEvent("KeyEvents");
|
||||
event.initKeyEvent("keypress", true, true, null,
|
||||
json.ctrlKey, json.altKey, json.shiftKey, json.metaKey,
|
||||
json.keyCode, json.charCode);
|
||||
keyset.dispatchEvent(event);
|
||||
document.getElementById("mainKeyset").dispatchEvent(event);
|
||||
break;
|
||||
}
|
||||
|
||||
case "Browser:ZoomToPoint:Return":
|
||||
if (json.zoomTo) {
|
||||
let rect = Rect.fromRect(json.zoomTo);
|
||||
@ -1978,31 +1972,6 @@ const ContentTouchHandler = {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/** Prevent chrome from consuming key events before remote content has a chance. */
|
||||
function KeyFilter(container) {
|
||||
container.addEventListener("keypress", this, false);
|
||||
container.addEventListener("keyup", this, false);
|
||||
container.addEventListener("keydown", this, false);
|
||||
}
|
||||
|
||||
KeyFilter.prototype = {
|
||||
handleEvent: function handleEvent(aEvent) {
|
||||
if (Elements.contentShowing.getAttribute("disabled") == "true")
|
||||
return;
|
||||
|
||||
let browser = getBrowser();
|
||||
if (browser && browser.active && browser.getAttribute("remote") == "true") {
|
||||
document.getElementById("mainKeyset").setAttribute("disabled", "true");
|
||||
}
|
||||
},
|
||||
|
||||
toString: function toString() {
|
||||
return "[KeyFilter] { }";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Utility class to handle manipulations of the identity indicators in the UI
|
||||
*/
|
||||
|
@ -816,7 +816,6 @@ var FormHelperUI = {
|
||||
if (focusedElement && focusedElement.localName == "browser")
|
||||
return;
|
||||
|
||||
Browser.keyFilter.handleEvent(aEvent);
|
||||
break;
|
||||
|
||||
case "SizeChanged":
|
||||
|
@ -299,14 +299,16 @@ let Content = {
|
||||
// let's send it back to the chrome process to have it handle shortcuts
|
||||
case "keypress":
|
||||
let timer = new Util.Timeout(function() {
|
||||
if(aEvent.getPreventDefault())
|
||||
return;
|
||||
|
||||
let eventData = {
|
||||
ctrlKey: aEvent.ctrlKey,
|
||||
altKey: aEvent.altKey,
|
||||
shiftKey: aEvent.shiftKey,
|
||||
metaKey: aEvent.metaKey,
|
||||
keyCode: aEvent.keyCode,
|
||||
charCode: aEvent.charCode,
|
||||
preventDefault: aEvent.getPreventDefault()
|
||||
charCode: aEvent.charCode
|
||||
};
|
||||
sendAsyncMessage("Browser:KeyPress", eventData);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user