Skip to content

Commit

Permalink
[giow] (0) Reword the track processing model to be sane.
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=24487
Affected topics: Video Text Tracks

git-svn-id: http://svn.whatwg.org/webapps@8461 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 4, 2014
1 parent 7a8ae7e commit ebbc9dc
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 158 deletions.
77 changes: 30 additions & 47 deletions complete.html
Expand Up @@ -29780,48 +29780,26 @@ <h6 id=sourcing-out-of-band-text-tracks><span class=secno>4.7.10.12.3 </span>Sou
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.").</p>

<p>If the <a href=#fetch title=fetch>fetching algorithm</a> fails for any reason (network error, the
server returns an error code, a cross-origin check fails, etc), if <var title="">URL</var> is
the empty string, or if the <!--sniffed--> type of the resource is not a supported text track
format, then run these steps:</p>

<ol><li><p><a href=#queue-a-task>Queue a task</a> to first change the <a href=#text-track-readiness-state>text track readiness state</a> to
<a href=#text-track-failed-to-load title="text track failed to load">failed to load</a> and then <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <code><a href=#the-track-element>track</a></code>
element.</li>

<li><p>Wait until the <a href=#text-track-readiness-state>text track readiness state</a> is no longer set to <a href=#text-track-loading title="text track loading">loading</a>.</li>

<li><p>Wait until the <a href=#track-url>track URL</a> is no longer equal to <var title="">URL</var>, at
the same time as the <a href=#text-track-mode>text track mode</a> is set to <a href=#text-track-hidden title="text track
hidden">hidden</a> or <a href=#text-track-showing title="text track showing">showing</a>.</li>

<li><p>Jump to the step labeled <i>top</i>.</li>

</ol><p>If the <a href=#fetch title=fetch>fetching algorithm</a> does not fail, then the final <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the
<a href=#networking-task-source>networking task source</a> must run the following steps after it has tried to parse the
data:</p>

<ol><li><p>Change the <a href=#text-track-readiness-state>text track readiness state</a> to <a href=#text-track-loaded title="text track
loaded">loaded</a>.</li>

<li>

<p>If the file was successfully processed, <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-load><a href=#event-load>load</a></code> at the <code><a href=#the-track-element>track</a></code> element.</p>

<p>Otherwise, the file was not successfully processed (e.g. the format in question is an XML
format and the file contained a well-formedness error that the XML specification requires be
detected and reported to the application); <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <code><a href=#the-track-element>track</a></code> element.</p>

</li>

<li><p>Wait until the <a href=#track-url>track URL</a> is no longer equal to <var title="">URL</var>, at
the same time as the <a href=#text-track-mode>text track mode</a> is set to <a href=#text-track-hidden title="text track
hidden">hidden</a> or <a href=#text-track-showing title="text track showing">showing</a>.</li>
<p>If the <a href=#fetch title=fetch>fetching algorithm</a> fails for any reason (network error,
the server returns an error code, a cross-origin check fails, etc), or if <var title="">URL</var> is the empty string, then <a href=#queue-a-task>queue a task</a> to first change the
<a href=#text-track-readiness-state>text track readiness state</a> to <a href=#text-track-failed-to-load title="text track failed to load">failed to
load</a> and then <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <code><a href=#the-track-element>track</a></code> element.</p>

<p>If the <a href=#fetch title=fetch>fetching algorithm</a> does not fail, but the <!--sniffed-->
type of the resource is not a supported text track format, or the file was not successfully
processed (e.g. the format in question is an XML format and the file contained a well-formedness
error that the XML specification requires be detected and reported to the application), then the
<a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the
<a href=#networking-task-source>networking task source</a> in which the aforementioned problem is found must change the
<a href=#text-track-readiness-state>text track readiness state</a> to <a href=#text-track-failed-to-load title="text track failed to load">failed to
load</a> and <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error><a href=#event-error>error</a></code>
at the <code><a href=#the-track-element>track</a></code> element.</p>

<li><p>Jump back to the step labeled <i>top</i>.</li>
<p>If the <a href=#fetch title=fetch>fetching algorithm</a> does not fail, and the file was
successfully processed, then the final <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the <a href=#networking-task-source>networking task source</a>, after it has
finished parsing the data, must change the <a href=#text-track-readiness-state>text track readiness state</a> to <a href=#text-track-loaded title="text track loaded">loaded</a>, and <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-load><a href=#event-load>load</a></code> at the <code><a href=#the-track-element>track</a></code> element.</p>

</ol><p>If, while the <a href=#fetch title=fetch>fetching algorithm</a> is active, either:</p>
<p>If, while the <a href=#fetch title=fetch>fetching algorithm</a> is active, either:</p>

