summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/constraints/input-pattern-dynamic-value.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/constraints/input-pattern-dynamic-value.html')
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/input-pattern-dynamic-value.html17
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/input-pattern-dynamic-value.html b/testing/web-platform/tests/html/semantics/forms/constraints/input-pattern-dynamic-value.html
new file mode 100644
index 0000000000..58e566c738
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/input-pattern-dynamic-value.html
@@ -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>