/** Test for Bug 1264157 **/
SimpleTest.waitForFocus(function() {
// Check the initial values.
let active = [].slice.call(document.querySelectorAll("input:not(:disabled):not(:read-only)"));
let disabled = [].slice.call(document.querySelectorAll("input:disabled"));
let readonly = [].slice.call(document.querySelectorAll("input:read-only:not(:disabled)"));
is(active.length, 2, "Test is messed up: missing non-disabled/non-readonly inputs");
is(disabled.length, 2, "Test is messed up: missing disabled inputs");
is(readonly.length, 2, "Test is messed up: missing readonly inputs");
is(document.querySelectorAll("input:in-range").length, 1, "Wrong number of in-range elements selected.");
is(document.querySelectorAll("input:out-of-range").length, 1, "Wrong number of out-of-range elements selected.");
// Dynamically change the values to see if that works too.
active[0].value = -1;
is(document.querySelectorAll("input:in-range").length, 0, "Wrong number of in-range elements selected after value changed.");
is(document.querySelectorAll("input:out-of-range").length, 2, "Wrong number of out-of-range elements selected after value changed.");
active[0].value = 0;
is(document.querySelectorAll("input:in-range").length, 1, "Wrong number of in-range elements selected after value changed back.");
is(document.querySelectorAll("input:out-of-range").length, 1, "Wrong number of out-of-range elements selected after value changed back.");
// Dynamically change the attributes to see if that works too.
disabled.forEach(function(e) { e.removeAttribute("disabled"); });
readonly.forEach(function(e) { e.removeAttribute("readonly"); });
active.forEach(function(e) { e.setAttribute("readonly", true); });
is(document.querySelectorAll("input:in-range").length, 2, "Wrong number of in-range elements selected after attribute changed.");
is(document.querySelectorAll("input:out-of-range").length, 2, "Wrong number of out-of-range elements selected after attribute changed.");
SimpleTest.finish();
});
SimpleTest.waitForExplicitFinish();
</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.13Bemerkung:
(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.