<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>13995</bug_id>
          
          <creation_ts>2011-09-01 11:50:51 +0000</creation_ts>
          <short_desc>&lt;track&gt; Don&apos;t check Content-Type for &lt;track&gt;</short_desc>
          <delta_ts>2012-09-14 12:15:27 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML.next</product>
          <component>default</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>LATER</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#sourcing-out-of-band-text-tracks</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>14294</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>annacc</cc>
    
    <cc>annevk</cc>
    
    <cc>eoconnor</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>franko</cc>
    
    <cc>ian</cc>
    
    <cc>julian.reschke</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>plh</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>robin</cc>
    
    <cc>silviapfeiffer1</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>56175</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-09-01 11:50:51 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html
Multipage: http://www.whatwg.org/C#sourcing-out-of-band-text-tracks
Complete: http://www.whatwg.org/c#sourcing-out-of-band-text-tracks

Comment:
Don&apos;t check Content-Type for &lt;track&gt;

Posted from: 83.218.67.122 by philipj@opera.com
User agent: Opera/9.80 (X11; Linux x86_64; U; Edition Next; en) Presto/2.9.186 Version/12.00</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56176</commentid>
    <comment_count>1</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-09-01 11:55:21 +0000</bug_when>
    <thetext>&quot;The tasks queued by the fetching algorithm on the networking task source to process the data as it is being fetched must examine the resource&apos;s Content Type metadata, once it is available, if it ever is. If no Content Type metadata is ever available, or if the type is not recognised as a text track format, then the resource&apos;s format must be assumed to be unsupported (this causes the load to fail, as described below). If a type is obtained, and represents a supported text track format, then the resource&apos;s data must be passed to the appropriate parser  (e.g. the WebVTT parser if the Content Type metadata is text/vtt)  as it is received, with the text track list of cues being used for that parser&apos;s output.&quot;

We don&apos;t want to implement this, given the experience with &lt;video&gt;, see http://www.w3.org/html/wg/wiki/ChangeProposals/NoVideoContentType#Issues_for_Authors

WebVTT already has the WEBVTT header magic to differentiate it from other formats if we should ever support such in &lt;track&gt;.

The main consequence of doing this check is that &lt;track&gt; will appear broken to all authors when they first test it. Even if they figure out how to set Content-Type, it&apos;ll mostly be a waste of time and not provide any real benefits.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56190</commentid>
    <comment_count>2</comment_count>
    <who name="Frank Olivier">franko</who>
    <bug_when>2011-09-01 15:46:44 +0000</bug_when>
    <thetext>&gt; WebVTT already has the WEBVTT header magic to differentiate it from other
&gt; formats if we should ever support such in &lt;track&gt;.

...but this requires the user agent to download the file to check the track type; this is not a good solution, especially in mobile scenarios.

&gt; The main consequence of doing this check is that &lt;track&gt; will appear broken to
&gt; all authors when they first test it. Even if they figure out how to set
&gt; Content-Type, it&apos;ll mostly be a waste of time and not provide any real
&gt; benefits.

I don&apos;t think that this is a big burden on developers; they use documentation and samples when using new elements. This would just have to be documented clearly, like a lot of other parts of the HTML5 spec.

The real benefit is that multiple track formats are supported cleanly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56212</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2011-09-02 09:02:08 +0000</bug_when>
    <thetext>If you are already fetching the file it does not matter much whether you terminate the request when reading the Content-Type header or the first set of octets from the response entity body (even on mobile).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56277</commentid>
    <comment_count>4</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2011-09-04 11:14:16 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; If you are already fetching the file it does not matter much whether you
&gt; terminate the request when reading the Content-Type header or the first set of
&gt; octets from the response entity body (even on mobile).

Not for one file. But it matters if you have many files, which in this case can be several dozens if not hundreds of caption, subtitle, audio description etc. files in different languages.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56278</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2011-09-04 11:34:43 +0000</bug_when>
    <thetext>Why? The difference is marginal.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56280</commentid>
    <comment_count>6</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2011-09-04 11:48:10 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; Why? The difference is marginal.

Wait, are you comparing the difference between a HEAD and a GET request with a request for the first 8 bytes? Then, yes, that&apos;s marginal.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56282</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2011-09-04 12:02:58 +0000</bug_when>
    <thetext>That is what this bug is about.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56793</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-14 22:23:04 +0000</bug_when>
    <thetext>As far as I can tell, the experience with &lt;video&gt; is that we&apos;re moving towards more strict checking, not moving towards sniffing.

