function runTests()
{
for (var i = 0; i < 3; i++) {
doTest(i);
}
// Re-test left clicking when the input element has some text.
gClickCount = 0; input.value = "Long text Long text Long text Long text Long text Long text";
doTest(0);
function doTest(aButton)
{
// NOTE #1: Non-primary buttons don't generate 'click' events
// NOTE #2: If touch caret is enabled, touch caret would ovelap input element,
// then, the click event isn't generated.
if (aButton != 2 &&
aButton != 1 &&
(aButton != 0 || !isEnabledAccessibleCaret())) {
gClickCount = 0;
// click on border of input
synthesizeMouse(input, 5, 5, { button: aButton });
is(gClickCount, 1, "click event doesn't fired on input element (button is " +
aButton + ")");
gClickCount = 0;
// down on border
synthesizeMouse(input, 5, 5, { type: "mousedown", button: aButton });
// up on anonymous div of input
synthesizeMouse(input, 20, 20, { type: "mouseup", button: aButton });
is(gClickCount, 1, "click event doesn't fired on input element (button is " +
aButton + ")");
gClickCount = 0;
// down on anonymous div of input
synthesizeMouse(input, 20, 20, { type: "mousedown", button: aButton });
// up on border
synthesizeMouse(input, 5, 5, { type: "mouseup", button: aButton });
is(gClickCount, 1, "click event doesn't fired on input element (button is " +
aButton + ")");
}
gClickCount = 0;
// down on outside of input
synthesizeMouse(input, -3, -3, { type: "mousedown", button: aButton });
// up on border
synthesizeMouse(input, 5, 5, { type: "mouseup", button: aButton });
is(gClickCount, 0, "click event is fired on input element unexpectedly (button is " +
aButton + ")");
}
</script>
</pre>
</body>
</html>
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.1Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.