Bug 443609, key usage for scales isn't intuitive, r=neil

This commit is contained in:
Neil Deakin 2009-01-15 13:44:38 -05:00
Родитель 504a50fc8b
Коммит c0f9a34999
2 изменённых файлов: 39 добавлений и 25 удалений

Просмотреть файл

@ -102,17 +102,19 @@ function testtag_scale_UI(element, testid, horiz, reverse)
element.focus();
var leftIncrements = horiz && reverse;
var upDecrements = !horiz && !reverse;
synthesizeKeyExpectEvent("VK_LEFT", { }, element, "change", testid + "key left");
is(element.value, reverse ? 9 : 5, testid + " key left");
is(element.value, leftIncrements ? 9 : 5, testid + " key left");
synthesizeKeyExpectEvent("VK_RIGHT", { }, element, "change", testid + "key right");
is(element.value, 7, testid + " key right");
synthesizeKeyExpectEvent("VK_UP", { }, element, "change", testid + "key up");
is(element.value, reverse ? 9 : 5, testid + " key up");
is(element.value, upDecrements ? 5 : 9, testid + " key up");
synthesizeKeyExpectEvent("VK_DOWN", { }, element, "change", testid + "key down");
is(element.value, 7, testid + " key down");
synthesizeKeyExpectEvent("VK_PAGE_UP", { }, element, "change", testid + "key page up");
is(element.value, reverse ? 11 : 3, testid + " key page up");
is(element.value, upDecrements ? 3 : 11, testid + " key page up");
synthesizeKeyExpectEvent("VK_PAGE_DOWN", { }, element, "change", testid + "key page down");
is(element.value, 7, testid + " key page down");

Просмотреть файл

@ -181,35 +181,47 @@
</implementation>
<handlers>
<handler event="keypress" keycode="VK_UP" preventdefault="true">
this._userChanged = true;
(this.dir == "reverse") ? this.increase() : this.decrease();
this._userChanged = false;
</handler>
<handler event="keypress" keycode="VK_LEFT" preventdefault="true">
this._userChanged = true;
(this.dir == "reverse") ? this.increase() : this.decrease();
this._userChanged = false;
</handler>
<handler event="keypress" keycode="VK_DOWN" preventdefault="true">
this._userChanged = true;
(this.dir == "reverse") ? this.decrease() : this.increase();
this._userChanged = false;
<![CDATA[
this._userChanged = true;
(this.orient != "vertical" && this.dir == "reverse") ? this.increase() : this.decrease();
this._userChanged = false;
]]>
</handler>
<handler event="keypress" keycode="VK_RIGHT" preventdefault="true">
this._userChanged = true;
(this.dir == "reverse") ? this.decrease() : this.increase();
this._userChanged = false;
<![CDATA[
this._userChanged = true;
(this.orient != "vertical" && this.dir == "reverse") ? this.decrease() : this.increase();
this._userChanged = false;
]]>
</handler>
<handler event="keypress" keycode="VK_UP" preventdefault="true">
<![CDATA[
this._userChanged = true;
(this.orient == "vertical" && this.dir != "reverse") ? this.decrease() : this.increase();
this._userChanged = false;
]]>
</handler>
<handler event="keypress" keycode="VK_DOWN" preventdefault="true">
<![CDATA[
this._userChanged = true;
(this.orient == "vertical" && this.dir != "reverse") ? this.increase() : this.decrease();
this._userChanged = false;
]]>
</handler>
<handler event="keypress" keycode="VK_PAGE_UP" preventdefault="true">
this._userChanged = true;
(this.dir == "reverse") ? this.increasePage() : this.decreasePage();
this._userChanged = false;
<![CDATA[
this._userChanged = true;
(this.orient == "vertical" && this.dir != "reverse") ? this.decreasePage() : this.increasePage();
this._userChanged = false;
]]>
</handler>
<handler event="keypress" keycode="VK_PAGE_DOWN" preventdefault="true">
this._userChanged = true;
(this.dir == "reverse") ? this.decreasePage() : this.increasePage();
this._userChanged = false;
<![CDATA[
this._userChanged = true;
(this.orient == "vertical" && this.dir != "reverse") ? this.increasePage() : this.decreasePage();
this._userChanged = false;
]]>
</handler>
<handler event="keypress" keycode="VK_HOME" preventdefault="true">
this._userChanged = true;