function runTests()
{ varform = document.getElementById("form"); form.addEventListener("keypress", function (aEvent) {
ok(false, "keypress event shouldn't be fired when the preceding keydown event caused closing the dropdown of the select element");
}, true); form.addEventListener("submit", function (aEvent) {
ok(false, "submit shouldn't be performed by the Enter key press on the select element");
aEvent.preventDefault();
}, true); varselect = document.getElementById("select"); select.addEventListener("change", function (aEvent) { varinput = document.getElementById("input-text"); input.focus(); input.select();
});
select.focus();
select.addEventListener("popupshowing", function (aEvent) {
setTimeout(function () {
synthesizeKey("KEY_ArrowDown"); select.addEventListener("popuphiding", function (aEventInner) {
setTimeout(function () {
// Enter key should cause closing the dropdown of the select element
// and keypress event shouldn't be fired on the input element because
// which shouldn't cause sumbmitting the form contents.
ok(true, "Test passes if there is no error");
SimpleTest.finish();
}, 100);
});
// Close dropdown.
synthesizeKey("KEY_Enter");
}, 100);
});
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 ist noch experimentell.