HTML5 Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/6596

SVNBugCommentTime (UTC)
659613060[Gecko] [Internet Explorer] [Opera] [Webkit] Specify multipart/x-mixed-replace2011-09-29 00:21
Index: source
===================================================================
--- source	(revision 6595)
+++ source	(revision 6596)
@@ -23758,61 +23758,81 @@
     attack, but unfortunately such policies are typically not
     compatible with existing Web content.</p>
 
-   </li>
+    <p>The first <span title="concept-task">task</span> that is <span
+    title="queue a task">queued</span> by the <span>networking task
+    source</span> while the image is being <span
+    title="fetch">fetched</span> must set the <code>img</code> element's
+    state to <span title="img-inc">partially available</span>.</p>
 
-  </ol>
+    <p id="img-load">If the resource is in a supported image format,
+    then each <span title="concept-task">task</span> that is <span
+    title="queue a task">queued</span> by the <span>networking task
+    source</span> while the image is being <span
+    title="fetch">fetched</span> must update the presentation of the
+    image appropriately (e.g. if the image is a progressive JPEG, each
+    packet can improve the resolution of the image); furthermore, the
+    last <span title="concept-task">task</span> that is <span
+    title="queue a task">queued</span> by the <span>networking task
+    source</span> once the resource has been <span
+    title="fetch">fetched</span> must act as appropriate given the
+    following alternatives:</p>
 
-  <p>Each <span title="concept-task">task</span> that is <span
-  title="queue a task">queued</span> by the <span>networking task
-  source</span> while the image is being <span
-  title="fetch">fetched</span> must set the <code>img</code> element's
-  state to <span title="img-inc">partially available</span> and update
-  the presentation of the image appropriately.</p>
+    <dl class="switch">
 
-  <p id="img-load">The <span title="concept-task">task</span> that is
-  <span title="queue a task">queued</span> by the <span>networking
-  task source</span> once the resource has been <span
-  title="fetch">fetched</span> must act as appropriate given the
-  following alternatives:</p>
+     <dt>If the download was successful</dt>
 
-  <dl class="switch">
+     <dd>Set the <code>img</code> element to the <span
+     title="img-all">completely available</span> state, update the
+     presentation of the image appropriately, and <span>queue a
+     task</span> to <span>fire a simple event</span> named <code
+     title="event-load">load</code> at the <code>img</code>
+     element.</dd>
 
-   <dt>If the download was successful</dt>
+     <dt>Otherwise</dt>
 
-   <dd>Set the <code>img</code> element to the <span
-   title="img-all">completely available</span> state, update the
-   presentation of the image appropriately, and <span>queue a
-   task</span> to <span>fire a simple event</span> named <code
-   title="event-load">load</code> at the <code>img</code>
-   element.</dd>
+     <dd>Set the <code>img</code> element to the <span
+     title="img-error">broken</span> state, and <span>queue a
+     task</span> to <span>fire a simple event</span> named <code
+     title="event-error">error</code> at the <code>img</code>
+     element.</dd>
 
-   <dt>Otherwise</dt>
+    </dl>
 
-   <dd>Set the <code>img</code> element to the <span
-   title="img-error">broken</span> state, and <span>queue a
-   task</span> to <span>fire a simple event</span> named <code
-   title="event-error">error</code> at the <code>img</code>
-   element.</dd>
+    <p>On the other hand, if the resource type is
+    <code>multipart/x-mixed-replace</code>, then each <span
+    title="concept-task">task</span> that is <span title="queue a
+    task">queued</span> by the <span>networking task source</span>
+    while the image is being <span title="fetch">fetched</span> must
+    also update the presentation of the image, but as each new body
+    part comes in, it must replace the previous image. Once one body
+    part has been completely decoded, the user agent must set the
+    <code>img</code> element to the <span title="img-all">completely
+    available</span> state and <span>queue a task</span> to <span>fire
+    a simple event</span> named <code title="event-load">load</code>
+    at the <code>img</code> element.</p>
 
-  </dl>
+    <p>If at any point the user agent discovers that the image data is
+    corrupted in some fatal way, or that the image data is not in a
+    supported file format, then the user agent must set the
+    <code>img</code> element to the <span
+    title="img-error">broken</span> state. If the <span
+    title="fetch">fetching</span> algorithm is still running for this
+    element, then the user agent must also abort that algorithm,
+    discarding any pending <span title="concept-task">tasks</span>
+    generated by that algorithm, and then <span>queue a task</span> to
+    <span>fire a simple event</span> named <code
+    title="event-error">error</code> at the <code>img</code>
+    element.</p>
 
