Skip to content
Permalink
Browse files

[] (0) Support <form autocomplete>

git-svn-id: http://svn.whatwg.org/webapps@2798 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Feb 12, 2009
1 parent 23c4864 commit d593d71a1ecdbb08a325091dcc0bffef977a7ce7
Showing with 129 additions and 49 deletions.
  1. +55 −23 index
  2. +74 −26 source
78 index
<dd><a href=#global-attributes>Global attributes</a></dd>
<dd><code title=attr-form-accept-charset><a href=#attr-form-accept-charset>accept-charset</a></code></dd>
<dd><code title=attr-fs-action><a href=#attr-fs-action>action</a></code></dd>
<dd><code title=attr-form-autocomplete><a href=#attr-form-autocomplete>autocomplete</a></code></dd>
<dd><code title=attr-fs-enctype><a href=#attr-fs-enctype>enctype</a></code></dd>
<dd><code title=attr-fs-method><a href=#attr-fs-method>method</a></code></dd>
<dd><code title=attr-form-name><a href=#attr-form-name>name</a></code></dd>
interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
attribute DOMString <a href=#dom-form-acceptcharset title=dom-form-acceptCharset>acceptCharset</a>;
attribute DOMString <a href=#dom-fs-action title=dom-fs-action>action</a>;
attribute boolean <a href=#dom-form-autocomplete title=dom-form-autocomplete>autocomplete</a>;
attribute DOMString <a href=#dom-fs-enctype title=dom-fs-enctype>enctype</a>;
attribute DOMString <a href=#dom-fs-method title=dom-fs-method>method</a>;
attribute DOMString <a href=#dom-form-name title=dom-form-name>name</a>;
empty string, and the value must be unique amongst the
<code><a href=#the-form-element>form</a></code> elements in the <code title=dom-forms>forms</code> collection that it is in, if any.</p>

<p>The <dfn id=attr-form-autocomplete title=attr-form-autocomplete><code>autocomplete</code></dfn>
attribute is an <a href=#enumerated-attribute>enumerated attribute</a>. The attribute has
two states. The <code title=attr-form-autocomplete-on>on</code>
keyword maps to the <dfn id=attr-form-autocomplete-on-state title=attr-form-autocomplete-on-state>on</dfn> state, and the
<code title=attr-form-autocomplete-off>off</code> keyword maps to
the <dfn id=attr-form-autocomplete-off-state title=attr-form-autocomplete-off-state>off</dfn>
state. The attribute may also be omitted. The <i>missing value
default</i> is the <a href=#attr-form-autocomplete-on-state title=attr-form-autocomplete-on-state>on</a> state. The <a href=#attr-form-autocomplete-off-state title=attr-form-autocomplete-off-state>off</a> state indicates
that by default, <code><a href=#the-input-element>input</a></code> elements in the form will have
their <a href=#resulting-autocompletion-state>resulting autocompletion state</a> set to <i title="">off</i>; the <a href=#attr-form-autocomplete-on-state title=attr-form-autocomplete-on-state>on</a> state indicates
that by default, <code><a href=#the-input-element>input</a></code> elements in the form will have
their <a href=#resulting-autocompletion-state>resulting autocompletion state</a> set to <i title="">on</i>.</p>

<p>The <code title=attr-fs-action><a href=#attr-fs-action>action</a></code>, <code title=attr-fs-enctype><a href=#attr-fs-enctype>enctype</a></code>, <code title=attr-fs-method><a href=#attr-fs-method>method</a></code>, <code title=attr-fs-novalidate><a href=#attr-fs-novalidate>novalidate</a></code>, and <code title=attr-fs-target><a href=#attr-fs-target>target</a></code> attributes are <a href=#form-submission>attributes
for form submission</a>.</p>

