spec/Overview.html 1.1399 2226 WF2: define the syntax of <input type=fi

WF2: define the syntax of <input type=file accept='...'> (whatwg r2226)

2.4.9 References
split a string on commas
2.4.6 Space-separated tokens
selected files
set of comma-separated tokens
remove a token from a string
2.4.8 Keywords and enumerated attributes
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1399.html#keywords Password state
valid hash-name reference
2.4.7 Comma-separated tokens
rules for parsing time offsets
set of space-separated tokens
enumerated attributes
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1399.html#enumerated Hidden state
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1399.html#hidden Text state
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1399.html#text-state File state


RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1398
retrieving revision 1.1399
diff -u -d -r1.1398 -r1.1399
--- Overview.html 23 Sep 2008 00:13:26 -0000 1.1398
+++ Overview.html 24 Sep 2008 01:52:53 -0000 1.1399
@@ -27,7 +27,7 @@
     for HTML and XHTML</h2>
    <h2 class="no-num no-toc" id=editors0><!-- "W3C Working Draft" -->
-    Editor's Draft <!--ZZZ-->23 September 2008</h2>
+    Editor's Draft <!--ZZZ-->24 September 2008</h2>
    <dl><!-- ZZZ: update the month/day
     <dt>This Version:</dt>
@@ -199,7 +199,7 @@
   <p>The W3C <a href="http://www.w3.org/html/wg/">HTML Working Group</a> is
    the W3C working group responsible for this specification's progress along
-   the W3C Recommendation track. <!--ZZZ:--> This specification is the 23
+   the W3C Recommendation track. <!--ZZZ:--> This specification is the 24
    September 2008 <!--ZZZ "Working Draft"-->Editor's Draft. <!--:ZZZ--></p>
   <!-- relationship to other work (required) -->
@@ -360,12 +360,16 @@
        <li><a href="#time-offsets"><span class=secno>2.4.5 </span>Time
-       <li><a href="#tokens"><span class=secno>2.4.6 </span>Tokens</a>
+       <li><a href="#space-separated"><span class=secno>2.4.6
+        </span>Space-separated tokens</a>
-       <li><a href="#keywords"><span class=secno>2.4.7 </span>Keywords and
+       <li><a href="#comma-separated"><span class=secno>2.4.7
+        </span>Comma-separated tokens</a>
+       <li><a href="#keywords"><span class=secno>2.4.8 </span>Keywords and
         enumerated attributes</a>
-       <li><a href="#syntax-references"><span class=secno>2.4.8
+       <li><a href="#syntax-references"><span class=secno>2.4.9
@@ -4737,7 +4741,8 @@
    offset serialization rules</dfn>; in the format "5d4h3m2s1ms" or "3m 9.2s"
    or "00:00:00.00" or similar.
-  <h4 id=tokens><span class=secno>2.4.6 </span>Tokens</h4>
+  <h4 id=space-separated><span class=secno>2.4.6 </span>Space-separated
+   tokens</h4>
   <p>A <dfn id=set-of>set of space-separated tokens</dfn> is a set of zero or
    more words separated by one or more <a href="#space" title="space
@@ -4881,7 +4886,61 @@
    to a single space, except at the start and end of the string, where such
    spaces are removed.
-  <h4 id=keywords><span class=secno>2.4.7 </span>Keywords and enumerated
+  <h4 id=comma-separated><span class=secno>2.4.7 </span>Comma-separated
+   tokens</h4>
+  <p>A <dfn id=set-of0>set of comma-separated tokens</dfn> is a set of zero
+   or more tokens each separated from the next by a single U+002C COMMA
+   character (<code title="">,</code>), where tokens consist of any string of
+   zero or more characters, none of which are U+002C COMMA characters (<code
+   title="">,</code>).
+  <p><a href="#set-of0" title="set of comma-separated tokens">Sets of
+   comma-separated tokens</a> sometimes have further restrictions on what
+   consists a valid token. When such restrictions are defined, the tokens
+   must all fit within those restrictions; other values are non-conforming.
+   If no such restrictions are specified, then all values are conforming.
+  <p>When a user agent has to <dfn id=split0>split a string on commas</dfn>,
+   it must use the following algorithm:
+  <ol>
+   <li>
+    <p>Let <var title="">input</var> be the string being parsed.
+   <li>
+    <p>Let <var title="">position</var> be a pointer into <var
+     title="">input</var>, initially pointing at the start of the string.
+   <li>
+    <p>Let <var title="">tokens</var> be a list of tokens, initially empty.
+   <li>
+    <p><i>Token</i>: If <var title="">position</var> is past the end of <var
+     title="">input</var>, jump to the last step.
+   <li>
+    <p><a href="#collect">Collect a sequence of characters</a> that are not
+     U+002C COMMA characters (<code title="">,</code>).
+   <li>
+    <p>Add the string collected in the previous step (which might be the
+     empty string) to <var title="">tokens</var>.
+   <li>
+    <p>If <var title="">position</var> is not past the end of <var
+     title="">input</var>, then the character at <var title="">position</var>
+     is a U+002C COMMA character (<code title="">,</code>); advance <var
+     title="">position</var> past that character.
+   <li>
+    <p>Jump back to the step labeled <i>token</i>.
+   <li>
+    <p>Return <var title="">tokens</var>.
+  </ol>
+  <h4 id=keywords><span class=secno>2.4.8 </span>Keywords and enumerated
   <p>Some attributes are defined as taking one of a finite set of keywords.
