diff --git a/mozilla/extensions/xforms/resources/content/input-xhtml.xml b/mozilla/extensions/xforms/resources/content/input-xhtml.xml
index 0e196c166b5..ad2e41d4dd9 100644
--- a/mozilla/extensions/xforms/resources/content/input-xhtml.xml
+++ b/mozilla/extensions/xforms/resources/content/input-xhtml.xml
@@ -216,6 +216,7 @@
title="&xforms.datepicker.title;"/>
diff --git a/mozilla/extensions/xforms/resources/content/input-xul.xml b/mozilla/extensions/xforms/resources/content/input-xul.xml
index cb169f387ab..75344af49a6 100644
--- a/mozilla/extensions/xforms/resources/content/input-xul.xml
+++ b/mozilla/extensions/xforms/resources/content/input-xul.xml
@@ -255,6 +255,9 @@
this.popup.hidePopup();
this._isPickerVisible = false;
+
+ this.ownerDocument.defaultView.setTimeout(
+ function(control) { control.focus(); }, 0, this.control);
@@ -310,10 +313,17 @@
this.picker.value = this.control.value;
+
+ this.ownerDocument.defaultView.setTimeout(
+ function(picker) { picker.focus();} , 0, this.picker);
+
+
+
+ var selection = this.ownerDocument.defaultView.getSelection();
+ if (!selection)
+ return null;
+
+ var focused = selection.focusNode;
+ if (!focused)
+ return null;
+
+ // focusNode returns html:td if focused element is inside table cell
+ // (see bug 365900).
+ if (focused.localName != "input") {
+ input = focused.getElementsByTagNameNS(this.XHTML_NS, "input")[0];
+ if (input)
+ return input;
+ }
+
+ return focused;
+
+
+
if (!this._dateLabel) {
@@ -249,7 +271,7 @@
-
+
+
+
+ if (!this.hasAttribute("internaltabhandling"))
+ return;
+
+ event.preventDefault();
+
+ var focused = getFocusedElement();
+ if (!focused)
+ return;
+
+ if (focused == this.backButton) {
+ this.fwdButton.focus();
+ } else if (focused == this.fwdButton) {
+ this.focus();
+ } else {
+ this.backButton.focus();
+ }
+
+
+
+ if (!this.hasAttribute("internaltabhandling"))
+ return;
+
+ event.preventDefault();
+
+ var focused = getFocusedElement();
+ if (!focused)
+ return;
+
+ if (focused == this.backButton) {
+ this.focus();
+ } else if (focused == this.fwdButton) {
+ this.backButton.focus();
+ } else {
+ this.fwdButton.focus();
+ }
+
@@ -742,6 +802,8 @@
+
+
diff --git a/mozilla/extensions/xforms/resources/content/widgets-xul.xml b/mozilla/extensions/xforms/resources/content/widgets-xul.xml
index 29629baf9e4..1a67a6cf839 100644
--- a/mozilla/extensions/xforms/resources/content/widgets-xul.xml
+++ b/mozilla/extensions/xforms/resources/content/widgets-xul.xml
@@ -195,7 +195,8 @@
// Stop event propagation to prevent event processing of
- // xul:toolbarbutton.
+ // button binding, i.e. to prevent default behaviour of button
+ // that is to advance/rewind focus on arrow keys.
switch (event.keyCode) {
case event.DOM_VK_UP:
case event.DOM_VK_DOWN:
@@ -217,7 +218,7 @@
-
+
diff --git a/mozilla/extensions/xforms/resources/content/widgets.xml b/mozilla/extensions/xforms/resources/content/widgets.xml
index c569e3a2e4f..1b757f9655f 100644
--- a/mozilla/extensions/xforms/resources/content/widgets.xml
+++ b/mozilla/extensions/xforms/resources/content/widgets.xml
@@ -385,7 +385,7 @@
}
dayElm = this._dayElements[aIndex];
- dayElm.setAttribute("tabindex", "0");
+ dayElm.setAttribute("tabindex", "1");
this._currentDayIndex = aIndex;