<p>The <dfn id=dom-form-acceptcharset title=dom-form-acceptCharset><code>acceptCharset</code></dfn>
and <dfn id=dom-form-name title=dom-form-name><code>name</code></dfn> DOM
attributes must <a href=#reflect>reflect</a> the respective content
attributes of the same name.</p>
<p>The <dfn id=dom-form-autocomplete title=dom-form-autocomplete><code>autocomplete</code></dfn> and
<dfn id=dom-form-name title=dom-form-name><code>name</code></dfn> DOM attributes
must <a href=#reflect>reflect</a> the respective content attributes of the
same name.</p>

<p>The <dfn id=dom-form-acceptcharset title=dom-form-acceptCharset><code>acceptCharset</code></dfn> DOM
attribute must <a href=#reflect>reflect</a> the <code title=attr-form-accept-charset><a href=#attr-form-accept-charset>accept-charset</a></code> content
attribute.</p>

<p>The <dfn id=dom-form-elements title=dom-form-elements><code>elements</code></dfn>
DOM attribute must return an <code><a href=#htmlformcontrolscollection-0>HTMLFormControlsCollection</a></code>

<h6 id=the-autocomplete-attribute><span class=secno>4.10.4.2.1 </span>The <code title=attr-input-autocomplete><a href=#attr-input-autocomplete>autocomplete</a></code> attribute</h6>

<!-- IE also applies it to <form> elements, but only 0.09% of pages
use it there, so we don't support that. (It doesn't apply it to
<textarea>, so we don't support it there either.) -->

<p>The <dfn id=attr-input-autocomplete title=attr-input-autocomplete><code>autocomplete</code></dfn>
attribute is an <a href=#enumerated-attribute>enumerated attribute</a>. The attribute has
two states. The <code title=attr-input-autocomplete-on>on</code>
three states. The <code title=attr-input-autocomplete-on>on</code>
keyword maps to the <dfn id=attr-input-autocomplete-on-state title=attr-input-autocomplete-on-state>on</dfn> state, and the
<code title=attr-input-autocomplete-off>off</code> keyword maps to
the <dfn id=attr-input-autocomplete-off-state title=attr-input-autocomplete-off-state>off</dfn>
state. The attribute may also be omitted. The <i>missing value
default</i> is the <a href=#attr-input-autocomplete-on-state title=attr-input-autocomplete-on-state>on</a> state.</p>
default</i> is the <dfn id=attr-input-autocomplete-default-state title=attr-input-autocomplete-default-state>default</dfn>
state.</p>

<p>The <a href=#attr-input-autocomplete-off-state title=attr-input-autocomplete-off-state>off</a>
state indicates that the control's input data is either particularly
to be able to rely on his user agent to remember values he has
entered for that control.</p>

<p>The <a href=#attr-input-autocomplete-default-state title=attr-input-autocomplete-default-state>default</a> state
indicates that the user agent is to use the <code title=attr-form-autocomplete><a href=#attr-form-autocomplete>autocomplete</a></code> attribute on the
element's <a href=#form-owner>form owner</a> instead.</p>

<p>Each <code><a href=#the-input-element>input</a></code> element has a <dfn id=resulting-autocompletion-state>resulting
autocompletion state</dfn>, which is either <i title="">on</i> or <i title="">off</i>.</p>

<p>When an <code><a href=#the-input-element>input</a></code> element's <code title=attr-input-autocomplete><a href=#attr-input-autocomplete>autocomplete</a></code> attribute is in
the <a href=#attr-input-autocomplete-on-state title=attr-input-autocomplete-on-state>on</a> 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
when an <code><a href=#the-input-element>input</a></code> element's <code title=attr-input-autocomplete><a href=#attr-input-autocomplete>autocomplete</a></code> attribute is in
the <a href=#attr-input-autocomplete-default-state title=attr-input-autocomplete-default-state>default</a> state,
and the element has no <a href=#form-owner>form owner</a>, and when an
<code><a href=#the-input-element>input</a></code> element's <code title=attr-input-autocomplete><a href=#attr-input-autocomplete>autocomplete</a></code> attribute is in
the <a href=#attr-input-autocomplete-off-state title=attr-input-autocomplete-off-state>off</a>
state, the user agent should not remember the control's <a href=#concept-fe-value title=concept-fe-value>value</a>.</p>
the <a href=#attr-input-autocomplete-default-state title=attr-input-autocomplete-default-state>default</a> state,
and the element's <a href=#form-owner>form owner</a>'s <code title=attr-form-autocomplete><a href=#attr-form-autocomplete>autocomplete</a></code> attribute is in
the <a href=#attr-form-autocomplete-on-state title=attr-form-autocomplete-on-state>on</a> state,
the <code><a href=#the-input-element>input</a></code> element's <a href=#resulting-autocompletion-state>resulting autocompletion
state</a> is <i title="">on</i>. Otherwise, the
<code><a href=#the-input-element>input</a></code> element's <a href=#resulting-autocompletion-state>resulting autocompletion
state</a> is <i title="">off</i>.</p>

