// Focusing while :user-invalid applies,
// the pseudo-class should apply while typing if appropriate.
aElement.focus();
checkPseudoClass(aElement, false);
// with keys
sendString("f");
checkPseudoClass(aElement, true);
synthesizeKey("KEY_Backspace");
checkPseudoClass(aElement, false);
// with .value
aElement.value = 'f';
checkPseudoClass(aElement, true);
aElement.value = '';
checkPseudoClass(aElement, false);
}
function checkSelectElement(aElement)
{
checkPseudoClass(aElement, false);
if (!aElement.multiple && navigator.platform.startsWith("Mac")) {
// Arrow key on macOS opens the popup.
return;
}
// Focusing while :user-valid doesn't apply,
// the pseudo-class should not apply while changing selection.
aElement.focus();
checkPseudoClass(aElement, false);
// Focusing while :user-valid applies,
// the pseudo-class should apply while changing selection if appropriate.
aElement.focus();
checkPseudoClass(aElement, true);
aElement.blur();
aElement.required = true;
// select set with multiple is only invalid if no option is selected
if (aElement.multiple) {
aElement.selectedIndex = -1;
}
checkPseudoClass(aElement, false);
// Focusing while :user-invalid applies,
// the pseudo-class should apply while changing selection if appropriate.
aElement.focus();
checkPseudoClass(aElement, false);
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.