<?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>16917</bug_id>
          
          <creation_ts>2012-05-03 11:57:32 +0000</creation_ts>
          <short_desc>WebVTT: snapToLines should throw InvalidStateError if the new value is false and &quot;line&quot; is negative or greater than 100</short_desc>
          <delta_ts>2014-01-30 09:39:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>TextTracks CG</product>
          <component>WebVTT</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#text-track-api</bug_file_loc>
          <status_whiteboard>v1</status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Philip Jägenstedt">philipj</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>public-texttracks</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact name="This bug has no owner yet - up for the taking">dave.null</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>67285</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-05-03 11:57:32 +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#text-track-api
Complete: http://www.whatwg.org/c#text-track-api

Comment:
snapToLines should throw InvalidStateError if the new value is false and
&quot;line&quot; is negative or greater than 100

Posted from: 88.131.66.80 by simonp@opera.com
User agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.7.3; U; en) Presto/2.10.229 Version/11.62</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67286</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-05-03 11:59:09 +0000</bug_when>
    <thetext>Currently this throws:

cue.snapToLines = false;
cue.line = -1; // throws IndexSizeError

but this doesn&apos;t throw:

cue.snapToLines = true;
cue.line = -1;
cue.snapToLines = false; // this should not be allowed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70837</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 17:36:03 +0000</bug_when>
    <thetext>This bug was cloned to create bug 18185 as part of operation convergence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73078</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-30 18:19:31 +0000</bug_when>
    <thetext>Good point.

Should we throw, or force .line to a valid value? What&apos;s the conceptual model here? Is it that you can pick one or the other of two boxes, one of which has a wheel that turns from 0..100 and the other allows you to pick any integer? Or is it that there are is a dial interlocked with a switch, and the dial picks any integer, and the switch blocks the dial to the range 0..100, e.g. because the dial has a groove in the range 0..100 that the switch pushes a rod into?

To put it another way, what&apos;s the expected way this will be used? Do we expect to see this kind of code?:

   function (c, newSnapValue, newLineValue) {
     c.snapToLines = newSnapValue;
     c.line = newLineValue;
   }

If so, we presumably want the two-block mode (i.e. reset line when setting snapToLines, if line is out of range), otherwise it&apos;ll randomly throw and you&apos;ll always have to test the current values first...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73401</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-09-07 08:26:11 +0000</bug_when>
    <thetext>Hmm. Since scripts might set these in any order, it might be in an invalid state when the first is set but then be valid again when the other is set. Clamping and resetting would result with the end result. Throwing would stop the script.

I think we should allow setting to any value, i.e. not force a valid state in the DOM API, but for the purpose of rendering, while these are in an invalid state, ignore them both (default to &quot;auto&quot;). This would allow scripts to set them in any order without worrying about it getting the wrong values, and if they end up with something invalid, it gets ignored, just like in the WebVTT syntax.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73402</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-09-07 08:27:45 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Clamping and resetting would result with the end result.

...the wrong end result.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73636</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-09-11 22:29:23 +0000</bug_when>
    <thetext>The only way it can be invalid is if snapToLines is true and the value is negative or &gt; 100, right? So &quot;auto&quot; in that case is always just equivalent to &quot;100&quot;.

I&apos;ve done as you suggest in comment 5. I think this is the opposite of all the previous comments, as well as bug 17027, which I&apos;ll now mark INVALID.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73702</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-09-12 16:36:52 +0000</bug_when>
    <thetext>An invalid state should be rendered as if the webvtt line setting was absent, i.e. as if snapToLines = true; line = &apos;auto&apos;. The spec now says to use as if line:100% which is different from auto.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77183</commentid>
    <comment_count>8</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-10-27 09:27:41 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; I&apos;ve done as you suggest in comment 5.

http://html5.org/tools/web-apps-tracker?from=7327&amp;to=7328</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99139</commentid>
    <comment_count>9</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2014-01-27 09:47:00 +0000</bug_when>
    <thetext>Simon, we can close this bug now, right? This looks sane to me:

http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-snaptolines
http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-line
http://dev.w3.org/html5/webvtt/#dfn-text-track-cue-line-position</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99277</commentid>
    <comment_count>10</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2014-01-28 08:31:04 +0000</bug_when>
    <thetext>Resolving as fixed, please reopen if there are still bugs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99471</commentid>
    <comment_count>11</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-01-30 09:39:43 +0000</bug_when>
    <thetext>lgtm</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>