XForms Bug 299379 - Support DOMFocusIn/DOMFocusOut. r=aaronr,smaug

This commit is contained in:
doronr%us.ibm.com 2005-10-20 19:01:44 +00:00
parent 3286eae123
commit 451d6b4624
3 changed files with 21 additions and 10 deletions

View File

@ -84,7 +84,8 @@
</html:span>
<html:select xbl:inherits="style"
onchange="this.parentNode.parentNode.selectionChanged();"
onblur="this.parentNode.parentNode.handleBlur();"
onfocus="this.parentNode.parentNode.dispatchDOMUIEvent('DOMFocusIn');"
onblur="this.parentNode.parentNode.handleBlur(); this.parentNode.parentNode.dispatchDOMUIEvent('DOMFocusOut');"
multiple="true"
size="5"
anonid="select"/>
@ -514,7 +515,8 @@
</implementation>
</binding>
<!-- SELECT: <FULL> -->
<!-- SELECT: <FULL> -->
<!-- XXX: need to send DOMFocusIn/DOMFocusOut events -->
<binding id="xformswidget-select-full"
extends="chrome://xforms/content/select.xml#xformswidget-select">
<content>

View File

@ -62,7 +62,8 @@
anonid="container"><html:input
class="-moz-xforms-select1-input"
anonid="control"
onblur="this.parentNode.parentNode.handleBlur();"
onfocus="this.parentNode.parentNode.dispatchDOMUIEvent('DOMFocusIn')"
onblur="this.parentNode.parentNode.handleBlur(); this.parentNode.parentNode.dispatchDOMUIEvent('DOMFocusOut');"
onclick="this.parentNode.parentNode.handleControlClick();"
onkeypress="this.parentNode.parentNode.handleKeyPress(event);"
onkeyup="this.parentNode.parentNode.handleKeyUp(event);"

View File

@ -104,14 +104,16 @@
</body>
</method>
<method name="dispatchDOMActivate">
<method name="dispatchDOMUIEvent">
<parameter name="aType"/>
<body>
var ev = document.createEvent("UIEvents");
ev.initUIEvent("DOMActivate", true, true, window, 1);
ev.initUIEvent(aType, true, true, window, 1);
this.dispatchEvent(ev);
return true;
</body>
</method>
</implementation>
</binding>
@ -170,10 +172,11 @@
<content>
<children includes="label"/>
<html:input anonid="control"
onblur="this.parentNode.delegate.value = this.value;"
onblur="this.parentNode.delegate.value = this.value; this.parentNode.dispatchDOMUIEvent('DOMFocusOut')"
onfocus="this.parentNode.dispatchDOMUIEvent('DOMFocusIn')"
onclick="this.parentNode._change();"
onkeyup="this.parentNode._change();"
onkeypress="if (event.keyCode == event.DOM_VK_RETURN) this.parentNode.dispatchDOMActivate();"
onkeypress="if (event.keyCode == event.DOM_VK_RETURN) this.parentNode.dispatchDOMUIEvent('DOMActivate');"
xbl:inherits="accesskey"/>
<children/>
</content>
@ -285,7 +288,8 @@
<content>
<children includes="label"/>
<html:textarea anonid="control"
onblur="this.parentNode.delegate.value = this.value;"
onblur="this.parentNode.delegate.value = this.value; this.parentNode.dispatchDOMUIEvent('DOMFocusOut')"
onfocus="this.parentNode.dispatchDOMUIEvent('DOMFocusIn')"
onkeyup="this.parentNode._change();"
xbl:inherits="accesskey"/>
<children/>
@ -339,7 +343,9 @@
<binding id="xformswidget-trigger"
extends="chrome://xforms/content/xforms.xml#xformswidget-base">
<content>
<html:button anonid="thebutton" xbl:inherits="accesskey">
<html:button anonid="thebutton" xbl:inherits="accesskey"
onblur="this.parentNode.dispatchDOMUIEvent('DOMFocusOut')"
onfocus="this.parentNode.dispatchDOMUIEvent('DOMFocusIn')">
<children/>
</html:button>
</content>
@ -373,7 +379,9 @@
extends="chrome://xforms/content/xforms.xml#xformswidget-base">
<content>
<html:span tabindex="0" anonid="thespan" xbl:inherits="accesskey"
onclick="if (!this._disabled) this.parentNode.dispatchDOMActivate();">
onclick="if (!this._disabled) this.parentNode.dispatchDOMUIEvent('DOMActivate');"
onblur="this.parentNode.dispatchDOMUIEvent('DOMFocusOut')"
onfocus="this.parentNode.dispatchDOMUIEvent('DOMFocusIn')">
<children/>
</html:span>
</content>