@@ -4925,7 +4984,7 @@
    value default</i>), but for various reasons that isn't the way this
    specification actually defines it.
-  <h4 id=syntax-references><span class=secno>2.4.8 </span>References</h4>
+  <h4 id=syntax-references><span class=secno>2.4.9 </span>References</h4>
   <p>A <dfn id=valid7>valid hash-name reference</dfn> to an element of type
    <var title="">type</var> is a string consisting of a U+0023 NUMBER SIGN
@@ -27976,7 +28035,7 @@
    <dt>Element-specific attributes:
-   <dd><code title=attr-input-accept>accept</code>
+   <dd><code title=attr-input-accept><a href="#accept0">accept</a></code>
    <dd><code title=attr-fs-action><a href="#action">action</a></code>
@@ -28314,9 +28373,10 @@
   <p>The <i>missing value default</i> is the <a href="#text3"
    title=attr-input-type-text>Text</a> state.
-  <p>Which of the <code title=attr-input-accept>accept</code>, <code
-   title=attr-fs-action><a href="#action">action</a></code>, <code
-   title=attr-input-alt>alt</code>, <code title=attr-input-autocomplete><a
+  <p>Which of the <code title=attr-input-accept><a
+   href="#accept0">accept</a></code>, <code title=attr-fs-action><a
+   href="#action">action</a></code>, <code title=attr-input-alt>alt</code>,
+   <code title=attr-input-autocomplete><a
    href="#autocomplete0">autocomplete</a></code>, <code
    title=attr-input-checked>checked</code>, <code title=attr-fs-enctype><a
    href="#enctype">enctype</a></code>, and <code
@@ -28394,8 +28454,9 @@
      <th> <a href="#button1" title=attr-input-type-button>Button</a>
-    <tr>
-     <th> <code title=attr-input-accept>accept</code>
+    <tr><!-- complete -->
+     <th> <code title=attr-input-accept><a href="#accept0">accept</a></code>
      <td class=no> &middot; <!-- Text -->
@@ -28425,7 +28486,7 @@
      <td class=no> &middot; <!-- Radio Button -->
-     <td class=no> &middot; <!-- File -->
+     <td class=yes> Yes <!-- File -->
      <td class=no> &middot; <!-- Hidden -->
@@ -29663,10 +29724,11 @@
    title=attr-input-type><a href="#type14">type</a></code> attribute is in
    the <a href="#text3" title=attr-input-type-text>Text</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>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
+   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
@@ -29755,8 +29817,8 @@
    title=attr-input-type><a href="#type14">type</a></code> attribute is in
    the <a href="#password1" title=attr-input-type-password>Password</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>accept</code>, <code class=no-backref
+   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-list>list</code>, <code class=no-backref
@@ -29936,8 +29998,39 @@
   <p class=big-issue>...
-  <p class=big-issue>... <dfn id=selected
-   title=concept-input-type-file-selected>selected file</dfn>
+  <p>The <dfn id=accept0 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>If specified, the attribute must consist of a <a href="#set-of0">set of
+   comma-separated tokens</a>, each of which must be an <a
+   href="#ascii">ASCII case-insensitive</a> match for one of the following:
+  <dl>
+   <dt>The string <code title="">audio</code>
+   <dd>Indicates that sound files are accepted.
+   <dt>The string <code title="">video</code>
+   <dd>Indicates that video files are accepted.
+   <dt>The string <code title="">image</code>
+   <dd>Indicates that image files are accepted.
+   <dt>A valid MIME type, with no parameters
+   <dd>Indicates that files of the specified type are accepted. <a
+    href="#references">RFC[2046]</a>
+  </dl>
+  <p>The values must not be <a href="#ascii">ASCII case-insensitive</a>
+   matches for any of the other values (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 class=big-issue>... list of <dfn id=selected
+   title=concept-input-type-file-selected>selected files</dfn>
   <h6 id=hidden><span class=secno> </span><dfn id=hidden1
    title=attr-input-type-hidden>Hidden</dfn> state</h6>
@@ -60937,4 +61030,8 @@
  XXX * make the text consistent about whether it is ":<em>" and
        ":<strong>" or "</em>:" and "</strong>:". Same for other
+ XXX * take references to "valid mime type" / RFC2046 and make them
+       mean something. (2046 doesn't define anything like that, and
+       2045's definition doesn't really help either, since it's part
+       of something else, and doesn't mention whitespace, etc.)

Received on Wednesday, 24 September 2008 01:57:18 UTC