Backing out d4c725db7369 (bug 683736).

This commit is contained in:
Doug Turner 2011-09-04 13:08:49 -07:00
parent 6a60e22cca
commit e6e2e4304b
3 changed files with 7 additions and 37 deletions

View File

@ -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
*/

View File

@ -816,7 +816,6 @@ var FormHelperUI = {
if (focusedElement && focusedElement.localName == "browser")
return;
Browser.keyFilter.handleEvent(aEvent);
break;
case "SizeChanged":

View File

@ -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);
});