зеркало из https://github.com/mozilla/gecko-dev.git
Make keyboard navigation through radio groups and buttons bidi-aware. Bug 343690, r=mano, sr=neil
This commit is contained in:
Родитель
1591dabe65
Коммит
fa4bbbc3f5
|
@ -144,11 +144,21 @@
|
|||
<handler event="keypress">
|
||||
<![CDATA[
|
||||
if (event.keyCode == KeyEvent.DOM_VK_UP ||
|
||||
event.keyCode == KeyEvent.DOM_VK_LEFT)
|
||||
(event.keyCode == KeyEvent.DOM_VK_LEFT &&
|
||||
document.defaultView.getComputedStyle(this.parentNode, "")
|
||||
.direction == "ltr") ||
|
||||
(event.keyCode == KeyEvent.DOM_VK_RIGHT &&
|
||||
document.defaultView.getComputedStyle(this.parentNode, "")
|
||||
.direction == "rtl"))
|
||||
return window.document.commandDispatcher.rewindFocus();
|
||||
|
||||
if (event.keyCode == KeyEvent.DOM_VK_DOWN ||
|
||||
event.keyCode == KeyEvent.DOM_VK_RIGHT)
|
||||
(event.keyCode == KeyEvent.DOM_VK_RIGHT &&
|
||||
document.defaultView.getComputedStyle(this.parentNode, "")
|
||||
.direction == "ltr") ||
|
||||
(event.keyCode == KeyEvent.DOM_VK_LEFT &&
|
||||
document.defaultView.getComputedStyle(this.parentNode, "")
|
||||
.direction == "rtl"))
|
||||
return window.document.commandDispatcher.advanceFocus();
|
||||
|
||||
if (event.keyCode || event.charCode <= 32 || event.altKey ||
|
||||
|
|
|
@ -310,7 +310,9 @@
|
|||
event.stopPropagation();
|
||||
</handler>
|
||||
<handler event="keypress" keycode="VK_LEFT" phase="target">
|
||||
this.checkAdjacentElement(false);
|
||||
// left arrow goes back when we are ltr, forward when we are rtl
|
||||
this.checkAdjacentElement(document.defaultView.getComputedStyle(
|
||||
this, "").direction == "rtl");
|
||||
event.stopPropagation();
|
||||
</handler>
|
||||
<handler event="keypress" keycode="VK_DOWN" phase="target">
|
||||
|
@ -318,7 +320,9 @@
|
|||
event.stopPropagation();
|
||||
</handler>
|
||||
<handler event="keypress" keycode="VK_RIGHT" phase="target">
|
||||
this.checkAdjacentElement(true);
|
||||
// right arrow goes forward when we are ltr, back when we are rtl
|
||||
this.checkAdjacentElement(document.defaultView.getComputedStyle(
|
||||
this, "").direction == "ltr");
|
||||
event.stopPropagation();
|
||||
</handler>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче