Short URL: http://html5.org/r/2202
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 2202 | WF2: Restructure the <input> section to allow for attributes to be defined once instead of multiple times. Define autocomplete=''. | 2008-09-17 01:17 |
Index: source =================================================================== --- source (revision 2201) +++ source (revision 2202) @@ -24463,36 +24463,30 @@ the control non-interactive and to prevent its value from being submitted.</p> - <p class="big-issue">... <dfn title="attr-input-autofocus"><code>autofocus</code></dfn></p> - - <p>The semantics and processing rules of the <dfn - title="attr-input-accept"><code>accept</code></dfn>, <dfn - title="attr-input-alt"><code>alt</code></dfn>, <dfn - title="attr-input-autocomplete"><code>autocomplete</code></dfn>, - <dfn title="attr-input-checked"><code>checked</code></dfn>, <dfn - title="attr-input-inputmode"><code>inputmode</code></dfn>, <dfn - title="attr-input-list"><code>list</code></dfn>, <dfn - title="attr-input-max"><code>max</code></dfn>, <dfn - title="attr-input-maxlength"><code>maxlength</code></dfn>, <dfn - title="attr-input-min"><code>min</code></dfn>, <dfn - title="attr-input-pattern"><code>pattern</code></dfn>, <dfn - title="attr-input-readonly"><code>readonly</code></dfn>, <dfn - title="attr-input-required"><code>required</code></dfn>, <dfn - title="attr-input-size"><code>size</code></dfn>, <dfn - title="attr-input-src"><code>src</code></dfn>, <dfn - title="attr-input-step"><code>step</code></dfn>, and <dfn - title="attr-input-value"><code>value</code></dfn> attributes depend - on the state of the <code title="attr-input-type">type</code> - attribute, and are defined in the sections below.</p> - - <p>The <code title="attr-fs-target">target</code>, <code + <p>Which of the <code title="attr-input-accept">accept</code>, <code + title="attr-fs-action">action</code>, <code + title="attr-input-alt">alt</code>, <code + title="attr-input-autocomplete">autocomplete</code>, <code + title="attr-input-autofocus">autofocus</code>, <code + title="attr-input-checked">checked</code>, <code + title="attr-fs-enctype">enctype</code>, and <code + title="attr-input-inputmode">inputmode</code>, <code + title="attr-input-list">list</code>, <code + title="attr-input-max">max</code>, <code + title="attr-input-maxlength">maxlength</code>, <code title="attr-fs-method">method</code>, <code - title="attr-fs-enctype">enctype</code>, and <code - title="attr-fs-action">action</code> attributes are used in - <span>form submission</span> when the <code - title="attr-input-type">type</code> attribute is in one of the <span - title="attr-input-type-submit">Submit Button</span> or <span - title="attr-input-type-image">Image Button</span> states.</p> + title="attr-input-min">min</code>, <code + title="attr-input-pattern">pattern</code>, <code + title="attr-input-readonly">readonly</code>, <code + title="attr-input-required">required</code>, <code + title="attr-input-size">size</code>, <code + title="attr-input-src">src</code>, <code + title="attr-input-step">step</code>, <code + title="attr-fs-target">target</code>, and <code + title="attr-input-value">value</code> attributes apply to an + <code>input</code> element depends on the state of its <code + title="attr-input-type">type</code> attribute. They are defined + below.</p> <p>The <dfn title="dom-input-accept"><code>accept</code></dfn>, <dfn title="dom-input-alt"><code>alt</code></dfn>, <dfn @@ -24543,27 +24537,34 @@ - <h5><dfn title="attr-input-type-text">Text</dfn> state</h5> + <h5>States of the <code title="attr-input-type">type</code> attribute</h5> + <h6><dfn title="attr-input-type-text">Text</dfn> state</h6> + <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute is absent, has the value <code title="attr-input-type-text-keyword">text</code>, or has an invalid value, it is in the <span title="attr-input-type-text">Text</span> state.</p> - <p class="big-issue">... - <code title="attr-input-autocomplete">autocomplete</code> - <code title="attr-input-inputmode">inputmode</code> - <code title="attr-input-list">list</code> - <code title="attr-input-maxlength">maxlength</code> - <code title="attr-input-pattern">pattern</code> - <code title="attr-input-readonly">readonly</code> - <code title="attr-input-required">required</code> - <code title="attr-input-size">size</code> - <code title="attr-input-value">value</code> - </p> + <p class="big-issue">...</p> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute is in the <span + title="attr-input-type-text">Text</span> state, the following common + <code>input</code> element attributes apply to the element: + <code title="attr-input-autocomplete">autocomplete</code>, + <code title="attr-input-autofocus">autofocus</code>, + <code title="attr-input-inputmode">inputmode</code>, + <code title="attr-input-list">list</code>, + <code title="attr-input-maxlength">maxlength</code>, + <code title="attr-input-pattern">pattern</code>, + <code title="attr-input-readonly">readonly</code>, + <code title="attr-input-required">required</code>, + <code title="attr-input-size">size</code>, and + <code title="attr-input-value">value</code>.</p> + + <p>When an <code>input</code> element's <code + title="attr-input-type">type</code> attribute is in the <span title="attr-input-type-text">Text</span> state, the following attributes must not be specified: <code class="no-backref" title="attr-input-accept">accept</code>, @@ -24580,7 +24581,7 @@ - <h5><dfn title="attr-input-type-password">Password</dfn> state</h5> + <h6><dfn title="attr-input-type-password">Password</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-password-keyword">password</code>, @@ -24590,7 +24591,7 @@ - <h5><dfn title="attr-input-type-image">Image Button</dfn> state</h5> + <h6><dfn title="attr-input-type-image">Image Button</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-image-keyword">image</code>, @@ -24602,7 +24603,7 @@ - <h5><dfn title="attr-input-type-datetime">Date and Time</dfn> state</h5> + <h6><dfn title="attr-input-type-datetime">Date and Time</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-datetime-keyword">datetime</code>, @@ -24612,7 +24613,7 @@ - <h5><dfn title="attr-input-type-datetime-local">Local Date and Time</dfn> state</h5> + <h6><dfn title="attr-input-type-datetime-local">Local Date and Time</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-datetime-local-keyword">datetime-local</code>, @@ -24622,7 +24623,7 @@ - <h5><dfn title="attr-input-type-date">Date</dfn> state</h5> + <h6><dfn title="attr-input-type-date">Date</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-date-keyword">date</code>, @@ -24632,7 +24633,7 @@ - <h5><dfn title="attr-input-type-month">Month</dfn> state</h5> + <h6><dfn title="attr-input-type-month">Month</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-month-keyword">month</code>, @@ -24642,7 +24643,7 @@ - <h5><dfn title="attr-input-type-week">Week</dfn> state</h5> + <h6><dfn title="attr-input-type-week">Week</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-week-keyword">week</code>, @@ -24652,7 +24653,7 @@ - <h5><dfn title="attr-input-type-time">Time</dfn> state</h5> + <h6><dfn title="attr-input-type-time">Time</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-time-keyword">time</code>, @@ -24662,7 +24663,7 @@ - <h5><dfn title="attr-input-type-number">Number</dfn> state</h5> + <h6><dfn title="attr-input-type-number">Number</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-number-keyword">number</code>, @@ -24672,7 +24673,7 @@ - <h5><dfn title="attr-input-type-range">Range</dfn> state</h5> + <h6><dfn title="attr-input-type-range">Range</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-range-keyword">range</code>, @@ -24682,7 +24683,7 @@ - <h5><dfn title="attr-input-type-email">E-mail</dfn> state</h5> + <h6><dfn title="attr-input-type-email">E-mail</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-email-keyword">email</code>, @@ -24692,7 +24693,7 @@ - <h5><dfn title="attr-input-type-url">URL</dfn> state</h5> + <h6><dfn title="attr-input-type-url">URL</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-url-keyword">url</code>, @@ -24702,7 +24703,7 @@ - <h5><dfn title="attr-input-type-checkbox">Checkbox</dfn> state</h5> + <h6><dfn title="attr-input-type-checkbox">Checkbox</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-checkbox-keyword">checkbox</code>, @@ -24714,7 +24715,7 @@ - <h5><dfn title="attr-input-type-radio">Radio Button</dfn> state</h5> + <h6><dfn title="attr-input-type-radio">Radio Button</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-radio-keyword">radio</code>, @@ -24726,7 +24727,7 @@ - <h5><dfn title="attr-input-type-file">File</dfn> state</h5> + <h6><dfn title="attr-input-type-file">File</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-file-keyword">file</code>, @@ -24738,7 +24739,7 @@ - <h5><dfn title="attr-input-type-hidden">Hidden</dfn> state</h5> + <h6><dfn title="attr-input-type-hidden">Hidden</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-hidden-keyword">hidden</code>, @@ -24748,7 +24749,7 @@ - <h5><dfn title="attr-input-type-submit">Submit Button</dfn> state</h5> + <h6><dfn title="attr-input-type-submit">Submit Button</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-submit-keyword">submit</code>, @@ -24762,7 +24763,7 @@ - <h5><dfn title="attr-input-type-reset">Reset Button</dfn> state</h5> + <h6><dfn title="attr-input-type-reset">Reset Button</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-reset-keyword">reset</code>, @@ -24772,7 +24773,7 @@ - <h5><dfn title="attr-input-type-button">Button</dfn> state</h5> + <h6><dfn title="attr-input-type-button">Button</dfn> state</h6> <p>When an <code>input</code> element's <code title="attr-input-type">type</code> attribute has the value <code title="attr-input-type-button-keyword">button</code>, @@ -24782,7 +24783,88 @@ + <h5>Common <code>input</code> element attributes</h5> + <p>These attributes only apply to an <code>input</code> element if + its <code title="attr-input-type">type</code> attribute is in a + state whose definition declares that the attribute applies. When an + attribute doesn't apply to an <code>input</code> element, user + agents must <span>ignore</span> the attribute.</p> + + + <h6>The <code title="attr-input-autocomplete">autocomplete</code> attribute</h6> + + <!--XXX IE also applies it to <form> elements. It doesn't apply it + to <textarea>. --> + + <p>The <dfn + title="attr-input-autocomplete"><code>autocomplete</code></dfn> + attribute is an enumerated attribute. The attribute has two + states. The <code title="attr-input-autocomplete-on">on</code> + keyword maps to the <dfn + title="attr-input-autocomplete-on-state">on</dfn> state, and the + <code title="attr-input-autocomplete-off">off</code> keyword maps to + the <dfn title="attr-input-autocomplete-off-state">off</dfn> + state. The attribute may also be omitted. The <i>missing value + default</i> is the <span + title="attr-input-autocomplete-on-state">on</span> state.</p> + + <p>The <span title="attr-input-autocomplete-off-state">off</span> + state indicates that the control's input data is either + particularily sensitive (for example the activation code for a + nuclear weapon) or is a value that will never be reused (for example + a one-time-key for a bank login) and the user should therefore + explicitly enter the data each time, instead of being able to rely + on the UA to prefill the value for him.</p> + + <p>Conversely, the <span + title="attr-input-autocomplete-on-state">on</span> state indicates + that the value is not particularily sensitive and the user should + expect to be able to rely on his UA to remember values he has + entered for that control.</p> + + <p>When an <code>input</code> element's <code + title="attr-input-autocomplete">autocomplete</code> attribute is in + the <span title="attr-input-autocomplete-on-state">on</span> state, + the user agent may store the value entered by the user so that if + the user returns to the page, the UA can prefill the form. When an + <code>input</code> element's <code + title="attr-input-autocomplete">autocomplete</code> attribute is in + the <span title="attr-input-autocomplete-off-state">off</span> + state, the user agent should not remember the control's value.</p> + <!-- XXX xref value? --> + + <p>This specification does not define the autocompletion mechanism. + User agents may implement any system within the conformance criteria + of this specification, taking into account security and privacy + concerns.</p> + + <div class="example"> + + <p>Banks frequently do not want UAs to prefill login + information:</p> + + <pre><p>Account: <input type="text" name="ac" autocomplete="off"></p> +<p>PIN: <input type="text" name="pin" autocomplete="off"></p></pre> + + </div> + + <p>A user agent may allow the user to disable support for this + attribute's <span + title="attr-input-autocomplete-off-state">off</span> state (causing + the attribute to always be in the <span + title="attr-input-autocomplete-on-state">on</span> state and always + allowing values to be remembered and prefilled). Support for the + <span title="attr-input-autocomplete-off-state">off</span> state + should be enabled by default, and the ability to disable support + should not be trivially accessible, as there are significant + security implications for the user if support for this attribute is + disabled.</p> + + + + + <h4>The <dfn><code>button</code></dfn> element</h4> <dl class="element"> @@ -25265,6 +25347,7 @@ <p class="big-issue">... <dfn title="dom-fe-disabled">disabled</dfn> DOM attribute</p> <p class="big-issue">... <dfn title="concept-fe-value">value</dfn></p> + <!-- XXX autocomplete: define somewhere that the value may be set from a stored value --> <h4><dfn>Attributes for form submission</dfn></h4>