Bug 464914 (regression from bug 270128) Watch for menubar activation r=Standard8

This commit is contained in:
Neil Rashbrook 2008-12-29 23:12:26 +00:00
parent 0f17e9ca54
commit f53148948f

View File

@ -39,7 +39,7 @@
<children includes="menupopup"/>
</content>
<implementation implements="nsIDOMXULMenuListElement, nsIAccessibleProvider">
<implementation implements="nsIDOMXULMenuListElement, nsIAccessibleProvider, nsIDOMEventListener">
<constructor><![CDATA[
// XXX bug 90337 band-aid until we figure out what's going on here
@ -47,6 +47,9 @@
this.mInputElt.value = this.value;
delete this.value;
// listen for menubar activation
window.top.addEventListener("DOMMenuBarActive", this, true);
// set default property values
this.ifSetAttribute("timeout", 50);
this.ifSetAttribute("maxrows", 5);
@ -67,6 +70,7 @@
<destructor><![CDATA[
this.clearResults(false);
window.top.removeEventListener("DOMMenuBarActive", this, true);
]]></destructor>
<!-- =================== PUBLIC PROPERTIES =================== -->
@ -236,6 +240,16 @@
document.getAnonymousElementByAttribute(this, "anonid", "popup");
]]></field>
<!-- nsIDOMEventListener -->
<method name="handleEvent">
<parameter name="aEvent"/>
<body><![CDATA[
this.finishAutoComplete(false, false, aEvent);
this.clearTimer();
this.closeResultPopup();
]]></body>
</method>
<!-- nsIAccessibleProvider -->
<property name="accessibleType" readonly="true">
<getter>
@ -927,18 +941,6 @@
]]></body>
</method>
<!-- -->
<method name="processKeyDown">
<parameter name="aEvent"/>
<body><![CDATA[
if (aEvent.keyCode && aEvent.keyCode == this.mMenuAccessKey) {
this.finishAutoComplete(false, false, aEvent);
this.clearTimer();
this.closeResultPopup();
}
]]></body>
</method>
<!-- -->
<method name="processKeyPress">
<parameter name="aEvent"/>
@ -1436,9 +1438,6 @@
<handler event="input"
action="if (!this.ignoreInputEvent) this.processInput();"/>
<handler event="keydown" phase="capturing"
action="return this.processKeyDown(event);"/>
<handler event="keypress" phase="capturing"
action="return this.processKeyPress(event);"/>