зеркало из https://github.com/mozilla/pjs.git
Bug 443609, key usage for scales isn't intuitive, r=neil
This commit is contained in:
Родитель
504a50fc8b
Коммит
c0f9a34999
|
@ -102,17 +102,19 @@ function testtag_scale_UI(element, testid, horiz, reverse)
|
||||||
|
|
||||||
element.focus();
|
element.focus();
|
||||||
|
|
||||||
|
var leftIncrements = horiz && reverse;
|
||||||
|
var upDecrements = !horiz && !reverse;
|
||||||
synthesizeKeyExpectEvent("VK_LEFT", { }, element, "change", testid + "key left");
|
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");
|
synthesizeKeyExpectEvent("VK_RIGHT", { }, element, "change", testid + "key right");
|
||||||
is(element.value, 7, testid + " key right");
|
is(element.value, 7, testid + " key right");
|
||||||
synthesizeKeyExpectEvent("VK_UP", { }, element, "change", testid + "key up");
|
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");
|
synthesizeKeyExpectEvent("VK_DOWN", { }, element, "change", testid + "key down");
|
||||||
is(element.value, 7, testid + " key down");
|
is(element.value, 7, testid + " key down");
|
||||||
|
|
||||||
synthesizeKeyExpectEvent("VK_PAGE_UP", { }, element, "change", testid + "key page up");
|
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");
|
synthesizeKeyExpectEvent("VK_PAGE_DOWN", { }, element, "change", testid + "key page down");
|
||||||
is(element.value, 7, testid + " key page down");
|
is(element.value, 7, testid + " key page down");
|
||||||
|
|
||||||
|
|
|
@ -181,35 +181,47 @@
|
||||||
</implementation>
|
</implementation>
|
||||||
|
|
||||||
<handlers>
|
<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">
|
<handler event="keypress" keycode="VK_LEFT" preventdefault="true">
|
||||||
this._userChanged = true;
|
<![CDATA[
|
||||||
(this.dir == "reverse") ? this.increase() : this.decrease();
|
this._userChanged = true;
|
||||||
this._userChanged = false;
|
(this.orient != "vertical" && this.dir == "reverse") ? this.increase() : this.decrease();
|
||||||
</handler>
|
this._userChanged = false;
|
||||||
<handler event="keypress" keycode="VK_DOWN" preventdefault="true">
|
]]>
|
||||||
this._userChanged = true;
|
|
||||||
(this.dir == "reverse") ? this.decrease() : this.increase();
|
|
||||||
this._userChanged = false;
|
|
||||||
</handler>
|
</handler>
|
||||||
<handler event="keypress" keycode="VK_RIGHT" preventdefault="true">
|
<handler event="keypress" keycode="VK_RIGHT" preventdefault="true">
|
||||||
this._userChanged = true;
|
<![CDATA[
|
||||||
(this.dir == "reverse") ? this.decrease() : this.increase();
|
this._userChanged = true;
|
||||||
this._userChanged = false;
|
(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>
|
||||||
<handler event="keypress" keycode="VK_PAGE_UP" preventdefault="true">
|
<handler event="keypress" keycode="VK_PAGE_UP" preventdefault="true">
|
||||||
this._userChanged = true;
|
<![CDATA[
|
||||||
(this.dir == "reverse") ? this.increasePage() : this.decreasePage();
|
this._userChanged = true;
|
||||||
this._userChanged = false;
|
(this.orient == "vertical" && this.dir != "reverse") ? this.decreasePage() : this.increasePage();
|
||||||
|
this._userChanged = false;
|
||||||
|
]]>
|
||||||
</handler>
|
</handler>
|
||||||
<handler event="keypress" keycode="VK_PAGE_DOWN" preventdefault="true">
|
<handler event="keypress" keycode="VK_PAGE_DOWN" preventdefault="true">
|
||||||
this._userChanged = true;
|
<![CDATA[
|
||||||
(this.dir == "reverse") ? this.decreasePage() : this.increasePage();
|
this._userChanged = true;
|
||||||
this._userChanged = false;
|
(this.orient == "vertical" && this.dir != "reverse") ? this.increasePage() : this.decreasePage();
|
||||||
|
this._userChanged = false;
|
||||||
|
]]>
|
||||||
</handler>
|
</handler>
|
||||||
<handler event="keypress" keycode="VK_HOME" preventdefault="true">
|
<handler event="keypress" keycode="VK_HOME" preventdefault="true">
|
||||||
this._userChanged = true;
|
this._userChanged = true;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче