Short URL: http://html5.org/r/2274
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 2274 | WF2: <input type=file> and some editorial fallout. | 2008-10-03 07:32 |
Index: source
===================================================================
--- source (revision 2273)
+++ source (revision 2274)
@@ -25591,7 +25591,7 @@
<td> A radio button
<tr>
<td> <dfn title="attr-input-type-file-keyword"><code>file</code></dfn>
- <td> <span title="attr-input-type-file">File</span>
+ <td> <span title="attr-input-type-file">File Upload</span>
<td> Zero or more files each with a MIME type and optionally a file name
<td> A label and a button
<tr>
@@ -25669,7 +25669,7 @@
<th> <span><span title="attr-input-type-range">Range</span></span>
<th> <span><span title="attr-input-type-checkbox">Checkbox</span>,</span>
<span><span title="attr-input-type-radio">Radio Button</span></span>
- <th> <span><span title="attr-input-type-file">File</span></span>
+ <th> <span><span title="attr-input-type-file">File Upload</span></span>
<th> <span><span title="attr-input-type-submit">Submit Button</span></span>
<th> <span><span title="attr-input-type-image">Image Button</span></span>
<th> <span><span title="attr-input-type-reset">Reset Button</span>,</span>
@@ -26280,9 +26280,9 @@
title="attr-input-type">type</code> attribute changes state, and
when the element is first created, the element's rendering and
behaviour must change to the new state's accordingly and the
- <dfn>value sanitization algorithm</dfn> defined for the <code
- title="attr-input-type">type</code> attribute's new state must be
- invoked.</p>
+ <dfn>value sanitization algorithm</dfn>, if one is defined for the
+ <code title="attr-input-type">type</code> attribute's new state,
+ must be invoked.</p>
<p>Each <code>input</code> element has a <span
title="concept-fe-value">value</span>, which is exposed by the <code
@@ -26321,8 +26321,8 @@
user agent must 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, if there is
- one, or the empty string otherwise, and run the <span>value
- sanitization algorithm</span>.</p>
+ one, or the empty string otherwise, and then run the current
+ <span>value sanitization algorithm</span>, if one is defined.</p>
<p>Each <code>input</code> element has a <span
title="concept-fe-checked">checkedness</span>, which is exposed by
@@ -26367,8 +26367,9 @@
title="concept-fe-checked">checkedness</span> of the element to true
if the element has a <code title="attr-input-checked">checked</code>
content attribute and false if it does not, and then invoke the
- <span>value sanitization algorithm</span> defined for the <code
- title="attr-input-type">type</code> attribute's current state.</p>
+ <span>value sanitization algorithm</span>, if the <code
+ title="attr-input-type">type</code> attribute's current state
+ defines one.</p>
<p>Each <code>input</code> element has a boolean <dfn
title="concept-input-mutability">mutability flag</dfn>. When it is
@@ -26470,9 +26471,6 @@
the <span title="attr-input-type-hidden">Hidden</span> state, it is
<span>barred from constraint validation</span>.</p>
- <p><strong>The <span>value sanitization algorithm</span> is as
- follows:</strong> Do nothing.</p>
-
<p>If the <code title="attr-input-value">name</code> attribute is
present and has a value that is a <span>case-sensitive</span> match
for the string "<code title="">_charset_</code>", then the element's
@@ -27806,9 +27804,6 @@
<!-- XXX event timing; activation behavior -->
- <p><strong>The <span>value sanitization algorithm</span> is as
- follows:</strong> Do nothing.</p>
-
<p>The following common <code>input</code> element content
attributes and DOM attributes apply to the element:
<code title="attr-input-checked">checked</code>, and
@@ -27926,9 +27921,6 @@
<!-- XXX event timing; activation behavior -->
- <p><strong>The <span>value sanitization algorithm</span> is as
- follows:</strong> Do nothing.</p>
-
<p>The following common <code>input</code> element content
attributes and DOM attributes apply to the element:
<code title="attr-input-checked">checked</code> and
@@ -27969,18 +27961,35 @@
- <h6><dfn title="attr-input-type-file">File</dfn> state</h6>
+ <h6><dfn title="attr-input-type-file">File Upload</dfn> state</h6>
<p>When an <code>input</code> element's <code
title="attr-input-type">type</code> attribute is in the <span
- title="attr-input-type-file">File</span> state, the rules in this
+ title="attr-input-type-file">File Upload</span> state, the rules in this
section apply.</p>
- <p class="XXX">...</p>
+ <p>The <code>input</code> element represents a list of <dfn
+ title="concept-input-type-file-selected">selected files</dfn>, each
+ file consisting of a file name, a file type, and a file body (the
+ contents of the file).</p>
- <p>The element's <code title="attr-input-value">value</code>
- attribute must be omitted.</p>
+ <p>If the element is <i title="concept-input-mutable">mutable</i>,
+ the user should allow the user to change the files on the list,
+ e.g. adding or removing files. Files can be from the filesystem or
+ created on the fly, e.g. a picture taken from a camera connected to
+ the user's device.</p>
+ <p><strong>Constraint validation:</strong> If the element is <i
+ title="concept-input-required">required</i> and the list of <span
+ title="concept-input-type-file-selected">selected files</span> is
+ empty, then the element is <span>suffering from being
+ missing</span>.</p>
+
+ <p>There must be no more than one file in the list of <span
+ title="concept-input-type-file-selected">selected files</span>.</p>
+
+ <hr>
+
<p>The <dfn title="attr-input-accept"><code>accept</code></dfn>
attribute may be specified to provide user agents with a hint of
what file types the server will be able to accept.</p>
@@ -28009,22 +28018,52 @@
</dl>
- <p>The values must not be <span>ASCII case-insensitive</span>
- matches for any of the other values (i.e. duplicates are not
+ <p>The tokens must not be <span>ASCII case-insensitive</span>
+ matches for any of the other tokens (i.e. duplicates are not
allowed).</p>
- <!-- XXX the selected file(s) must either have the given types or be of the given category -->
+ <p>User agents should prevent the user from selecting files that are
+ not accepted by one (or more) of these tokens.</p>
- <p class="XXX">... list of <dfn title="concept-input-type-file-selected">selected files</dfn></p>
+ <hr>
- <p><strong>Constraint validation:</strong> If the element is <i
- title="concept-input-required">required</i> and the list of <span
- title="concept-input-type-file-selected">selected files</span> is
- empty, then the element is <span>suffering from being
- missing</span>.</p>
+ <p>The following common <code>input</code> element content
+ attributes apply to the element:
+ <code title="attr-input-accept">accept</code> and
+ <code title="attr-input-required">required</code>.</p>
+ <p>The following content attributes must not be specified and do not
+ apply to the element:
+ <code class="no-backref" title="attr-fs-action">action</code>,
+ <code class="no-backref" title="attr-input-alt">alt</code>,
+ <code class="no-backref" title="attr-input-autocomplete">autocomplete</code>,
+ <code class="no-backref" title="attr-input-checked">checked</code>,
+ <code class="no-backref" title="attr-fs-enctype">enctype</code>,
+ <code class="no-backref" title="attr-input-list">list</code>,
+ <code class="no-backref" title="attr-input-max">max</code>,
+ <code class="no-backref" title="attr-input-maxlength">maxlength</code>,
+ <code class="no-backref" title="attr-fs-method">method</code>,
+ <code class="no-backref" title="attr-input-min">min</code>,
+ <code class="no-backref" title="attr-input-pattern">pattern</code>,
+ <code class="no-backref" title="attr-input-readonly">readonly</code>,
+ <code class="no-backref" title="attr-input-size">size</code>,
+ <code class="no-backref" title="attr-input-src">src</code>,
+ <code class="no-backref" title="attr-input-step">step</code>, and
+ <code class="no-backref" title="attr-fs-target">target</code>.</p>
+ <p>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-list">list</code>,
+ <code class="no-backref" title="dom-input-selectedOption">selectedOption</code>,
+ <code class="no-backref" title="dom-input-value">value</code>,
+ <code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code> and
+ <code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code> DOM attributes;
+ <code class="no-backref" title="dom-input-stepDown">stepDown()</code> and
+ <code class="no-backref" title="dom-input-stepUp">stepUp()</code> methods.</p>
+
+
+
<h6><dfn title="attr-input-type-submit">Submit Button</dfn> state</h6>
<p>When an <code>input</code> element's <code
@@ -28048,9 +28087,6 @@
title="concept-form-submit">submit</span> the <span>form
owner</span> from the <code>input</code> element.</p>
- <p><strong>The <span>value sanitization algorithm</span> is as
- follows:</strong> Do nothing.</p>
-
<p>The following common <code>input</code> element content
attributes and DOM attributes apply to the element:
<code title="attr-fs-action">action</code>,
@@ -28133,9 +28169,6 @@
title="concept-form-reset">reset</span> the <span>form
owner</span>.</p>
- <p><strong>The <span>value sanitization algorithm</span> is as
- follows:</strong> Do nothing.</p>
-
<p><strong>Constraint validation:</strong> The element is
<span>barred from constraint validation</span>.</p>
@@ -28193,9 +28226,6 @@
<!-- XXX event timing; activation behavior -->
- <p><strong>The <span>value sanitization algorithm</span> is as
- follows:</strong> Do nothing.</p>
-
<p><strong>Constraint validation:</strong> The element is
<span>barred from constraint validation</span>.</p>
@@ -28585,8 +28615,9 @@
title="concept-fe-value">value</span> to the new value, set the
element's <span title="concept-input-value-dirty-flag">dirty value
flag</span> to true, and then invoke the <span>value sanitization
- algorithm</span> defined for the element's <code
- title="attr-input-type">type</code> attribute's current state.</dd>
+ algorithm</span>, if the element's <code
+ title="attr-input-type">type</code> attribute's current state
+ defines one.</dd>
<dt><dfn title="dom-input-value-default">default</dfn>
@@ -29372,7 +29403,7 @@
<code>form</code> elements and on elements that represent buttons
that submit forms, e.g. an <code>input</code> element whose <code
title="attr-input-type">type</code> attribute is in the <span
- title="attr-input-type-submit-state">Submit Button</span> state. The
+ title="attr-input-type-submit">Submit Button</span> state. The
attributes on the buttons, when omitted, default to the values given
on the corresponding the <code>form</code> element.</p>
@@ -29621,7 +29652,7 @@
<li>The <var title="">field</var> element is an
<code>input</code> element whose <code
title="attr-input-type">type</code> attribute is in the <span
- title="attr-input-type-file-state">File Upload</span> state but
+ title="attr-input-type-file">File Upload</span> state but
the control does not have any files selected.</li>
</ul>
@@ -29635,7 +29666,7 @@
<p>If the <var title="">field</var> element is an
<code>input</code> element whose <code
title="attr-input-type">type</code> attribute is in the <span
- title="attr-input-type-image-state">Image Button</span> state,
+ title="attr-input-type-image">Image Button</span> state,
then run these further nested substeps:</p>
<ol>
@@ -29735,13 +29766,13 @@
<li><p>Otherwise, if the <var title="">field</var> element is an
<code>input</code> element whose <code
title="attr-input-type">type</code> attribute is in the <span
- title="attr-input-type-file-state">File Upload</span> state, then
- for each file <span
+ title="attr-input-type-file">File Upload</span> state, then for
+ each file <span
title="concept-input-type-file-selected">selected</span> in the
<code>input</code> element, append an entry in the <var
title="">form data set</var> with the <var title="">name</var> as
- the name and the file as the value. (Both the file name and the
- file contents are subsequently used.)</p></li>
+ the name and the file (consisting of the name, the type, and the
+ body) as the value.</p></li>
<li><p>Otherwise, append an entry in the <var title="">form data
set</var> with <var title="">name</var> as the name and the <span