HTML Standard Tracker


File a bug

SVNBugCommentTime (UTC)
2278WF2: <input pattern>2008-10-04 00:22
@@ -28615,22 +28615,47 @@ function AddCloud(data, x, y) { ... }</pre>
   <p>User agents may prevent the user from setting the element's <span
   title="concept-fe-value">value</span> to a value whose
   <span>codepoint length</span> is greater than the element's
   <span>maximum allowed value length</span>.</p>
   <h6>The <code title="attr-input-pattern">pattern</code> attribute</h6>
-  <p class="XXX">... <dfn title="attr-input-pattern"><code>pattern</code></dfn></p>
+  <p>The <dfn title="attr-input-pattern"><code>pattern</code></dfn>
+  attribute specifies a regular expression against which the control's
+  <span title="concept-fe-value">value</span> is to be checked.</p>
+  <p>If specified, the attribute's value must match the <i
+  title="">Pattern</i> production of ECMA 262's grammar. <a
+  href="#refsECMA262">[ECMA262]</a></p>
+  <p><strong>Constraint validation:</strong> If the element's <span
+  title="concept-fe-value">value</span> is not the empty string, and
+  the element's <code title="attr-input-pattern">pattern</code>
+  attribute is specified and the attribute's value, when compiled as
+  an ECMA 262 regular expression with the <code
+  title="">global</code>, <code title="">ignoreCase</code>, and <code
+  title="">multiline</code> flags <em>disabled</em> (see ECMA 262,
+  sections through, compiles successfully but the
+  resulting regular expression does not match the entirety of the
+  element's <span title="concept-fe-value">value</span>, then the
+  element is <span>suffering from a pattern mismatch</span>.</p>
+  <p class="note">This implies that the regular expression language
+  used for this attribute is the same as that defined in <a
+  href="#refsECMA262">[ECMA262]</a>, except that the <code
+  title="attr-input-pattern">pattern</code> attribute must match the
+  entire value, not just any subset (somewhat as if it implied a <code
+  title="">^(?:</code> at the start of the pattern and a <code
+  title="">)$</code> at the end).</p>
   <h6>The <code title="attr-input-min">min</code> and <code
   title="attr-input-max">max</code> attributes</h6>
   <p>The <dfn title="attr-input-min"><code>min</code></dfn> and <dfn
   title="attr-input-max"><code>max</code></dfn> attributes indicate
   the allowed range of values for the element.</p>
   <p>Their syntax is defined by the section that defines the <code