Bug 684558 - Key events are processed twice. [r=mfinkle]

This commit is contained in:
Matt Brubeck 2011-09-30 21:30:36 -07:00
Родитель b5dacd415b
Коммит e33c5f42f6
3 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -428,7 +428,7 @@ var BrowserUI = {
window.addEventListener("mousedown", this, true);
// listening escape to dismiss dialog on VK_ESCAPE
window.addEventListener("keypress", this, true);
window.addEventListener("keypress", this, false);
// listening AppCommand to handle special keys
window.addEventListener("AppCommand", this, true);

Просмотреть файл

@ -2085,7 +2085,8 @@ KeyFilter.prototype = {
let browser = getBrowser();
if (browser && browser.active && browser.getAttribute("remote") == "true") {
document.getElementById("mainKeyset").setAttribute("disabled", "true");
aEvent.stopPropagation();
document.getElementById("mainKeyset").setAttribute("disabled", "true");
}
},

Просмотреть файл

@ -60,7 +60,9 @@ gTests.push({
ok(BrowserUI._title.collapsed, "The urlbar title element is not visible");
waitForNavigationPanel(gCurrentTest.onPopupHidden, true);
EventUtils.synthesizeKey("VK_ESCAPE", {}, window);
// Need to use sendKey instead of synthesizeKey here (bug 684558).
EventUtils.sendKey("ESCAPE", window);
},
onPopupHidden: function() {
@ -108,7 +110,7 @@ gTests.push({
runNextTest();
}, true);
EventUtils.synthesizeKey("VK_ESCAPE", {}, window);
EventUtils.sendKey("ESCAPE", window);
}
});
@ -137,7 +139,7 @@ gTests.push({
is(BrowserUI._edit.readOnly, false, "urlbar should not be readonly after an input");
waitForNavigationPanel(gCurrentTest.onPopupHidden, true);
EventUtils.synthesizeKey("VK_ESCAPE", {}, window);
EventUtils.sendKey("ESCAPE", window);
},
onPopupHidden: function() {