HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2362[Opera] WF2: Define title= on <input> with pattern=; clarify how validity states work with disabled controls.2008-10-23 15:39
@@ -6104,22 +6104,22 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
   relevant to this element. Setting the attribute overrides this,
   explicitly stating that the advisory information of any ancestors is
   not relevant to this element.  Setting the attribute to the empty
   string indicates that the element has no advisory information.</p>
 
   <p>If the <code title="attr-title">title</code> attribute's value
   contains U+000A LINE FEED (LF) characters, the content is split into
   multiple lines. Each U+000A LINE FEED (LF) character represents a
   line break.</p>
 
-  <p>Some elements, such as <code>link</code> and <code>abbr</code>,
-  define additional semantics for the <code
+  <p>Some elements, such as <code>link</code>, <code>abbr</code>, and
+  <code>input</code>, define additional semantics for the <code
   title="attr-title">title</code> attribute beyond the semantics
   described above.</p>
 
   <p>The <dfn title="dom-title"><code>title</code></dfn> DOM attribute
   must <span>reflect</span> the <code title="attr-title">title</code>
   content attribute.</p>
 
 
   <h5>The <dfn title="attr-lang"><code>lang</code></dfn> and <dfn
   title="attr-xml-lang"><code>xml:lang</code></dfn>
@@ -29015,20 +29015,59 @@ function AddCloud(data, x, y) { ... }</pre>
   element is <span>suffering from a pattern mismatch</span>. <a
   href="#refsECMA262">[ECMA262]</a></p>
 
   <p class="note">This implies that the regular expression language
   used for this attribute is the same as that defined in ECMA 262,
   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>
 
+  <p>When an <code>input</code> element has a <code
+  title="attr-input-pattern">pattern</code> attribute specified,
+  authors should include a <code title="attr-title">title</code>
+  attribute to give a description of the pattern. User agents may use
+  the contents of this attribute, if it is present, when informing the
+  user that the pattern is not matched, or at any other suitable time,
+  such as in a tooltip or read out by assistive technology when the
+  control gains focus.</p>
+
+  <div class="example">
+   <p>For example, the following snippet:</p>
+   <pre>
+&lt;label&gt; Part number:
+ &lt;input pattern="[0-9][A-Z]{3}" name="part"
+        title="A part number is a digit followed by three uppercase letters."/&gt;
+&lt;/label&gt;
+</pre>
+   <p>...could cause the UA to display an alert such as:</p>
+   <pre><samp> part number is a digit followed by three uppercase letters.
+You cannot complete this form until the field is correct.</samp></pre>
+  </div>
+
+  <p>When a control has a <code>pattern</code> attribute, the
+  <code>title</code> attribute, if used, must describe the pattern.
+  Additional information could also be included, so long as it assists
+  the user in filling in the control. Otherwise, assistive technology
+  would be impaired.</p>
+
+  <p class="example">For instance, if the title attribute contained
+  the caption of the control, assistive technology could end up saying
+  something like <samp>The text you have entered does not match the
+  required pattern. Birthday</samp>, which is not useful.</p>
+
+  <p>UAs may still show the <code>title</code> in non-error situations
+  (for example, as a tooltip when hovering over the control), so
+  authors should be careful not to word <code>title</code>s as if an
+  error has necessarily occurred.</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
   title="attr-input-type">type</code> attribute's current state.</p>
@@ -30863,83 +30902,91 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
   the empty string, the element is <span>suffering from a custom
   error</span>. It can be set using the <code
   title="dom-cva-setCustomValidity">setCustomValidity()</code>
   method. The user agent should use the <span>custom validity error
   message</span> when alerting the user to the problem with the
   control.</p>
 
   <p>An element can be constrained in various ways. The following is
   the list of <dfn>validity states</dfn> that a form control can be
   in, making the control invalid for the purposes of constraint
-  valiation:</p>
+  validation. (The definitions below are non-normative; other parts of
+  this specification define more precisely when each state applies or
+  does not.)</p>
 
   <dl>
 
    <dt> <dfn>Suffering from being missing</dfn> </dt>
 
-   <dd> <p>When a control has no <span
+   <dd> <p class="note">When a control has no <span
    title="concept-fe-value">value</span> but has a <code
    title="">required</code> attribute (<code>input</code> <code
    title="attr-input-required">required</code>, <code>textarea</code>
    <code title="attr-textarea-required">required</code>). </p></dd>
 
    <dt> <dfn>Suffering from a type mismatch</dfn> </dt>
 
-   <dd> <p>When a control that allows arbitrary user input has a <span
+   <dd> <p class="note">When a control that allows arbitrary user input has a <span
    title="concept-fe-value">value</span> that is not in the correct
    syntax (<span title="attr-input-type-email">E-mail</span>, <span
    title="attr-input-type-url">URL</span>). </p></dd>
 
    <dt> <dfn>Suffering from a pattern mismatch</dfn> </dt>
 
-   <dd> <p>When a control has a <span
+   <dd> <p class="note">When a control has a <span
    title="concept-fe-value">value</span> that doesn't satisfy the
    <code title="attr-input-pattern">pattern</code> attribute.</p></dd>
 
    <dt> <dfn>Suffering from being too long</dfn> </dt>
 
-   <dd> <p>When a control has a <span
+   <dd> <p class="note">When a control has a <span
    title="concept-fe-value">value</span> that is too long for the
    <span title="attr-fe-maxlength">form control <code
    title="">maxlength</code> attribute</span> (<code>input</code>
    <code title="attr-input-maxlength">maxlength</code>,
    <code>textarea</code> <code
    title="attr-textarea-maxlength">maxlength</code>). </p></dd>
 
    <dt> <dfn>Suffering from an underflow</dfn> </dt>
 
-   <dd> <p>When a control has a <span
+   <dd> <p class="note">When a control has a <span
    title="concept-fe-value">value</span> that is too low for the <code
    title="attr-input-min">min</code> attribute.</p></dd>
 
    <dt> <dfn>Suffering from an overflow</dfn> </dt>
 
-   <dd> <p>When a control has a <span
+   <dd> <p class="note">When a control has a <span
    title="concept-fe-value">value</span> that is too high for the
    <code title="attr-input-max">max</code> attribute.</p></dd>
 
    <dt> <dfn>Suffering from a step mismatch</dfn> </dt>
 
-   <dd> <p>When a control has a <span
+   <dd> <p class="note">When a control has a <span
    title="concept-fe-value">value</span> that doesn't fit the rules
    given by the <code title="attr-input-step">step</code>
    attribute.</p></dd>
 
    <dt> <dfn>Suffering from a custom error</dfn> </dt>
 
-   <dd> <p>When a control's <span>custom validity error message</span>
+   <dd> <p class="note">When a control's <span>custom validity error message</span>
    (as set by the element's <code
    title="dom-cva-setCustomValidity">setCustomValidity()</code>
    method) is not the empty string.</p> </dd>
 
   </dl>
 
+  <p class="note">An element can still suffer from these states even
+  when the element is <span
+  title="concept-fe-disabled">disabled</span>; thus these states can
+  be represented in the DOM even if validating the form during
+  submission wouldn't indicate a problem to the user.</p>
+
   <p>An element <dfn title="concept-fv-valid">satisfies its
   constraints</dfn> if it is not suffering from any of the above
   <span>validity states</span>.</p>
 
 
 
   <h5>Constraint validation</h5>
 
   <p>When the user agent is required to <dfn>statically validate the
   constraints</dfn> of <code>form</code> element <var

|