Bug 539116 - JavaScript error: chrome://browser/content/browser-ui.js, line 1119: aElement is null [r=mfinkle r=stechz]

This commit is contained in:
Vivien Nicolas 2010-01-13 14:56:32 -05:00
Родитель 0e0abb1488
Коммит b815e899bb
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -1283,10 +1283,11 @@ var FormHelper = {
}, },
handleEvent: function formHelperHandleEvent(aEvent) { handleEvent: function formHelperHandleEvent(aEvent) {
let currentElement = this.getCurrentElement(); let isChromeFocused = gFocusManager.getFocusedElementForWindow(window, false, {}) == gFocusManager.focusedElement;
if (aEvent.type != "keypress") if (isChromeFocused || aEvent.type != "keypress")
return; return;
let currentElement = this.getCurrentElement();
let keyCode = aEvent.keyCode || aEvent.charCode; let keyCode = aEvent.keyCode || aEvent.charCode;
switch (keyCode) { switch (keyCode) {
case aEvent.DOM_VK_DOWN: case aEvent.DOM_VK_DOWN:
@ -1328,6 +1329,9 @@ var FormHelper = {
}, },
canShowUIFor: function(aElement) { canShowUIFor: function(aElement) {
if (!aElement)
return false;
// Some forms elements are valid in the sense that we want the Form // Some forms elements are valid in the sense that we want the Form
// Assistant to stop on it, but we don't want it to display when // Assistant to stop on it, but we don't want it to display when
// the user clicks on it // the user clicks on it