In general, I agree that the platform would be more practical if we used sniffing everywhere instead of content type labeling. However, that&apos;s not how the platform is designed. If you want to deprecated Content-Type headers, I suggest bringing it up with the HTTP working group.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56812</commentid>
    <comment_count>9</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-09-15 07:13:40 +0000</bug_when>
    <thetext>It is this spec that defines when and how the Content-Type headers are checked, not the HTTP spec. If the spec does not change, we will just ignore what it says on this point, since it is just annoying to web authors.

As for Content-Type in video, I assume that the suggestion in http://www.w3.org/Bugs/Public/show_bug.cgi?id=11984#c22 is what will eventually be spec&apos;d, which includes sniffing in the absence of a trusted Content-Type. Doing the same for &lt;track&gt; might be fine, but strict checking is not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56874</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-15 23:04:29 +0000</bug_when>
    <thetext>Oh, if you mean just in the absence of a Content-Type, then sure, that can be added. I thought you meant ignoring the Content-Type altogether, which last I checked definitely violates HTTP.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56887</commentid>
    <comment_count>11</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-09-16 08:29:18 +0000</bug_when>
    <thetext>I can&apos;t find any MUST requirements at all in http://tools.ietf.org/html/rfc2616#section-14.17 or related sections, how would this be a violation?

As with &lt;video&gt;, I see 3 options here:

1. Always obey Content-Type

2. Always ignore Content-Type

3. Add sniffing for WebVTT to http://tools.ietf.org/html/draft-ietf-websec-mime-sniff-03 and use the sniffed type, not the official content type. If spec&apos;d as I imagine it, this would allow serving WebVTT as text/plain, but serving it as application/ttml+xml would fail.

(1) is unacceptable, (2) is what we&apos;ve implemented, but (3) could be tolerable if &lt;video&gt; were also made consistent with that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56888</commentid>
    <comment_count>12</comment_count>
    <who name="Julian Reschke">julian.reschke</who>
    <bug_when>2011-09-16 09:06:35 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; I can&apos;t find any MUST requirements at all in
&gt; http://tools.ietf.org/html/rfc2616#section-14.17 or related sections, how would
&gt; this be a violation?

Whether or not there is a MUST doesn&apos;t tell you anything about whether it&apos;s a requirement or not. You seem to be confused about when or not BCP14 keywords need to be used; see RFC 2119 for details. Note that there are entire RFCs without any BCP 14 keywords; that doesn&apos;t affect their &quot;normativeness&quot; at all.

That being said, &lt;http://greenbytes.de/tech/webdav/rfc2616.html#rfc.section.7.2.1&gt; says:

&quot;Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type &quot;application/octet-stream&quot;.&quot;

But also note:

&lt;http://trac.tools.ietf.org/wg/httpbis/trac/ticket/155&gt;

&gt; As with &lt;video&gt;, I see 3 options here:
&gt; 
&gt; 1. Always obey Content-Type
&gt; 
&gt; 2. Always ignore Content-Type
&gt; 
&gt; 3. Add sniffing for WebVTT to
&gt; http://tools.ietf.org/html/draft-ietf-websec-mime-sniff-03 and use the sniffed
&gt; type, not the official content type. If spec&apos;d as I imagine it, this would
&gt; allow serving WebVTT as text/plain, but serving it as application/ttml+xml
&gt; would fail.
&gt; 
&gt; (1) is unacceptable, (2) is what we&apos;ve implemented, but (3) could be tolerable
&gt; if &lt;video&gt; were also made consistent with that.