-  <p>If at any point the user agent discovers that the image data is
-  corrupted in some fatal way, or that the image is not in a supported
-  file format, then the user agent must set the <code>img</code>
-  element to the <span title="img-error">broken</span> state. If the
-  <span title="fetch">fetching</span> algorithm is still running for
-  this element, then the user agent must also abort that algorithm,
-  discarding any pending <span title="concept-task">tasks</span>
-  generated by that algorithm, and then <span>queue a task</span> to
-  <span>fire a simple event</span> named <code
-  title="event-error">error</code> at the <code>img</code>
-  element.</p>
+   </li>
 
+  </ol>
+
   <p>When an <code>img</code> element is in the <span
   title="img-all">completely available</span> state <em>and</em> the
-  user agent can completely decode the media data without errors, then
-  the <code>img</code> element is said to be <dfn
-  title="img-good">fully decodable</dfn>.</p>
+  user agent can decode the media data without errors, then the
+  <code>img</code> element is said to be <dfn title="img-good">fully
+  decodable</dfn>.</p>
 
   <p>Whether the image is fetched successfully or not (e.g. whether
   the response code was a 2xx code <span
@@ -70964,6 +70984,7 @@
   context</span> and its <span title="script's
   document">document</span>.</p>
 
+  <!-- discard a document -->
   <p>When a <span>browsing context</span> is to <dfn>discard a
   <code>Document</code></dfn>, the user agent must run the following
   steps:</p>
@@ -70978,6 +70999,9 @@
    the <code>Document</code> that are defined by this specification
    and <span>other applicable specifications</span>.</p></li>
 
+   <li><p><span title="abort a document">Abort the
+   <code>Document</code></span>.</p></li>
+
    <li><p>Remove any <span title="concept-task">tasks</span>
    associated with the <code>Document</code> in any <span>task
    source</span>, without running those tasks.</p></li>
@@ -72974,7 +72998,13 @@
    and abort these steps.</p></li>
 
    <li><p>Cancel <em>any</em> preexisting attempt to navigate the
-   <span>browsing context</span>.</p></li>
+   <span>browsing context</span>, including canceling any instances of
+   the <span>fetch</span> algorithm started by those attempts. If one
+   of those attempts has already <span title="create a document
+   object">created a new <code>Document</code> object</span>, <span
+   title="abort a document">Abort</span> that <code>Document</code>
+   also. (Previous navigation attempts whose <span>fetch</span>
+   requests have <em>finished</em> are unaffected, however.)</p></li>
 
    <li><p>If the new resource is to be handled using a mechanism that
    does not affect the browsing context, e.g. ignoring the navigation
@@ -73160,11 +73190,12 @@
 
    <li>
 
-    <p>If the document's out-of-band metadata (e.g. HTTP headers), not
-    counting any <span title="Content-Type">type information</span>
-    (such as the Content-Type HTTP header), requires some sort of
-    processing that will not affect the browsing context, then perform
-    that processing and abort these steps.</p>
+    <p><i>Resource handling</i>: If the resource's out-of-band
+    metadata (e.g. HTTP headers), not counting any <span
+    title="Content-Type">type information</span> (such as the
+    Content-Type HTTP header), requires some sort of processing that
+    will not affect the browsing context, then perform that processing
+    and abort these steps.</p>
 
     <div class="note">
      <p>Such processing might be triggered by, amongst other things, the
@@ -73243,6 +73274,11 @@
      title="navigate-text">plain text file</span> section, and abort
      these steps.</dd>
 
+     <dt>"<code>multipart/x-mixed-replace</code>"</dt>
+     <dd>Follow the steps given in the <span
+     title="navigate-multipart-x-mixed-replace">multipart/x-mixed-replace</span>
+     section, and abort these steps.</dd>
+
      <dt>A supported image type</dt>
      <dd>Follow the steps given in the <span
      title="navigate-image">image</span> section, and abort these
@@ -73314,9 +73350,10 @@
    </li>
 
    <li><p>Otherwise, the document's <var title="">type</var> is such
-   that the resource will not affect the browsing context,
-   e.g. because the resource is to be handed to an external
-   application. Process the resource appropriately.</p>
+   that the resource will not affect the browsing context, e.g.
+   because the resource is to be handed to an external application or
+   because it is an unknown type that will be processed <span>as a
+   download</span>. Process the resource appropriately.</p>
 
   </ol>
 
@@ -73615,6 +73652,33 @@
   section must be the <span>networking task source</span>.</p>
 
 
+  <h4 id="read-multipart-x-mixed-replace"><dfn title="navigate-multipart-x-mixed-replace">Page load processing model for <code>multipart/x-mixed-replaced</code> resources</dfn></h4>
+
+  <p>When a resource with the type
+  <code>multipart/x-mixed-replaced</code> is to be loaded in a
+  <span>browsing context</span>, the user agent must parse the
+  resource using the rules for multipart types. <a href="#refsRFC2046">[RFC2046]</a></p>
+
+  <p>For each body part obtained from the resource, the user agent
+  must run a new instance of the <span>navigate</span> algorithm,
+  starting from the <i>resource handling</i> step, using the new body
+  part as the resource being navigated, with <span>replacement
+  enabled</span> if a previous body part from the same resource
+  resulted in a <code>Document</code> object being <span title="create
+  a document object">created</span>, and otherwise using the same
+  setup as the <span>navigate</span> attempt that caused this section
+  to be invoked in the first place.</p>
+
+  <p>For the purposes of algorithms processing these body parts as if
+  they were complete stand-alone resources, the user agent must act as
+  if there were no more bytes for those resources whenever the
+  boundary following the body part is reached.</p>
+
+  <p class="note">Thus, <code title="event-load">load</code> events
+  (and for that matter <code title="event-unload">unload</code>
+  events) do fire for each body part loaded.</p>
+
+
   <h4 id="read-image"><dfn title="navigate-image">Page load processing model for images</dfn></h4>
 
   <p>When an image resource is to be loaded in a <span>browsing
@@ -74213,9 +74277,9 @@
 
   <div class="impl">
 
-  <p>A <code>Document</code> has a <var
-  title="concept-document-salvageable">salvageable</var> state, which
-  is initially true.</p>
+  <p>A <code>Document</code> has a <dfn
+  title="concept-document-salvageable"><var>salvageable</var></dfn>
+  state, which is initially true.</p>
 
   <p>When a user agent is to <dfn>prompt to unload a document</dfn>,
   it must run the following steps.</p>
@@ -74485,6 +74549,10 @@
    parser</span>, then <span title="abort a parser">abort that
    parser</span>.</p></li>
 
+   <li><p>Set the <code>Document</code>'s <var
+   title="concept-document-salvageable">salvageable</var> state to
+   false.</p></li>
+
    <!-- we could also stop all script, or stop animations -->
 
   </ol>
@@ -80095,6 +80163,7 @@
      <li><code>image/gif</code></li>
      <li><code>image/jpeg</code></li>
      <li><code>image/png</code></li>
+     <li><code>multipart/x-mixed-replace</code></li>
      <li>All <span title="XML MIME type">XML MIME types</span></li>
      <li>All types that the user agent supports displaying natively in a <span>browsing context</span> during <span title="navigate">navigation</span></li>
 
@@ -82402,13 +82471,13 @@
        </dd>
 
 <!-- DND-v3:
-       <dt><i>Blob</i></dt>
+       <dt><i title="">Blob</i></dt>
        <dd>
         <p>Binary data.</p>
        </dd>
 -->
 
-       <dt><i>File</i></dt>
+       <dt><i title="">File</i></dt>
        <dd>
         <p>Binary data with a file name.</p>
        </dd>
@@ -90730,7 +90799,7 @@
     </dl>
    </dd>
    <dt>Encoding considerations:</dt>
-   <dd>Always UTF-8.</dd>
+   <dd>8bit (always UTF-8)</dd>
    <dt>Security considerations:</dt>
    <dd>
 
@@ -109865,8 +109934,10 @@
     </dl>
    </dd>
    <dt>Encoding considerations:</dt>
-   <dd>See the section on <span title="character encoding
-   declaration">character encoding declarations</span>.</dd>
+   <dd>
+    8bit (see the section on <span title="character encoding
+    declaration">character encoding declarations</span>)
+   </dd>
    <dt>Security considerations:</dt>
    <dd>
 
@@ -110048,6 +110119,78 @@
   scripts.</p>
 
 
+  <h3><dfn><code>multipart/x-mixed-replace</code></dfn></h3>
+
+  <p>This registration is for community review and will be submitted
+  to the IESG for review, approval, and registration with IANA.</p>
+
+  <!--
+   To: ietf-types@iana.org
+   Subject: Registration of media type multipart/x-mixed-replace
+  -->
+
+  <dl>
+   <dt>Type name:</dt>
+   <dd>multipart</dd>
+   <dt>Subtype name:</dt>
+   <dd>x-mixed-replace</dd>
+   <dt>Required parameters:</dt>
+   <dd>
+    <ul class="brief">
+     <li><code title="">boundary</code> (defined in RFC2046) <a href="#refsRFC2046">[RFC2046]</a>
+    </ul>
+   </dd>
+   <dt>Optional parameters:</dt>
+   <dd>No optional parameters.</dd>
+   <dt>Encoding considerations:</dt>
+   <dd>binary</dd>
+   <dt>Security considerations:</dt>
+   <dd>
+    Subresources of a <code>multipart/x-mixed-replace</code>
+    resource can be of any type, including types with non-trivial
+    security implications such as <code>text/html</code>.
+   </dd>
+   <dt>Interoperability considerations:</dt>
+   <dd>
+    None.
+   </dd>
+   <dt>Published specification:</dt>
+   <dd>
+    This specification describes processing rules for Web browsers.
+    Conformance requirements for generating resources with this type are the same as for <code>multipart/mixed</code>. <a href="#refsRFC2046">[RFC2046]</a>
+   </dd>
+   <dt>Applications that use this media type:</dt>
+   <dd>
+    This type is intended to be used in resources generated by Web servers, for consumption by Web browsers.
+   </dd>
+   <dt>Additional information:</dt>
+   <dd>
+    <dl>
+     <dt>Magic number(s):</dt>
+     <dd>No sequence of bytes can uniquely identify a <code>multipart/x-mixed-replace</code> resource.</dd>
+     <dt>File extension(s):</dt>
+     <dd>No specific file extensions are recommended for this type.</dd>
+     <dt>Macintosh file type code(s):</dt>
+     <dd>No specific Macintosh file type codes are recommended for this type.</dd>
+    </dl>
+   </dd>
+   <dt>Person &amp; email address to contact for further information:</dt>
+   <dd>Ian Hickson &lt;ian@hixie.ch></dd>
+   <dt>Intended usage:</dt>
+   <dd>Common</dd>
+   <dt>Restrictions on usage:</dt>
+   <dd>No restrictions apply.</dd>
+   <dt>Author:</dt>
+   <dd>Ian Hickson &lt;ian@hixie.ch></dd>
+   <dt>Change controller:</dt>
+   <dd>W3C</dd>
+  </dl>
+
+  <p>Fragment identifiers used with
+  <code>multipart/x-mixed-replace</code> resources apply to each body
+  part as defined by the type used by that body part.</p>
+
+
   <h3><dfn><code>application/xhtml+xml</code></dfn></h3>
 
   <p>This registration is for community review and will be submitted
@@ -110139,7 +110282,7 @@
    <dt>Optional parameters:</dt>
    <dd>No parameters</dd>
    <dt>Encoding considerations:</dt>
-   <dd>7bit US-ASCII encoding of octets that themselves can be encoding text using any <span>ASCII-compatible character encoding</span></dd>
+   <dd>7bit (US-ASCII encoding of octets that themselves can be encoding text using any <span>ASCII-compatible character encoding</span>)</dd>
    <dt>Security considerations:</dt>
    <dd>
     <p>In isolation, an <code>application/x-www-form-urlencoded</code>
@@ -110211,7 +110354,7 @@
    <dt>Optional parameters:</dt>
    <dd>No parameters</dd>
    <dt>Encoding considerations:</dt>
-   <dd>Always UTF-8.</dd>
+   <dd>8bit (always UTF-8)</dd>
    <dt>Security considerations:</dt>
    <dd>
     <p>Cache manifests themselves pose no immediate risk unless
@@ -110358,7 +110501,7 @@
    <dt>Optional parameters:</dt>
    <dd>No parameters</dd>
    <dt>Encoding considerations:</dt>
-   <dd>Must always be UTF-8.</dd>
+   <dd>8bit (always UTF-8)</dd>
    <dt>Security considerations:</dt>
    <dd>
     <p>Text track files themselves pose no immediate risk unless
@@ -110450,7 +110593,7 @@
    <dt>Optional parameters:</dt>
    <dd>Same as for <code>application/json</code> <a href="#refsJSON">[JSON]</a></dd>
    <dt>Encoding considerations:</dt>
-   <dd>Always UTF-8.</dd>
+   <dd>8bit (always UTF-8)</dd>
    <dt>Security considerations:</dt>
    <dd>Same as for <code>application/json</code> <a href="#refsJSON">[JSON]</a></dd>
    <dt>Interoperability considerations:</dt>
@@ -110529,7 +110672,7 @@
    <dt>Optional parameters:</dt>
    <dd>No optional parameters</dd>
    <dt>Encoding considerations:</dt>
-   <dd>This MIME type defines a binary protocol format which uses UTF-8 for text encoding.</dd>
+   <dd>binary (this MIME type defines a binary protocol format which uses UTF-8 for text encoding)</dd>
    <dt>Security considerations:</dt>
    <dd>
 

|