<p>When an <code><a href=#the-input-element>input</a></code> element's <a href=#resulting-autocompletion-state>resulting
autocompletion state</a> is <i title="">on</i>, 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. Otherwise, the user agent
should not remember the control's <a href=#concept-fe-value title=concept-fe-value>value</a>.</p>

<p>The autocompletion mechanism must be implemented by the user
agent acting as if the user had modified the element's <a href=#concept-fe-value title=concept-fe-value>value</a>, and must be done at a time

</div>

<p>A user agent may allow the user to disable support for this
attribute's <a href=#attr-input-autocomplete-off-state title=attr-input-autocomplete-off-state>off</a> state (causing
the attribute to always be in the <a href=#attr-input-autocomplete-on-state title=attr-input-autocomplete-on-state>on</a> state and always
allowing values to be remembered and prefilled). Support for the
<a href=#attr-input-autocomplete-off-state title=attr-input-autocomplete-off-state>off</a> 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>
<p>A user agent may allow the user to override the <a href=#resulting-autocompletion-state>resulting
autocompletion state</a> and set it to always <i title="">on</i>,
always allowing values to be remembered and prefilled), or always <i title="">off</i>, never remembering values. However, the ability to
override the <a href=#resulting-autocompletion-state>resulting autocompletion state</a> to <i title="">on</i> should not be trivially accessible, as there are
significant security implications for the user if all values are
always remembered, regardless of the site's preferences.</p>



100 source
<dd><span>Global attributes</span></dd>
<dd><code title="attr-form-accept-charset">accept-charset</code></dd>
<dd><code title="attr-fs-action">action</code></dd>
<dd><code title="attr-form-autocomplete">autocomplete</code></dd>
<dd><code title="attr-fs-enctype">enctype</code></dd>
<dd><code title="attr-fs-method">method</code></dd>
<dd><code title="attr-form-name">name</code></dd>
interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
attribute DOMString <span title="dom-form-acceptCharset">acceptCharset</span>;
attribute DOMString <span title="dom-fs-action">action</span>;
attribute boolean <span title="dom-form-autocomplete">autocomplete</span>;
attribute DOMString <span title="dom-fs-enctype">enctype</span>;
attribute DOMString <span title="dom-fs-method">method</span>;
attribute DOMString <span title="dom-form-name">name</span>;
<code>form</code> elements in the <code
title="dom-forms">forms</code> collection that it is in, if any.</p>

<p>The <dfn
title="attr-form-autocomplete"><code>autocomplete</code></dfn>
attribute is an <span>enumerated attribute</span>. The attribute has
two states. The <code title="attr-form-autocomplete-on">on</code>
keyword maps to the <dfn
title="attr-form-autocomplete-on-state">on</dfn> state, and the
<code title="attr-form-autocomplete-off">off</code> keyword maps to
the <dfn title="attr-form-autocomplete-off-state">off</dfn>
state. The attribute may also be omitted. The <i>missing value
default</i> is the <span
title="attr-form-autocomplete-on-state">on</span> state. The <span
title="attr-form-autocomplete-off-state">off</span> state indicates
that by default, <code>input</code> elements in the form will have
their <span>resulting autocompletion state</span> set to <i
title="">off</i>; the <span
title="attr-form-autocomplete-on-state">on</span> state indicates
that by default, <code>input</code> elements in the form will have
their <span>resulting autocompletion state</span> set to <i
title="">on</i>.</p>