I don&apos;t think (1) is unacceptable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56899</commentid>
    <comment_count>13</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-09-16 12:11:33 +0000</bug_when>
    <thetext>(In reply to comment #12)

&gt; &quot;Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type
&gt; header field defining the media type of that body. If and only if the media
&gt; type is not given by a Content-Type field, the recipient MAY attempt to guess
&gt; the media type via inspection of its content and/or the name extension(s) of
&gt; the URI used to identify the resource. If the media type remains unknown, the
&gt; recipient SHOULD treat it as type &quot;application/octet-stream&quot;.&quot;
&gt; 
&gt; But also note:
&gt; 
&gt; &lt;http://trac.tools.ietf.org/wg/httpbis/trac/ticket/155&gt;

Great, this is option 3.

&gt; &gt; As with &lt;video&gt;, I see 3 options here:
&gt; &gt; 
&gt; &gt; 1. Always obey Content-Type
&gt; &gt; 
&gt; &gt; 2. Always ignore Content-Type
&gt; &gt; 
&gt; &gt; 3. Add sniffing for WebVTT to
&gt; &gt; http://tools.ietf.org/html/draft-ietf-websec-mime-sniff-03 and use the sniffed
&gt; &gt; type, not the official content type. If spec&apos;d as I imagine it, this would
&gt; &gt; allow serving WebVTT as text/plain, but serving it as application/ttml+xml
&gt; &gt; would fail.
&gt; &gt; 
&gt; &gt; (1) is unacceptable, (2) is what we&apos;ve implemented, but (3) could be tolerable
&gt; &gt; if &lt;video&gt; were also made consistent with that.
&gt; 
&gt; I don&apos;t think (1) is unacceptable.

Will not implement, it is an unnecessary hoop for authors to jump through and not actually necessary to support multiple text formats.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57011</commentid>
    <comment_count>14</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-19 22:52:14 +0000</bug_when>
    <thetext>Ah, well, if you&apos;re saying you&apos;re not going to implement it then naturally I&apos;ll update the spec accordingly.

Basically this means changing this paragraph:

&quot;The tasks queued by the fetching algorithm on the networking task source to process the data as it is being fetched must examine the resource&apos;s Content Type metadata, once it is available, if it ever is. If no Content Type metadata is ever available, or if the type is not recognised as a text track format, then the resource&apos;s format must be assumed to be unsupported (this causes the load to fail, as described below). If a type is obtained, and represents a supported text track format, then the resource&apos;s data must be passed to the appropriate parser (e.g. the WebVTT parser if the Content Type metadata is text/vtt) as it is received, with the text track list of cues being used for that parser&apos;s output.&quot;

...to something that instead of checking the Content-Type header recognises the file format based on signatures, and add a note mentioning that this is an intentional violation of the HTTP spec motivated by compatibility with implementations.

What&apos;s the signature for TTML?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57025</commentid>
    <comment_count>15</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-09-20 09:35:48 +0000</bug_when>
    <thetext>The specific signatures should be added to http://tools.ietf.org/html/draft-ietf-websec-mime-sniff-03, what is needed is to ensure that this spec has the necessary hooks and that we have consistency with how &lt;video&gt; works.

Would it be acceptable to add another section for &quot;Timed Text&quot; or some such that is similar to http://tools.ietf.org/html/draft-ietf-websec-mime-sniff-03#section-8 ? Since most text formats are unsniffable I expect it would initially contain only an entry for text/vtt.

(Note that &lt;video&gt; doesn&apos;t strictly obey Content-Type, yet there is no note citing a willful violation of HTTP. Oversight?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57050</commentid>
    <comment_count>16</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-20 20:05:16 +0000</bug_when>
    <thetext>Didn&apos;t we change &lt;video&gt; to strictly adhere to HTTP here?

What&apos;s the signature for TTML?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57065</commentid>
    <comment_count>17</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-09-21 07:41:30 +0000</bug_when>
    <thetext>(In reply to comment #16)
&gt; Didn&apos;t we change &lt;video&gt; to strictly adhere to HTTP here?

AFAIK, nothing has changed since http://www.w3.org/Bugs/Public/show_bug.cgi?id=11984 was filed. AFAICT, the spec still says to check if Content-Type is one of the supported types, missing or application/octet-stream and to then sniff. However, the spec is (deliberately?) vague here, so I can&apos;t say for sure. In any case we all know that the spec is bogus until Bug 11984 is resolved in a way that everyone is actually willing to implement.

&gt; What&apos;s the signature for TTML?

It&apos;s XML, we all know that sniffing it is not a good idea.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57066</commentid>
    <comment_count>18</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-09-21 08:00:51 +0000</bug_when>
    <thetext>Would it be acceptable to add another section for &quot;Timed Text&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57361</commentid>
    <comment_count>19</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-26 19:41:27 +0000</bug_when>
    <thetext>I misremembered what we did with media resources.


&gt; &gt; What&apos;s the signature for TTML?
&gt; 
&gt; It&apos;s XML, we all know that sniffing it is not a good idea.

I&apos;m at a loss as to how to make this work then. Could you elaborate on how you want this to work?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57391</commentid>
    <comment_count>20</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2011-09-27 07:07:32 +0000</bug_when>
    <thetext>(In reply to comment #19)
&gt; &gt; &gt; What&apos;s the signature for TTML?
&gt; &gt; 
&gt; &gt; It&apos;s XML, we all know that sniffing it is not a good idea.
&gt; 
&gt; I&apos;m at a loss as to how to make this work then. Could you elaborate on how you
&gt; want this to work?

So, the XML Media Type registration [1] reckons you can use the string &quot;&lt;?xml&quot; to identify it as a XML document.

Further, the TTML spec [2] indicates in detail how to identify a TTML document (probably a simple approximation is to see if it contains some form of &quot;http://www.w3.org/ns/ttml&quot; in a namespace declaration).

In any case - I&apos;d leave these sniffing details to the browser that wants to implement support for TTML or just point to [2].

[1] http://tools.ietf.org/html/rfc3023
[2] http://www.w3.org/TR/ttaf1-dfxp/#doctypes</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57396</commentid>
    <comment_count>21</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-09-27 07:49:51 +0000</bug_when>
    <thetext>(In reply to comment #19)
&gt; I misremembered what we did with media resources.
&gt; 
&gt; 
&gt; &gt; &gt; What&apos;s the signature for TTML?
&gt; &gt; 
&gt; &gt; It&apos;s XML, we all know that sniffing it is not a good idea.
&gt; 
&gt; I&apos;m at a loss as to how to make this work then. Could you elaborate on how you
&gt; want this to work?

Add a section &quot;Text Tracks&quot; to http://tools.ietf.org/html/draft-ietf-websec-mime-sniff-03 that says:

This section defines the *rules for sniffing text tracks specifically*.

   If the first octets match one of the signatures in Section 6 for one
   of the following media types, then let the sniffed-type be the
   corresponding media type and abort these steps:

   o  text/vtt

   Otherwise, let the sniffed-type be the official-type and abort these
   steps.

Of course, also update section 6 with the WebVTT magic.

In effect, this will allow browser that only support WebVTT to ignore Content-Type since anything that begins with &quot;WEBVTT&quot; works and anything that doesn&apos;t will fire an error event (technically for two different reasons, but the API doesn&apos;t make that distinction.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57400</commentid>
    <comment_count>22</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-09-27 08:27:48 +0000</bug_when>
    <thetext>To clarify, TTML would not be sniffed at all. If there should ever be a browser that implements it and they also don&apos;t think Content-Type is funny, they can work to add sniffing for it at that time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57565</commentid>
    <comment_count>23</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-30 16:14:08 +0000</bug_when>
    <thetext>Oh, I see. So you&apos;re saying to not ignore the Content-Type altogether, but just to use it in combination with MIME sniff as a fallback. I guess we can do that. It&apos;ll make the HTTP guys flip out again...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57688</commentid>
    <comment_count>24</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-10-03 07:58:48 +0000</bug_when>
    <thetext>Well, I want to ignore Content-Type, but since you bring up TTML I suggest that draft-abarth-mime-sniff do sniffing for WebVTT and none for TTML. The net result is that regardless of Content-Type, if the resource has the WEBVTT magic bytes, it&apos;ll be treated as WebVTT. For browsers that only support WebVTT, it&apos;s equivalent to ignoring Content-Type.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58596</commentid>
    <comment_count>25</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-20 23:29:10 +0000</bug_when>
    <thetext>What do you want to have happen if you browse a browser to a page that is labeled text/vtt and starts with &quot;WEBVTT&quot;?

What do you want to have happen if you browse a browser to a page that is labeled text/plain and starts with &quot;WEBVTT&quot;?

What do you want to have happen if a &lt;track&gt; points to a text/vtt file that starts with &quot;WEBVTT&quot;?

What do you want to have happen if a &lt;track&gt; points to a text/xml file that starts with &quot;WEBVTT&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58597</commentid>
    <comment_count>26</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-10-20 23:31:09 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6721.
Check-in comment: (WIP - MIMESNIFF has not yet been updated accordingly) Change the spec to use MIMESNIFF rules for text tracks instead of blindly honouring MIME types.
http://html5.org/tools/web-apps-tracker?from=6720&amp;to=6721</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58630</commentid>
    <comment_count>27</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-10-21 08:29:19 +0000</bug_when>
    <thetext>(In reply to comment #25)
&gt; What do you want to have happen if you browse a browser to a page that is
&gt; labeled text/vtt and starts with &quot;WEBVTT&quot;?

Not relevant to this bug, but just displaying it as plain text would seem the natural choice. I don&apos;t suppose we want to disallow fancier display methods, automatic translation, etc, but that sounds unlikely to happen.

&gt; What do you want to have happen if you browse a browser to a page that is
&gt; labeled text/plain and starts with &quot;WEBVTT&quot;?

Per the &quot;Web Pages&quot; section in the sniffing spec text/plain leads to sniffing, so it&apos;ll be sniffed as text/vtt and the same thing as above will happen.

&gt; What do you want to have happen if a &lt;track&gt; points to a text/vtt file that
&gt; starts with &quot;WEBVTT&quot;?

It&apos;ll be parsed and rendered as WebVTT.

&gt; What do you want to have happen if a &lt;track&gt; points to a text/xml file that
&gt; starts with &quot;WEBVTT&quot;?

Per comment 21, it will be sniffed as text/vtt and then parsed+rendered as WebVTT. (The same will happen regardless of the media type.)

Finally, although you didn&apos;t ask, navigating to a text/xml file that starts with &quot;WEBVTT&quot; would not cause it to be sniffed as WebVTT, since text/xml is not in the table that leads to sniffing in step 2 of &lt;http://tools.ietf.org/html/draft-ietf-websec-mime-sniff-03#section-4&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58861</commentid>
    <comment_count>28</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-25 04:54:17 +0000</bug_when>
    <thetext>Your last two paragraphs seem to contradict each other. Can you elaborate?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58893</commentid>
    <comment_count>29</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2011-10-25 07:44:03 +0000</bug_when>
    <thetext>You need to contrast with &lt;img&gt; loading. When navigating not everything is sniffed, when loading from &lt;img&gt; everything is sniffed (unless image/svg+xml, which here would be application/ttml+xml or some such).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58899</commentid>
    <comment_count>30</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-10-25 08:54:50 +0000</bug_when>
    <thetext>(In reply to comment #28)
&gt; Your last two paragraphs seem to contradict each other. Can you elaborate?

There is no contradiction, since the same sniffing wouldn&apos;t be applied when navigating and when fetching in a &lt;track&gt; context.

However, if there is a solution which allows the exact same sniffing rules to be applied for both &lt;track&gt; and &lt;video&gt; contexts and when navigating I&apos;d be perfectly happy with that. The main point is that it should be possible to serve video and text tracks without Content-Type or with application/octet-stream and text/plain respectively and have it just work, which strictly speaking doesn&apos;t require always ignoring Content-Type, even if that is my preferred solution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58956</commentid>
    <comment_count>31</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-25 23:33:01 +0000</bug_when>
    <thetext>We can do whatever, I&apos;m just trying to work out what you want. :-)

I didn&apos;t notice the distinction of navigate vs &lt;track&gt; in comment 27&apos;s last two paragraphs, sorry for the confusion. What we do when you navigate to a text/xml file is pretty much a given, I don&apos;t see any way we&apos;d want to sniff for that. That&apos;s why I didn&apos;t ask about it.

Currently, what Anne has said and what Philip has said conflict (comment 27 and comment 29). If we do what &lt;img&gt; does, then we have to explicitly list all the types we _don&apos;t_ want to sniff, which would include the TTML type. But that doesn&apos;t seem to be what Philip is suggesting; if I understand correctly, that&apos;s more a matter of just having a list of formats that we sniff for regardless of the type when used with &lt;track&gt;, and then falling back on the default; for navigation, though, the sniffing would work as now, with just one more row in the MIMESNIFF table.

I guess the remaining question is, if we fallback to the Content-Type, and a  file is labeled as text/vtt but doesn&apos;t have the WEBVTT signature, should we still try to parse it as WEBVTT, or should we not recognise it? (I guess if we say that if the signature is missing we still fire onerror, it becomes a non-issue. See bug 14294.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58982</commentid>
    <comment_count>32</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-10-26 08:53:46 +0000</bug_when>
    <thetext>(In reply to comment #31)

&gt; Currently, what Anne has said and what Philip has said conflict (comment 27 and
&gt; comment 29). If we do what &lt;img&gt; does, then we have to explicitly list all the
&gt; types we _don&apos;t_ want to sniff, which would include the TTML type. But that
&gt; doesn&apos;t seem to be what Philip is suggesting; if I understand correctly, that&apos;s
&gt; more a matter of just having a list of formats that we sniff for regardless of
&gt; the type when used with &lt;track&gt;, and then falling back on the default; for
&gt; navigation, though, the sniffing would work as now, with just one more row in
&gt; the MIMESNIFF table.

Hmm, I hadn&apos;t noticed that special case of image sniffing and note that there is nothing similar for sniffing video (although that section is fiction until bug 11984 is resolved). Is there a particular reason for special-casing &quot;image/svg+xml&quot; that would apply to TTML as well? If not, my suggestion in comment 21 stands.

&gt; I guess the remaining question is, if we fallback to the Content-Type, and a 
&gt; file is labeled as text/vtt but doesn&apos;t have the WEBVTT signature, should we
&gt; still try to parse it as WEBVTT, or should we not recognise it? (I guess if we
&gt; say that if the signature is missing we still fire onerror, it becomes a
&gt; non-issue. See bug 14294.)

We should still try to parse it and it will fail. The whole assumption here is that this bug together with bug 14294 will allow implementations that only support WebVTT to ignore Content-Type and just try to parse it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59005</commentid>
    <comment_count>33</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-26 20:45:46 +0000</bug_when>
    <thetext>The reason for the image/svg+xml thing is to minimise how much we ignore Content-Type, so if that applies here too, we shouldn&apos;t do any sniffing...

Anyway, looks like what you want is for &lt;track src&gt;, first do signature inspection (sniffing), and if that doesn&apos;t find anything, then trust the MIME type. Since there&apos;s only one signature, I can just do that inline instead of requiring changes to MIMESNIFF. That will also mean that there&apos;s no need for any magic in the navigation step.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59026</commentid>
    <comment_count>34</comment_count>
    <who name="Frank Olivier">franko</who>
    <bug_when>2011-10-26 23:40:27 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; As far as I can tell, the experience with &lt;video&gt; is that we&apos;re moving towards
&gt; more strict checking, not moving towards sniffing.

Agree; In Internet Explorer, we do strict checking on the mime types for &lt;video&gt; and &lt;track&gt; sources.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59052</commentid>
    <comment_count>35</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-10-27 08:24:26 +0000</bug_when>
    <thetext>(In reply to comment #33)
&gt; The reason for the image/svg+xml thing is to minimise how much we ignore
&gt; Content-Type, so if that applies here too, we shouldn&apos;t do any sniffing...
&gt; 
&gt; Anyway, looks like what you want is for &lt;track src&gt;, first do signature
&gt; inspection (sniffing), and if that doesn&apos;t find anything, then trust the MIME
&gt; type. Since there&apos;s only one signature, I can just do that inline instead of
&gt; requiring changes to MIMESNIFF. That will also mean that there&apos;s no need for
&gt; any magic in the navigation step.

That&apos;s an editorial choice, but spreading the sniffing around instead of keeping it in one place isn&apos;t the choice I would make.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59148</commentid>
    <comment_count>36</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-28 19:52:47 +0000</bug_when>
    <thetext>Philip: What you&apos;re asking for can&apos;t be &quot;in one place&quot; regardless of which spec it&apos;s in, since it would be a separate section even if it was in MIMESNIFF.

Frank: Are you saying you disagree with the change Philip is proposing here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59518</commentid>
    <comment_count>37</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-11-02 19:44:46 +0000</bug_when>
    <thetext>So what is the spec supposed to say, at this point?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59564</commentid>
    <comment_count>38</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-11-03 16:30:55 +0000</bug_when>
    <thetext>Unless browser vendors agree on what they are intending to implement here, which seems not to be the case, I will probably go back to strict adherence to the HTTP specs, with a warning in the spec saying that this is likely to change, and then let the market figure it out. Once browsers converge on a particular behaviour, or once there is agreement on what they should converge on, I will update the spec to match it.

As with the &lt;video&gt; element case, you are of course welcome to try to use the escalation process to make a decision sooner, but of course, as with the &lt;video&gt; case, if it doesn&apos;t match what finally gets implemented, it doesn&apos;t much matter what that decision is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59568</commentid>
    <comment_count>39</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-11-03 16:58:07 +0000</bug_when>
    <thetext>OK, as long as the spec is clear in both cases about the status of the issue, I can live with this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59569</commentid>
    <comment_count>40</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2011-11-03 17:01:40 +0000</bug_when>
    <thetext>FWIW, I think it should work like images and fonts. Always sniff, and add exceptions (e.g. application/ttml+xml) as needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59985</commentid>
    <comment_count>41</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-11-12 00:31:26 +0000</bug_when>
    <thetext>I&apos;ve put a warning in the spec. Marking this LATER for now; once browser vendors have converged on a behaviour or desired behaviour I&apos;ll revisit this. (See comment 32.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>