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; @@ -491,6 +491,13 @@ } ]]> + + + this.month++; + + + this.month--; + diff --git a/mozilla/extensions/xforms/resources/skin/widgets-xhtml.css b/mozilla/extensions/xforms/resources/skin/widgets-xhtml.css index 6cc0ee94e69..0bb449509cc 100644 --- a/mozilla/extensions/xforms/resources/skin/widgets-xhtml.css +++ b/mozilla/extensions/xforms/resources/skin/widgets-xhtml.css @@ -76,6 +76,10 @@ span[mozType|calendar] td.currentMonth:hover{ cursor: pointer; } +span[mozType|calendar] td:focus { + outline: 1px dotted black; +} + span[mozType|calendar] td[selected] { border: 1px solid black; } diff --git a/mozilla/extensions/xforms/resources/skin/widgets-xul.css b/mozilla/extensions/xforms/resources/skin/widgets-xul.css index f8893e4f5a9..c01b2395bce 100644 --- a/mozilla/extensions/xforms/resources/skin/widgets-xul.css +++ b/mozilla/extensions/xforms/resources/skin/widgets-xul.css @@ -47,12 +47,12 @@ box[mozType|calendar] { border: 1px outset black !important; } +box[mozType|calendar] toolbarbutton { + margin: 1px; +} + box[mozType|calendar] toolbarbutton:focus { - border: 1px dotted ThreeDDarkShadow !important; - -moz-border-top-colors: none !important; - -moz-border-right-colors: none !important; - -moz-border-bottom-colors: none !important; - -moz-border-left-colors: none !important; + outline: 1px dotted black; } .prevMonth, .nextMonth {