function invalidEventHandler(e)
{
is(e.type, "invalid", "Invalid event type should be invalid");
gInvalid = true;
}
function checkValidURL(element)
{
info(`Checking ${element.value}\n`);
gInvalid = false;
ok(!element.validity.typeMismatch, "Element should not suffer from type mismatch");
ok(element.validity.valid, "Element should be valid");
ok(element.checkValidity(), "Element should be valid");
ok(!gInvalid, "The invalid event should not have been thrown");
is(element.validationMessage, '', "Validation message should be the empty string");
ok(element.matches(":valid"), ":valid pseudo-class should apply");
}
function checkInvalidURL(element)
{
gInvalid = false;
ok(element.validity.typeMismatch, "Element should suffer from type mismatch");
ok(!element.validity.valid, "Element should not be valid");
ok(!element.checkValidity(), "Element should not be valid");
ok(gInvalid, "The invalid event should have been thrown");
is(element.validationMessage, "Please enter a URL.", "Validation message should be related to invalid URL");
ok(element.matches(":invalid"), ":invalid pseudo-class should apply");
}
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.