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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>103110</bug_id>
          
          <creation_ts>2012-11-23 02:08:18 -0800</creation_ts>
          <short_desc>[Track] Video Text Tracks from cross-site should disable API access unless CORS headers available</short_desc>
          <delta_ts>2013-01-11 04:01:25 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>43668</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Silvia Pfeiffer">silviapf</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>eric.carlson</cc>
    
    <cc>glenn</cc>
    
    <cc>vcarbune</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>774320</commentid>
    <comment_count>0</comment_count>
    <who name="Silvia Pfeiffer">silviapf</who>
    <bug_when>2012-11-23 02:08:18 -0800</bug_when>
    <thetext>I experimented with cross-site text track loading for the video element:
http://html5videoguide.net/test/test.html

In comparison, I am also loading a cross-site video for a same-site text track here:
http://gingertech.net/pub/test/test.html

The latter works, while the first one doesn&apos;t.

Upon closer inspection it seems that the first one doesn&apos;t even try to load the remote text track.

(Note: cross-site loading might be an additional problem, but until remote tracks are loaded, this can&apos;t be tested.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801097</commentid>
    <comment_count>1</comment_count>
    <who name="Victor Carbune">vcarbune</who>
    <bug_when>2013-01-06 13:29:26 -0800</bug_when>
    <thetext>I&apos;m trying to understand properly the specification.
Both cases are &apos;potentially CORS-enabled&apos; fetch of media resources.

(In reply to comment #0)
&gt; I experimented with cross-site text track loading for the video element:
&gt; http://html5videoguide.net/test/test.html
In this case, according to the specification:
&quot;[...] let CORS mode be the state of the parent media element&apos;s crossorigin
content attribute. Otherwise, let CORS mode be No CORS.&quot;

&gt; In comparison, I am also loading a cross-site video for a same-site text track here:
&gt; http://gingertech.net/pub/test/test.html
This seems to be treated differently:
&quot;Perform a potentially CORS-enabled fetch [...], with the mode being the state of
the media element&apos;s crossorigin content attribute [...] and the default origin
behaviour set to taint.&quot;

Since in both cases there is no value for the &quot;crossorigin&quot; attribute, both end
up with the &quot;No CORS&quot; situation, but with the default origin behaviour different
(for video explicitly set to &apos;taint&apos;, for track implicitly set to &apos;fail&apos;?).

Reading the CORS-enabled fetch algorithms, it seems that for &apos;taint&apos; it won&apos;t
fail, while for &apos;fail&apos; it will (I get a message on the debugging console)

It&apos;s also worth noting that if I set the crossorigin=&quot;anonymous&quot; in the first
case, the text track does get loaded and I can access its contents through the
API as well (this might be a bug? I think if it&apos;s cross-origin it should not be
accessible through the API).

Is there something I&apos;m mis-reading from the spec?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801102</commentid>
    <comment_count>2</comment_count>
    <who name="Silvia Pfeiffer">silviapf</who>
    <bug_when>2013-01-06 14:34:04 -0800</bug_when>
    <thetext>Thanks for the further analysis - I guess I just missed the crossorigin attribute, thinking that server setup with the HTTP headers was sufficient (Access-Control-Allow-Origin:*). I now understand that both are required to do cross-site loads. It&apos;s maybe because I have the HTTP header that the API loads it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801103</commentid>
    <comment_count>3</comment_count>
    <who name="Victor Carbune">vcarbune</who>
    <bug_when>2013-01-06 14:50:59 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Thanks for the further analysis - I guess I just missed the crossorigin attribute, thinking that server setup with the HTTP headers was sufficient (Access-Control-Allow-Origin:*). I now understand that both are required to do cross-site loads. It&apos;s maybe because I have the HTTP header that the API loads it?
Indeed, the HTTP header is a pre-requisite for any CORS-enabled fetch,
but while it&apos;s enough for video, it doesn&apos;t seem to be enough for track.
(I&apos;m not sure if this is the intention or it is a bug in the specification)

What I meant to say with the API loading is that currently setting the
crossorigin attribute enables both rendering and accessing the track
through the API in WebKit.

Intuitively, I would expect a track from a different origin to not be
accessible through the API, but just rendered (for copyright purposes?).

There&apos;s also a part of the spec trying to handle this aspect:
&quot;[...] It can be CORS-same-origin or CORS-cross-origin; this affects whether
subtitles referenced in the media data are exposed in the API and, [...]&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801464</commentid>
    <comment_count>4</comment_count>
    <who name="Victor Carbune">vcarbune</who>
    <bug_when>2013-01-07 11:18:52 -0800</bug_when>
    <thetext>I would file these two bugs, as a conclusion resulting from your example: 
1) API access should be disabled for cross-origin text track resources
2) Closed Caption button shouldn&apos;t be visible if all the track resources have
failed loading (e.g. in this case of a single track, but failed cross-origin
request)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801908</commentid>
    <comment_count>5</comment_count>
    <who name="Silvia Pfeiffer">silviapf</who>
    <bug_when>2013-01-07 18:19:42 -0800</bug_when>
    <thetext>I&apos;ve created a new bug for the second issue, see bug 106285, and re-focused this bug on the first issue. Thanks for picking this up!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>