<ul><li>the <a href=#track-url>track URL</a> changes so that it is no longer equal to <var title="">URL</var>, while the <a href=#text-track-mode>text track mode</a> is set to <a href=#text-track-hidden title="text track
hidden">hidden</a> or <a href=#text-track-showing title="text track showing">showing</a>; or</li>
Expand All @@ -29830,17 +29808,22 @@ <h6 id=sourcing-out-of-band-text-tracks><span class=secno>4.7.10.12.3 </span>Sou
or <a href=#text-track-showing title="text track showing">showing</a>, while the <a href=#track-url>track URL</a> is not
equal to <var title="">URL</var></li>

</ul><p>...then the user agent must run the following steps:</p>
</ul><p>...then the user agent must abort the <a href=#fetch title=fetch>fetching algorithm</a>,
discarding any pending <a href=#concept-task title=concept-task>tasks</a> generated by that algorithm (and
in particular, not adding any cues to the <a href=#text-track-list-of-cues>text track list of cues</a> after the moment
the URL changed), and then <a href=#queue-a-task>queue a task</a> that first changes the <a href=#text-track-readiness-state>text track
readiness state</a> to <a href=#text-track-failed-to-load title="text track failed to load">failed to load</a> and
then <a href=#fire-a-simple-event title="fire a simple event">fires a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <code><a href=#the-track-element>track</a></code> element.</p>

<ol><li><p>Abort the <a href=#fetch title=fetch>fetching algorithm</a>, discarding any pending <a href=#concept-task title=concept-task>tasks</a> generated by that algorithm (and in particular, not adding
any cues to the <a href=#text-track-list-of-cues>text track list of cues</a> after the moment the URL
changed).</li>
</li>

<li><p>Jump back to the step labeled <i>top</i>.</li>
<li><p>Wait until the <a href=#text-track-readiness-state>text track readiness state</a> is no longer set to <a href=#text-track-loading title="text track loading">loading</a>.</li>

</ol><p>Until one of the above circumstances occurs, the user agent must remain on this step.</p>
<li><p>Wait until the <a href=#track-url>track URL</a> is no longer equal to <var title="">URL</var>, at
the same time as the <a href=#text-track-mode>text track mode</a> is set to <a href=#text-track-hidden title="text track
hidden">hidden</a> or <a href=#text-track-showing title="text track showing">showing</a>.</li>

</li>
<li><p>Jump to the step labeled <i>top</i>.</li>

</ol><p>Whenever a <code><a href=#the-track-element>track</a></code> element has its <code title=attr-track-src><a href=#attr-track-src>src</a></code> attribute
set, changed, or removed, the user agent must synchronously empty the element's <a href=#text-track>text
Expand Down
77 changes: 30 additions & 47 deletions index
Expand Up @@ -29780,48 +29780,26 @@ interface <dfn id=mediacontroller>MediaController</dfn> : <a href=#eventtarget>E
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.").</p>

<p>If the <a href=#fetch title=fetch>fetching algorithm</a> fails for any reason (network error, the
server returns an error code, a cross-origin check fails, etc), if <var title="">URL</var> is
the empty string, or if the <!--sniffed--> type of the resource is not a supported text track
format, then run these steps:</p>

<ol><li><p><a href=#queue-a-task>Queue a task</a> to first change the <a href=#text-track-readiness-state>text track readiness state</a> to
<a href=#text-track-failed-to-load title="text track failed to load">failed to load</a> and then <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <code><a href=#the-track-element>track</a></code>
element.</li>

<li><p>Wait until the <a href=#text-track-readiness-state>text track readiness state</a> is no longer set to <a href=#text-track-loading title="text track loading">loading</a>.</li>

<li><p>Wait until the <a href=#track-url>track URL</a> is no longer equal to <var title="">URL</var>, at
the same time as the <a href=#text-track-mode>text track mode</a> is set to <a href=#text-track-hidden title="text track
hidden">hidden</a> or <a href=#text-track-showing title="text track showing">showing</a>.</li>

<li><p>Jump to the step labeled <i>top</i>.</li>

</ol><p>If the <a href=#fetch title=fetch>fetching algorithm</a> does not fail, then the final <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the
<a href=#networking-task-source>networking task source</a> must run the following steps after it has tried to parse the
data:</p>

<ol><li><p>Change the <a href=#text-track-readiness-state>text track readiness state</a> to <a href=#text-track-loaded title="text track
loaded">loaded</a>.</li>

<li>

<p>If the file was successfully processed, <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-load><a href=#event-load>load</a></code> at the <code><a href=#the-track-element>track</a></code> element.</p>

<p>Otherwise, the file was not successfully processed (e.g. the format in question is an XML
format and the file contained a well-formedness error that the XML specification requires be
detected and reported to the application); <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <code><a href=#the-track-element>track</a></code> element.</p>

</li>

