<?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>15492</bug_id>
          
          <creation_ts>2012-01-10 12:47:47 +0000</creation_ts>
          <short_desc>&lt;track&gt; Normalization for setter of TextTrackCue.text is not defined</short_desc>
          <delta_ts>2012-07-18 18:48:59 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#dom-texttrackcue-text</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>fs</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>62467</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-01-10 12:47:47 +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#dom-texttrackcue-text
Complete: http://www.whatwg.org/c#dom-texttrackcue-text

Comment:
Normalization for setter of TextTrackCue.text is not defined

Posted from: 2001:4c28:a030:30:72f3:95ff:fe00:4501
User agent: Opera/9.80 (X11; Linux x86_64; U; sv) Presto/2.9.168 Version/11.51</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62468</commentid>
    <comment_count>1</comment_count>
    <who name="Fredrik S">fs</who>
    <bug_when>2012-01-10 12:54:51 +0000</bug_when>
    <thetext>In section http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue, step 6 (specification for the TextTrackCue constructor) it said that:

&quot;Let cue&apos;s text track cue text be the value of the text argument, and let the rules for its interpretation be the WebVTT cue text parsing rules, ...&quot;

the referenced section of the WebVTT specification (http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules) does not define normalization.

I would expect that cue text set using TextTrackCue.text or the TextTrackCue-constructor to have the same normalization rules applied as for a cue parsed via the WebVTT parser - i.e, basically step 1, &quot;WebVTT parsing algorithm&quot; (http://dev.w3.org/html5/webvtt/#parsing).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63776</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-02-06 22:05:51 +0000</bug_when>
    <thetext>What do you mean by &quot;normalization&quot; here? Can you show an example?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63811</commentid>
    <comment_count>3</comment_count>
    <who name="Fredrik S">fs</who>
    <bug_when>2012-02-07 07:49:14 +0000</bug_when>
    <thetext>I mean &quot;normalization&quot; as in what&apos;s defined in http://dev.w3.org/html5/webvtt/#webvtt-parser-algorithm step 1. I.e:

&apos;\0&apos; -&gt; U+fffd
&apos;\r\n&apos; -&gt; &apos;\n&apos;
&apos;\r&apos; -&gt; &apos;\n&apos;

It occurred to me that it may be weird if one of the paths (the one through the VTT parser) had well-formed/normalized input while the other two (TextTrackCue.text and the TextTrackCue constructor) did not. The cue text tokenization/parsing algorithm itself will probably handle it, but the result will be different for the same input depending on the way it took through the parser.

An example might be anything with an embedded &apos;\0&apos;:

&lt;i&gt;F\0oo&lt;/i&gt;

which when parsed via a track-file would give:

&lt;i&gt;
 +-&quot;F\xfffdoo&quot;

while through cue.text it would render:

&lt;i&gt;
 +-&quot;F\0oo&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67037</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-04-25 18:49:47 +0000</bug_when>
    <thetext>Ah, I see.

The normalisation is defined, it&apos;s just that it&apos;s the null operation.

We only &quot;normalise&quot; newlines in actual text files because they can often change from one style to another just from the file being opened and saved on a different platform, which might break scripts, and we only normalise nulls because they can be the source of unexpected truncation bugs in naïve software. These concerns don&apos;t really affect the DOM API, so there&apos;s not really any need to do them there.

This is consistent with how HTML works in general.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>