<p>The <code title="attr-fs-action">action</code>, <code
title="attr-fs-enctype">enctype</code>, <code
title="attr-fs-method">method</code>, <code
for form submission</span>.</p>

<p>The <dfn
title="dom-form-acceptCharset"><code>acceptCharset</code></dfn>
and <dfn title="dom-form-name"><code>name</code></dfn> DOM
attributes must <span>reflect</span> the respective content
attributes of the same name.</p>
title="dom-form-autocomplete"><code>autocomplete</code></dfn> and
<dfn title="dom-form-name"><code>name</code></dfn> DOM attributes
must <span>reflect</span> the respective content attributes of the
same name.</p>

<p>The <dfn
title="dom-form-acceptCharset"><code>acceptCharset</code></dfn> DOM
attribute must <span>reflect</span> the <code
title="attr-form-accept-charset">accept-charset</code> content
attribute.</p>

<p>The <dfn title="dom-form-elements"><code>elements</code></dfn>
DOM attribute must return an <code>HTMLFormControlsCollection</code>

<h6>The <code title="attr-input-autocomplete">autocomplete</code> attribute</h6>

<!-- IE also applies it to <form> elements, but only 0.09% of pages
use it there, so we don't support that. (It doesn't apply it to
<textarea>, so we don't support it there either.) -->

<p>The <dfn
title="attr-input-autocomplete"><code>autocomplete</code></dfn>
attribute is an <span>enumerated attribute</span>. The attribute has
two states. The <code title="attr-input-autocomplete-on">on</code>
three 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>
default</i> is the <dfn
title="attr-input-autocomplete-default-state">default</dfn>
state.</p>

<p>The <span title="attr-input-autocomplete-off-state">off</span>
state indicates that the control's input data is either particularly
to be able to rely on his user agent to remember values he has
entered for that control.</p>

<p>The <span
title="attr-input-autocomplete-default-state">default</span> state
indicates that the user agent is to use the <code
title="attr-form-autocomplete">autocomplete</code> attribute on the
element's <span>form owner</span> instead.</p>

<p>Each <code>input</code> element has a <dfn>resulting
autocompletion state</dfn>, which is either <i title="">on</i> or <i
title="">off</i>.</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
when an <code>input</code> element's <code
title="attr-input-autocomplete">autocomplete</code> attribute is in
the <span
title="attr-input-autocomplete-default-state">default</span> state,
and the element has no <span>form owner</span>, and 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 <span
the <span
title="attr-input-autocomplete-default-state">default</span> state,
and the element's <span>form owner</span>'s <code
title="attr-form-autocomplete">autocomplete</code> attribute is in
the <span title="attr-form-autocomplete-on-state">on</span> state,
the <code>input</code> element's <span>resulting autocompletion
state</span> is <i title="">on</i>. Otherwise, the
<code>input</code> element's <span>resulting autocompletion
state</span> is <i title="">off</i>.</p>

<p>When an <code>input</code> element's <span>resulting
autocompletion state</span> is <i title="">on</i>, 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. Otherwise, the user agent
should not remember the control's <span
title="concept-fe-value">value</span>.</p>

<p>The autocompletion mechanism must be implemented by the user

</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>
<p>A user agent may allow the user to override the <span>resulting
autocompletion state</span> and set it to always <i title="">on</i>,
always allowing values to be remembered and prefilled), or always <i
title="">off</i>, never remembering values. However, the ability to
override the <span>resulting autocompletion state</span> to <i
title="">on</i> should not be trivially accessible, as there are
significant security implications for the user if all values are
always remembered, regardless of the site's preferences.</p>



0 comments on commit d593d71

Please sign in to comment.
You can’t perform that action at this time.