<!DOCTYPE html>
<html>
<body>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<p>Test that the parameter to setCustomValidity() is not nullable</p>
<script>
function testFormControl(control, name)
{
    test(() => {
        assert_true(control.checkValidity(), "Initial checkValidity()");
        assert_true(control.validity.valid, "Initial ValidityState.valid");
        assert_false(control.validity.customError, "Initial ValidityState.customError");
        assert_equals(control.validationMessage, "", "Initial validationMessage");

        control.setCustomValidity("error");
        assert_false(control.checkValidity(), "checkValidity() after setting custom validity message to 'error'");
        assert_false(control.validity.valid, "ValidityState.valid after setting custom validity message to 'error'");
        assert_true(control.validity.customError, "ValidityState.customError after setting custom validity message to 'error'");
        assert_equals(control.validationMessage, "error", "validationMessage after setting custom validity message to 'error'");

        control.setCustomValidity(null);
        assert_false(control.checkValidity(), "checkValidity() after setting custom validity message to null");
        assert_false(control.validity.valid, "ValidityState.valid after setting custom validity message to null");
        assert_true(control.validity.customError, "ValidityState.customError after setting custom validity message to null");
        assert_equals(control.validationMessage, "null", "validationMessage after setting custom validity message to null");

        control.setCustomValidity(undefined);
        assert_false(control.checkValidity(), "checkValidity() after setting custom validity message to undefined");
        assert_false(control.validity.valid, "ValidityState.valid after setting custom validity message to undefined");
        assert_true(control.validity.customError, "ValidityState.customError after setting custom validity message to undefined");
        assert_equals(control.validationMessage, "undefined", "validationMessage after setting custom validity message to undefined");

        control.setCustomValidity("");
        assert_true(control.checkValidity(), "checkValidity() after setting custom validity message to empty string");
        assert_true(control.validity.valid, "ValidityState.valid after setting custom validity message to empty string");
        assert_false(control.validity.customError, "ValidityState.customError after setting custom validity message to empty string");
        assert_equals(control.validationMessage, "", "validationMessage after setting custom validity message to empty string");
    }, name);
}

function testFormControlBarredFromValidation(control, name)
{
    test(() => {
        assert_true(control.checkValidity(), "Initial checkValidity()");
        assert_true(control.validity.valid, "Initial ValidityState.valid");
        assert_false(control.validity.customError, "Initial ValidityState.customError");
        assert_equals(control.validationMessage, "", "Initial validationMessage");

        control.setCustomValidity("error");
        assert_true(control.checkValidity(), "checkValidity() after setting custom validity message to 'error'");
        // WebKit and Chrome 96 treat <object> differently here. Firefox 95 doesn't.
        if (control.tagName == "OBJECT") {
            assert_true(control.validity.valid, "ValidityState.valid after setting custom validity message to 'error'");
            assert_false(control.validity.customError, "ValidityState.customError after setting custom validity message to 'error'");
         } else {
            assert_false(control.validity.valid, "ValidityState.valid after setting custom validity message to 'error'");
            assert_true(control.validity.customError, "ValidityState.customError after setting custom validity message to 'error'");
        }
        assert_equals(control.validationMessage, "", "validationMessage after setting custom validity message to 'error'");

        control.setCustomValidity("");
        assert_true(control.checkValidity(), "checkValidity() after setting custom validity message to empty string");
        assert_true(control.validity.valid, "ValidityState.valid after setting custom validity message to empty string");
        assert_false(control.validity.customError, "ValidityState.customError after setting custom validity message to empty string");
        assert_equals(control.validationMessage, "", "validationMessage after setting custom validity message to empty string");
    }, name);
}

testFormControl(document.createElement("button"), "button Element");
testFormControl(document.createElement("input"), "input Element");
testFormControl(document.createElement("select"), "select Element");
testFormControl(document.createElement("textarea"), "textarea Element");

// The following controls are not validated in WebKit (only object seems to be barred from validation in the specification).
testFormControlBarredFromValidation(document.createElement("fieldset"), "fieldset Element");
testFormControlBarredFromValidation(document.createElement("object"), "object Element");
testFormControlBarredFromValidation(document.createElement("output"), "output Element");

</script>
</body>
</html>
