diff --git a/testing/web-platform/tests/css/selectors/user-invalid.html b/testing/web-platform/tests/css/selectors/user-invalid.html index e726791b30a8c..12a3b83862c01 100644 --- a/testing/web-platform/tests/css/selectors/user-invalid.html +++ b/testing/web-platform/tests/css/selectors/user-invalid.html @@ -48,6 +48,16 @@ assert_false(input.matches(":user-valid"), "No change happened, still does not match :user-valid"); assert_false(input.matches(":user-invalid"), "No change happened, still does not match :user-invalid"); + input.value = "not an email"; + + assert_false(input.matches(":user-valid"), "Programatically set value, :user-valid should not match"); + assert_false(input.matches(":user-invalid"), "Programatically set value, :user-invalid should not match"); + + input.value = ""; + + assert_false(input.matches(":user-valid"), "Programatically cleared value, :user-valid should not match"); + assert_false(input.matches(":user-invalid"), "Programatically cleared value, :user-invalid should not match"); + await test_driver.click(input); await test_driver.send_keys(input, "not an email"); input.blur(); diff --git a/testing/web-platform/tests/css/selectors/user-valid.html b/testing/web-platform/tests/css/selectors/user-valid.html index 9960fc846a050..009286f0eb52a 100644 --- a/testing/web-platform/tests/css/selectors/user-valid.html +++ b/testing/web-platform/tests/css/selectors/user-valid.html @@ -47,6 +47,16 @@ assert_false(input.matches(":user-valid"), "No change happened, still does not match :user-valid"); assert_false(input.matches(":user-invalid"), "No change happened, still does not match :user-invalid"); + input.value = "test@example.com"; + + assert_false(input.matches(":user-valid"), "Programatically set value, :user-valid should not match"); + assert_false(input.matches(":user-invalid"), "Programatically set value, :user-invalid should not match"); + + input.value = ""; + + assert_false(input.matches(":user-valid"), "Programatically cleared value, :user-valid should not match"); + assert_false(input.matches(":user-invalid"), "Programatically cleared value, :user-invalid should not match"); + await test_driver.click(input); await test_driver.send_keys(input, "test@example.com"); input.blur();