Bug 1636495: Add web platform test r=emilio

While trying to fix the error-handling, I tested one solution that *should* have caused a failure in a web platform test, but didn't, because the test didn't exist yet. This patch adds that test.

Depends on D74501

Differential Revision: https://phabricator.services.mozilla.com/D74502
This commit is contained in:
Iain Ireland 2020-05-12 17:23:01 +00:00
Родитель 42da623014
Коммит 56d8ec2d41
1 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Pattern dynamic value attribute change</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1636495">
<input pattern="a" value="a">
<script>
test(function() {
let i = document.querySelector("input");
assert_false(i.matches(":invalid"));
i.pattern = "b";
assert_true(i.matches(":invalid"));
i.pattern = "(";
assert_false(i.matches(":invalid"));
}, "input validation is updated after pattern attribute change");
</script>