3 <title>The constraint validation API Test: element.validity.patternMismatch</title>
4 <link rel="author" title="Intel" href="http://www.intel.com/">
5 <link rel="help" href="http://www.w3.org/html/wg/drafts/html/master/forms.html#dom-validitystate-patternmismatch">
6 <link rel="help" href="http://www.w3.org/html/wg/drafts/html/master/forms.html#the-constraint-validation-api">
7 <script src="../../../../resources/testharness.js"></script>
8 <script src="../../../../resources/testharnessreport.js"></script>
9 <script src="support/validator.js"></script>
15 types: ["text", "search", "tel", "url", "email", "password"],
17 {conditions: {pattern: null, value: "abc"}, expected: false, name: "[target] The pattern attribute is not set"},
18 {conditions: {pattern: "[A-Z]+", value: ""}, expected: false, name: "[target] The value attibute is empty string"},
19 {conditions: {pattern: "[A-Z]{1}", value: "A"}, expected: false, name: "[target] The value attribute matches the pattern attribute"},
20 {conditions: {pattern: "[A-Z]+", value: "\u0041\u0042\u0043"}, expected: false, name: "[target] The value(ABC) in unicode attribute matches the pattern attribute"},
21 {conditions: {pattern: "[a-z]{3,}", value: "ABCD"}, expected: true, name: "[target] The value attribute mismatches the pattern attribute"}
26 validator.run_test (testElements, "patternMismatch");