Browse files

[] (0) WF2: <input type=url>. Define constraints for how/when autocom…

…plete='' happens. Say that input controls not in a document aren't mutable.

git-svn-id: http://svn.whatwg.org/webapps@2228 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent cf37ff8 commit 5a2e2dd77f8d3108133e5d71b563bd22f80e5873 @Hixie Hixie committed Sep 24, 2008
Showing with 207 additions and 18 deletions.
  1. +107 −8 index
  2. +100 −10 source
View
115 index
@@ -29561,6 +29561,13 @@ function AddCloud(data, x, y) { ... }</pre>
href="#disabled4" title=concept-fe-disabled>disabled</a>, it is <i
title=concept-input-immutable><a href="#immutable">immutable</a></i>.
+ <p>When an <code><a href="#input0">input</a></code> element does not have a
+ <code>Document</code> node as one of its ancestors (i.e. when it is not in
+ the document), it is <i title=concept-input-immutable><a
+ href="#immutable">immutable</a></i>.</p>
+ <!-- XXX how does
+ this affect shadow trees in XBL2? -->
+
<p class=note>The <code title=attr-input-readonly><a
href="#readonly0">readonly</a></code> attribute can also make an <code><a
href="#input0">input</a></code> element <i
@@ -29678,8 +29685,7 @@ function AddCloud(data, x, y) { ... }</pre>
<p><strong>The <a href="#text3" title=attr-input-type-text>Text</a> state's
<a href="#control0">control initialization algorithm</a> is as
- follows:</strong> <a href="#strip">Strip line breaks from the value</a>.</p>
- <!-- XXX autocomplete? -->
+ follows:</strong> <a href="#strip">Strip line breaks from the value</a>.
<p><strong>The <a href="#text3" title=attr-input-type-text>Text</a> state's
<a href="#default2">default value change algorithm</a> is as
@@ -29872,8 +29878,7 @@ function AddCloud(data, x, y) { ... }</pre>
<p><strong>The <a href="#e-mail0" title=attr-input-type-email>E-mail</a>
state's <a href="#control0">control initialization algorithm</a> is as
- follows:</strong> <a href="#strip">Strip line breaks from the value</a>.</p>
- <!-- XXX autocomplete? -->
+ follows:</strong> <a href="#strip">Strip line breaks from the value</a>.
<p><strong>The <a href="#e-mail0" title=attr-input-type-email>E-mail</a>
state's <a href="#default2">default value change algorithm</a> is as
@@ -29956,7 +29961,97 @@ function AddCloud(data, x, y) { ... }</pre>
href="#url1">url</a></code>, it is in the <a href="#url2"
title=attr-input-type-url>URL</a> state.
- <p class=big-issue>...
+ <p>When an <code><a href="#input0">input</a></code> element's <code
+ title=attr-input-type><a href="#type14">type</a></code> attribute is in
+ the <a href="#url2" title=attr-input-type-url>URL</a> state, the element
+ represents a control for editing a single <a href="#url">URL</a> given in
+ the element's <a href="#value12" title=concept-fe-value>value</a>.
+
+ <p>If an <code><a href="#input0">input</a></code> element whose <code
+ title=attr-input-type><a href="#type14">type</a></code> attribute is in
+ the <a href="#url2" title=attr-input-type-url>URL</a> state is <i
+ title=concept-input-mutable><a href="#mutable">mutable</a></i>, the user
+ should allow the user to change the URL represented by its <a
+ href="#value12" title=concept-fe-value>value</a>. User agents may allow
+ the user to set the <a href="#value12" title=concept-fe-value>value</a> to
+ a string that is not a URL. User agents should allow the user to set the
+ <a href="#value12" title=concept-fe-value>value</a> to the empty string.
+ User agents must not allow users to insert U+000A LINE FEED (LF) or U+000D
+ CARRIAGE RETURN (CR) characters into the <a href="#value12"
+ title=concept-fe-value>value</a> of such <code><a
+ href="#input0">input</a></code> elements.
+
+ <p><strong>The <a href="#url2" title=attr-input-type-url>URL</a> state's <a
+ href="#control0">control initialization algorithm</a> is as
+ follows:</strong> <a href="#strip">Strip line breaks from the value</a>.
+
+ <p><strong>The <a href="#url2" title=attr-input-type-url>URL</a> state's <a
+ href="#default2">default value change algorithm</a> is as
+ follows:</strong> If the <code><a href="#input0">input</a></code> element
+ is not <i title=concept-input-dirty><a href="#dirty0">dirty</a></i> then
+ set the <a href="#value12" title=concept-fe-value>value</a> of the element
+ to the value of the <code title=attr-input-value><a
+ href="#value8">value</a></code> content attribute and <a
+ href="#strip">strip line breaks from the value</a>.
+
+ <p><strong>The <a href="#url2" title=attr-input-type-url>URL</a> state's <a
+ href="#value10"><code title=dom-input-value>value</code> setter
+ algorithm</a> is as follows:</strong> Set the <a href="#value12"
+ title=concept-fe-value>value</a> of the element to the new value and <a
+ href="#strip">strip line breaks from the value</a>.
+
+ <p><strong>Constraint validation:</strong> While the <a href="#value12"
+ title=concept-fe-value>value</a> of the element is not a <a
+ href="#valid8">valid URL</a>, the element is <a
+ href="#suffering">suffering from a type mismatch</a>.
+
+ <p>When an <code><a href="#input0">input</a></code> element's <code
+ title=attr-input-type><a href="#type14">type</a></code> attribute is in
+ the <a href="#url2" title=attr-input-type-url>URL</a> state, the following
+ common <code><a href="#input0">input</a></code> element content
+ attributes, DOM attributes, and methods apply to the element: <code
+ title=attr-input-autocomplete><a
+ href="#autocomplete0">autocomplete</a></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><a href="#readonly0">readonly</a></code>, <code
+ title=attr-input-required>required</code>, and <code
+ title=attr-input-size>size</code> content attributes; <code
+ title=dom-input-list><a href="#list">list</a></code>, and <code
+ title=dom-input-selectedOption><a
+ href="#selectedoption">selectedOption</a></code> DOM attributes.
+
+ <p>When an <code><a href="#input0">input</a></code> element's <code
+ title=attr-input-type><a href="#type14">type</a></code> attribute is in
+ the <a href="#url2" title=attr-input-type-url>URL</a> state, the following
+ content attributes must not be specified and do not apply to the element:
+ <code class=no-backref title=attr-input-accept><a
+ href="#accept0">accept</a></code>, <code class=no-backref
+ title=attr-input-alt>alt</code>, <code class=no-backref
+ title=attr-input-checked>checked</code>, <code class=no-backref
+ title=attr-input-max>max</code>, <code class=no-backref
+ title=attr-input-min>min</code>, <code class=no-backref
+ title=attr-input-src>src</code>, <code class=no-backref
+ title=attr-input-step>step</code>, <code class=no-backref
+ title=attr-fs-target><a href="#target3">target</a></code>, <code
+ class=no-backref title=attr-fs-method><a href="#method">method</a></code>,
+ <code class=no-backref title=attr-fs-enctype><a
+ href="#enctype">enctype</a></code>, and <code class=no-backref
+ title=attr-fs-action><a href="#action">action</a></code>.
+
+ <p>When an <code><a href="#input0">input</a></code> element's <code
+ title=attr-input-type><a href="#type14">type</a></code> attribute is in
+ the <a href="#url2" title=attr-input-type-url>URL</a> state, the following
+ DOM attributes and methods do not apply to the element: <code
+ class=no-backref title=dom-input-checked><a
+ href="#checked1">checked</a></code>, <code class=no-backref
+ title=dom-input-valueAsDate><a href="#valueasdate">valueAsDate</a></code>,
+ <code class=no-backref title=dom-input-valueAsNumber><a
+ href="#valueasnumber">valueAsNumber</a></code>, <code class=no-backref
+ title=dom-input-stepUp><a href="#stepup">stepUp()</a></code>, and <code
+ class=no-backref title=dom-input-stepDown><a
+ href="#stepdown">stepDown()</a></code>.
<h6 id=date-and><span class=secno>4.10.4.1.5. </span><dfn id=date-and0
title=attr-input-type-datetime>Date and Time</dfn> state</h6>
@@ -30257,9 +30352,13 @@ rel="" on submit buttons?
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>The autocompletion mechanism must be implemented by the user agent
+ acting as if the user had modified the element's <span
+ title=concept-input-value>value</span>, and must be done at a time where
+ the element is <i title=concept-input-mutable><a
+ href="#mutable">mutable</a></i> (e.g. just after the element has been
+ inserted into the document, or when the user agent <span>stops
+ parsing</span>).
<div class=example>
<p>Banks frequently do not want UAs to prefill login information:</p>
View
110 source
@@ -26085,6 +26085,12 @@ function AddCloud(data, x, y) { ... }</pre>
title="concept-fe-disabled">disabled</span>, it is <i
title="concept-input-immutable">immutable</i>.</p>
+ <p>When an <code>input</code> element does not have a
+ <code>Document</code> node as one of its ancestors (i.e. when it is
+ not in the document), it is <i
+ title="concept-input-immutable">immutable</i>.</p> <!-- XXX how does
+ this affect shadow trees in XBL2? -->
+
<p class="note">The <code
title="attr-input-readonly">readonly</code> attribute can also make
an <code>input</code> element <i
@@ -26195,8 +26201,6 @@ function AddCloud(data, x, y) { ... }</pre>
follows:</strong> <span>Strip line breaks from the
value</span>.</p>
- <!-- XXX autocomplete? -->
-
<p><strong>The <span title="attr-input-type-text">Text</span>
state's <span>default value change algorithm</span> is as
follows:</strong> If the <code>input</code> element is not <i
@@ -26375,8 +26379,6 @@ function AddCloud(data, x, y) { ... }</pre>
follows:</strong> <span>Strip line breaks from the
value</span>.</p>
- <!-- XXX autocomplete? -->
-
<p><strong>The <span title="attr-input-type-email">E-mail</span>
state's <span>default value change algorithm</span> is as
follows:</strong> If the <code>input</code> element is not <i
@@ -26397,7 +26399,8 @@ function AddCloud(data, x, y) { ... }</pre>
excluding the <code>CFWS</code> subtoken everywhere, and excluding
the <code>FWS</code> subtoken everywhere except in the
<code>quoted-string</code> subtoken, the element is <span>suffering
- from a type mismatch</span>. <a href="#refsRFC2822">[RFC2822]</a>
+ from a type mismatch</span>. <a
+ href="#refsRFC2822">[RFC2822]</a></p>
<p>When an <code>input</code> element's <code
title="attr-input-type">type</code> attribute is in the <span
@@ -26449,7 +26452,91 @@ function AddCloud(data, x, y) { ... }</pre>
attribute has the value <code title="attr-input-type-url-keyword">url</code>,
it is in the <span title="attr-input-type-url">URL</span> state.</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-url">URL</span> state, the element represents
+ a control for editing a single <span>URL</span> given in the
+ element's <span title="concept-fe-value">value</span>.</p>
+
+ <p>If an <code>input</code> element whose <code
+ title="attr-input-type">type</code> attribute is in the <span
+ title="attr-input-type-url">URL</span> state is <i
+ title="concept-input-mutable">mutable</i>, the user should allow the
+ user to change the URL represented by its <span
+ title="concept-fe-value">value</span>. User agents may allow the
+ user to set the <span title="concept-fe-value">value</span> to a
+ string that is not a URL. User agents should allow the user to set
+ the <span title="concept-fe-value">value</span> to the empty
+ string. User agents must not allow users to insert U+000A LINE FEED
+ (LF) or U+000D CARRIAGE RETURN (CR) characters into the <span
+ title="concept-fe-value">value</span> of such <code>input</code>
+ elements.</p>
+
+ <p><strong>The <span title="attr-input-type-url">URL</span>
+ state's <span>control initialization algorithm</span> is as
+ follows:</strong> <span>Strip line breaks from the
+ value</span>.</p>
+
+ <p><strong>The <span title="attr-input-type-url">URL</span>
+ state's <span>default value change algorithm</span> is as
+ follows:</strong> If the <code>input</code> element is not <i
+ title="concept-input-dirty">dirty</i> then set the <span
+ title="concept-fe-value">value</span> of the element to the value of
+ the <code title="attr-input-value">value</code> content attribute
+ and <span>strip line breaks from the value</span>.</p>
+
+ <p><strong>The <span title="attr-input-type-url">URL</span>
+ state's <span><code title="dom-input-value">value</code> setter
+ algorithm</span> is as follows:</strong> Set the <span
+ title="concept-fe-value">value</span> of the element to the new
+ value and <span>strip line breaks from the value</span>.</p>
+
+ <p><strong>Constraint validation:</strong> While the <span
+ title="concept-fe-value">value</span> of the element is not a
+ <span>valid URL</span>, the element is <span>suffering from a type
+ mismatch</span>.</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-url">URL</span> state, the following common
+ <code>input</code> element content attributes, DOM attributes, and
+ methods apply to the element:
+ <code title="attr-input-autocomplete">autocomplete</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>, and
+ <code title="attr-input-size">size</code> content attributes;
+ <code title="dom-input-list">list</code>, and
+ <code title="dom-input-selectedOption">selectedOption</code> DOM attributes.
+
+ <p>When an <code>input</code> element's <code
+ title="attr-input-type">type</code> attribute is in the <span
+ title="attr-input-type-url">URL</span> state, the following
+ content attributes must not be specified and do not apply to the
+ element:
+ <code class="no-backref" title="attr-input-accept">accept</code>,
+ <code class="no-backref" title="attr-input-alt">alt</code>,
+ <code class="no-backref" title="attr-input-checked">checked</code>,
+ <code class="no-backref" title="attr-input-max">max</code>,
+ <code class="no-backref" title="attr-input-min">min</code>,
+ <code class="no-backref" title="attr-input-src">src</code>,
+ <code class="no-backref" title="attr-input-step">step</code>,
+ <code class="no-backref" title="attr-fs-target">target</code>,
+ <code class="no-backref" title="attr-fs-method">method</code>,
+ <code class="no-backref" title="attr-fs-enctype">enctype</code>, and
+ <code class="no-backref" title="attr-fs-action">action</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-url">URL</span> state, the following DOM
+ attributes and methods do not apply to the element:
+ <code class="no-backref" title="dom-input-checked">checked</code>,
+ <code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code>,
+ <code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code>,
+ <code class="no-backref" title="dom-input-stepUp">stepUp()</code>, and
+ <code class="no-backref" title="dom-input-stepDown">stepDown()</code>.</p>
@@ -26733,10 +26820,12 @@ rel="" on submit buttons?
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>
+ <p>The autocompletion mechanism must be implemented by the user
+ agent acting as if the user had modified the element's <span
+ title="concept-input-value">value</span>, and must be done at a time
+ where the element is <i title="concept-input-mutable">mutable</i>
+ (e.g. just after the element has been inserted into the document, or
+ when the user agent <span>stops parsing</span>).</p>
<div class="example">
@@ -26761,6 +26850,7 @@ rel="" on submit buttons?
disabled.</p>
+
<h6>The <code title="attr-input-readonly">readonly</code> attribute</h6>
<p>The <dfn title="attr-input-readonly"><code>readonly</code></dfn>

0 comments on commit 5a2e2dd

Please sign in to comment.