<li><p>Wait until the <a href=#track-url>track URL</a> is no longer equal to <var title="">URL</var>, at
the same time as the <a href=#text-track-mode>text track mode</a> is set to <a href=#text-track-hidden title="text track
hidden">hidden</a> or <a href=#text-track-showing title="text track showing">showing</a>.</li>
<p>If the <a href=#fetch title=fetch>fetching algorithm</a> fails for any reason (network error,
the server returns an error code, a cross-origin check fails, etc), or if <var title="">URL</var> is the empty string, then <a href=#queue-a-task>queue a task</a> to first change the
<a href=#text-track-readiness-state>text track readiness state</a> to <a href=#text-track-failed-to-load title="text track failed to load">failed to
load</a> and then <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <code><a href=#the-track-element>track</a></code> element.</p>

<p>If the <a href=#fetch title=fetch>fetching algorithm</a> does not fail, but the <!--sniffed-->
type of the resource is not a supported text track format, or the file was not successfully
processed (e.g. the format in question is an XML format and the file contained a well-formedness
error that the XML specification requires be detected and reported to the application), then the
<a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the
<a href=#networking-task-source>networking task source</a> in which the aforementioned problem is found must change the
<a href=#text-track-readiness-state>text track readiness state</a> to <a href=#text-track-failed-to-load title="text track failed to load">failed to
load</a> and <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error><a href=#event-error>error</a></code>
at the <code><a href=#the-track-element>track</a></code> element.</p>

<li><p>Jump back to the step labeled <i>top</i>.</li>
<p>If the <a href=#fetch title=fetch>fetching algorithm</a> does not fail, and the file was
successfully processed, then the final <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the <a href=#networking-task-source>networking task source</a>, after it has
finished parsing the data, must change the <a href=#text-track-readiness-state>text track readiness state</a> to <a href=#text-track-loaded title="text track loaded">loaded</a>, and <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-load><a href=#event-load>load</a></code> at the <code><a href=#the-track-element>track</a></code> element.</p>

</ol><p>If, while the <a href=#fetch title=fetch>fetching algorithm</a> is active, either:</p>
<p>If, while the <a href=#fetch title=fetch>fetching algorithm</a> is active, either:</p>

<ul><li>the <a href=#track-url>track URL</a> changes so that it is no longer equal to <var title="">URL</var>, while the <a href=#text-track-mode>text track mode</a> is set to <a href=#text-track-hidden title="text track
hidden">hidden</a> or <a href=#text-track-showing title="text track showing">showing</a>; or</li>
Expand All @@ -29830,17 +29808,22 @@ interface <dfn id=mediacontroller>MediaController</dfn> : <a href=#eventtarget>E
or <a href=#text-track-showing title="text track showing">showing</a>, while the <a href=#track-url>track URL</a> is not
equal to <var title="">URL</var></li>

</ul><p>...then the user agent must run the following steps:</p>
</ul><p>...then the user agent must abort the <a href=#fetch title=fetch>fetching algorithm</a>,
discarding any pending <a href=#concept-task title=concept-task>tasks</a> generated by that algorithm (and
in particular, not adding any cues to the <a href=#text-track-list-of-cues>text track list of cues</a> after the moment
the URL changed), and then <a href=#queue-a-task>queue a task</a> that first changes the <a href=#text-track-readiness-state>text track
readiness state</a> to <a href=#text-track-failed-to-load title="text track failed to load">failed to load</a> and
then <a href=#fire-a-simple-event title="fire a simple event">fires a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <code><a href=#the-track-element>track</a></code> element.</p>

<ol><li><p>Abort the <a href=#fetch title=fetch>fetching algorithm</a>, discarding any pending <a href=#concept-task title=concept-task>tasks</a> generated by that algorithm (and in particular, not adding
any cues to the <a href=#text-track-list-of-cues>text track list of cues</a> after the moment the URL
changed).</li>
</li>

<li><p>Jump back to the step labeled <i>top</i>.</li>
<li><p>Wait until the <a href=#text-track-readiness-state>text track readiness state</a> is no longer set to <a href=#text-track-loading title="text track loading">loading</a>.</li>

</ol><p>Until one of the above circumstances occurs, the user agent must remain on this step.</p>
<li><p>Wait until the <a href=#track-url>track URL</a> is no longer equal to <var title="">URL</var>, at
the same time as the <a href=#text-track-mode>text track mode</a> is set to <a href=#text-track-hidden title="text track
hidden">hidden</a> or <a href=#text-track-showing title="text track showing">showing</a>.</li>

</li>
<li><p>Jump to the step labeled <i>top</i>.</li>

</ol><p>Whenever a <code><a href=#the-track-element>track</a></code> element has its <code title=attr-track-src><a href=#attr-track-src>src</a></code> attribute
set, changed, or removed, the user agent must synchronously empty the element's <a href=#text-track>text
Expand Down

0 comments on commit ebbc9dc

Please sign in to comment.