<?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>16875</bug_id>
          
          <creation_ts>2012-04-27 15:28:11 +0000</creation_ts>
          <short_desc>WebVTT :past and :future don&apos;t work if you just have text between the timestamps</short_desc>
          <delta_ts>2015-11-04 23:26:28 +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>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>v1</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>19126</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Pieters">zcorpan</reporter>
          <assigned_to name="Simon Pieters">zcorpan</assigned_to>
          <cc>ian</cc>
    
    <cc>lorettaguarino</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>public-texttracks</cc>
    
    <cc>silviapfeiffer1</cc>
    
    <cc>victor.carbune</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>67144</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-04-27 15:28:11 +0000</bug_when>
    <thetext>Consider

WEBVTT

00:00:00.000 --&gt; 00:00:10.000
foo &lt;00:03.000&gt; bar &lt;00:07.000&gt; baz

and

video::cue(:past) { color:green }

This wouldn&apos;t do anything per the current spec, because the cue has only WebVTT Leaf Node Objects, and they cannot be matched by ::cue(). To make it work per spec, you have to do:

WEBVTT

00:00:00.000 --&gt; 00:00:10.000
&lt;c&gt;foo&lt;/c&gt; &lt;00:03.000&gt; &lt;c&gt;bar&lt;/c&gt; &lt;00:07.000&gt; &lt;c&gt;baz&lt;/c&gt;

This seems pretty horrible.

To fix it we could make ::cue() be able to match text leaf nodes (so they basically act like name-less elements to selectors).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68484</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-06-01 08:47:28 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; To fix it we could make ::cue() be able to match text leaf nodes (so they
&gt; basically act like name-less elements to selectors).

Except that&apos;s also kind of horrible. Maybe it would be better if timestamps somehow were elements that wrapped the relevant text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68485</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-06-01 09:03:09 +0000</bug_when>
    <thetext>Something like this:

&lt;00:00.000&gt; Hello, &lt;00:01.350&gt; &lt;i&gt;you fool, &lt;00:02.800&gt; I love you

becomes:

#document-fragment
| &lt;00:00.000&gt;
|   &quot; Hello, &quot;
| &lt;00:01.350&gt;
|   &quot; &quot;
|   &lt;i&gt;
|     &quot;you fool, &quot;
| &lt;00:02.800&gt;
|   &quot; I love you&quot;

(not trying to reopen the &lt;i&gt; since WebVTT doesn&apos;t try to DWIM in general anyway)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68496</commentid>
    <comment_count>3</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2012-06-01 11:20:12 +0000</bug_when>
    <thetext>I thought it worked like this:

::cue:past {
	color: yellow;
} 
::cue:future {
 	text-shadow: black 0 0 1px;
}

This would make all parts of all active cues before the current time yellow and tive all parts of all active cues after the current time a shadow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68508</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-06-01 12:45:44 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; I thought it worked like this:
&gt; 
&gt; ::cue:past {
&gt;     color: yellow;
&gt; } 
&gt; ::cue:future {
&gt;      text-shadow: black 0 0 1px;
&gt; }
&gt; 
&gt; This would make all parts of all active cues before the current time yellow and
&gt; tive all parts of all active cues after the current time a shadow.

For

foo &lt;00:03.000&gt; bar &lt;00:07.000&gt; baz

the above style rules do nothing, since there are no elements, so the selectors don&apos;t match anything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68509</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-06-01 12:48:03 +0000</bug_when>
    <thetext>Also, ::cue:past and ::cue:future as used in your example would be a pseudo-class on the &quot;List of WebVTT Node Objects&quot; object (i.e. the root element) which never matches :past or :future. It needs to be something like ::cue(*:past) and ::cue(*:future) to match elements (like &lt;c&gt;) in the cue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68511</commentid>
    <comment_count>6</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2012-06-01 13:14:18 +0000</bug_when>
    <thetext>Hmm, I see. Is this just a problem with the 

Leaf text nodes probably need to be wrapped into anonymous &lt;c&gt; elements or something similarly addressable (basically, a &lt;div&gt;). Maybe each cue object is initially inside such an anonymous &lt;c&gt;/&lt;div&gt; element, which is broken up further when more timestamps are present.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68512</commentid>
    <comment_count>7</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2012-06-01 13:15:07 +0000</bug_when>
    <thetext>oops: s/Is this just a problem with the//</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68768</commentid>
    <comment_count>8</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-06-06 19:03:53 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; Leaf text nodes probably need to be wrapped into anonymous &lt;c&gt; elements or
&gt; something similarly addressable (basically, a &lt;div&gt;). Maybe each cue object is
&gt; initially inside such an anonymous &lt;c&gt;/&lt;div&gt; element, which is broken up
&gt; further when more timestamps are present.

That was basically my initial proposal (in comment 0), but it&apos;s quite weird and different to HTML and it makes all cues that don&apos;t use any timestamps to pay an element in &quot;tax&quot;. Making the timestamps themselves be elements (comment 2) seems like a better approach, I think. (We could even make :past and :future only match timestamp elements.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68801</commentid>
    <comment_count>9</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2012-06-07 14:06:46 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; That was basically my initial proposal (in comment 0), but it&apos;s quite weird and
&gt; different to HTML and it makes all cues that don&apos;t use any timestamps to pay an
&gt; element in &quot;tax&quot;. Making the timestamps themselves be elements (comment 2)
&gt; seems like a better approach, I think. (We could even make :past and :future
&gt; only match timestamp elements.)

The problem is that a time stamp is a time instant and not a time interval, so it would essentially need a wrapping that ends with the next time instant. Thus it creates the same kind of leaf node wrapping as your initial proposal. I don&apos;t really see the advantage.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68906</commentid>
    <comment_count>10</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-06-11 06:58:35 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; The problem is that a time stamp is a time instant and not a time interval,

I don&apos;t see why that is a problem.

&gt; so
&gt; it would essentially need a wrapping that ends with the next time instant.

That&apos;s the proposal in comment 2.

&gt; Thus
&gt; it creates the same kind of leaf node wrapping as your initial proposal.

Well, it creates the same kind of wrapping as normal elements (except there&apos;s no end tag, it&apos;s implied by the next timestamp).

&gt; I
&gt; don&apos;t really see the advantage.

The advantage is that you only get elements where they are needed. With the initial proposal, you get elements all over the place, which has all kinds of implications with how CSS applies to it, even for cues that don&apos;t use timestamps.

Consider this cue text

foo &lt;b&gt;bar&lt;/b&gt;

With the current spec, with HTML, and with the proposal in comment 2, the tree would be

#document-fragment
| &quot;foo &quot;
|   &lt;b&gt;
|     &quot;bar&quot;

With the proposal in comment 0, the tree would be (as seen from CSS anyway)

#document-fragment
| &lt;&gt;
|   &quot;foo &quot;
| &lt;b&gt;
|   &lt;&gt;
|     &quot;bar&quot;

Now consider for instance a trivial style rule like ::cue(*) { outline:solid }. This would create an outline for the &lt;b&gt; element *and* the child &lt;&gt; element, and since they take up the same space, they cancel each other out.  It would also outline the &quot;foo&quot; even though that doesn&apos;t happen in HTML. This is clearly just wrong.

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1567</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68907</commentid>
    <comment_count>11</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-06-11 07:00:24 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; #document-fragment
&gt; | &quot;foo &quot;
&gt; |   &lt;b&gt;
&gt; |     &quot;bar&quot;

I meant:

#document-fragment
| &quot;foo &quot;
| &lt;b&gt;
|   &quot;bar&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69170</commentid>
    <comment_count>12</comment_count>
    <who name="vcarbune">victor.carbune</who>
    <bug_when>2012-06-17 20:14:52 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Something like this:
&gt; 
&gt; &lt;00:00.000&gt; Hello, &lt;00:01.350&gt; &lt;i&gt;you fool, &lt;00:02.800&gt; I love you
&gt; 
&gt; becomes:
&gt; 
&gt; #document-fragment
&gt; | &lt;00:00.000&gt;
&gt; |   &quot; Hello, &quot;
&gt; | &lt;00:01.350&gt;
&gt; |   &quot; &quot;
&gt; |   &lt;i&gt;
&gt; |     &quot;you fool, &quot;
&gt; | &lt;00:02.800&gt;
&gt; |   &quot; I love you&quot;
&gt; 
&gt; (not trying to reopen the &lt;i&gt; since WebVTT doesn&apos;t try to DWIM in general
&gt; anyway)
How would this actually fit in the fact that the DocumentFragment has timestamps as ProcessingInstructions? I&apos;m pretty new to this, but it would still mean  to change the timestamp from a ProcessingInstruction to an element accepting style.

Why not dynamically wrap past elements and future and element in just two different styled containers, to which further we apply the CSS rules?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69186</commentid>
    <comment_count>13</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-06-18 06:09:55 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; How would this actually fit in the fact that the DocumentFragment has
&gt; timestamps as ProcessingInstructions? I&apos;m pretty new to this, but it would
&gt; still mean  to change the timestamp from a ProcessingInstruction to an element
&gt; accepting style.

Yes, we can change that as well.

&gt; Why not dynamically wrap past elements and future and element in just two
&gt; different styled containers, to which further we apply the CSS rules?

I&apos;m not sure I follow what you mean. What do you do with this?

A &lt;00:03.000&gt; B &lt;c&gt; C &lt;00:07.000&gt; D &lt;/c&gt; E</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69212</commentid>
    <comment_count>14</comment_count>
    <who name="vcarbune">victor.carbune</who>
    <bug_when>2012-06-18 22:51:13 +0000</bug_when>
    <thetext>(In reply to comment #13)
&gt; &gt; Why not dynamically wrap past elements and future and element in just two
&gt; &gt; different styled containers, to which further we apply the CSS rules?
&gt; 
&gt; I&apos;m not sure I follow what you mean. What do you do with this?
&gt; 
&gt; A &lt;00:03.000&gt; B &lt;c&gt; C &lt;00:07.000&gt; D &lt;/c&gt; E
I think my suggestion isn&apos;t correct, as I might have oversimplified things; so allow me to step back a bit just to make sure I understood correctly the spec. Given the current playback time of 00:05.000 do we obtain the following sets (considering leaf nodes as well)?

Past: A [ because &lt;00:03.000&gt; &lt; 00:05.000 is &quot;entirely after&quot; ] 
Future: D E [ because &lt;00:07.000&gt; &gt; 00:05.000 is &quot;entirely before&quot; ]

So &quot;B&quot; and &quot;&lt;c&gt; C &lt;00:07.000&gt; D &lt;/c&gt;&quot; wouldn&apos;t match neither :past, nor :future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71401</commentid>
    <comment_count>15</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-07-24 16:11:16 +0000</bug_when>
    <thetext>Making the timestamps into elements doesn&apos;t solve the leading text problem.

I think it makes sense to just have implied elements at the innermost level, but I&apos;ll have to think about this some more.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71917</commentid>
    <comment_count>16</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-07 23:29:49 +0000</bug_when>
    <thetext>Ok so how about if we just make :before and :after match implied elements that wrap the &quot;text node&quot;-like objects? Kind of like pseudo-elements, except that you&apos;re matching the pseudo-class against them, rather than selecting them directly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71919</commentid>
    <comment_count>17</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2012-08-07 23:58:52 +0000</bug_when>
    <thetext>Those pseudo-elements would be dynamic and dependent on the current video playback time. I think that would work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72191</commentid>
    <comment_count>18</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-08-15 09:19:00 +0000</bug_when>
    <thetext>(In reply to comment #16)
&gt; Ok so how about if we just make :before and :after match implied elements that
&gt; wrap the &quot;text node&quot;-like objects? Kind of like pseudo-elements, except that
&gt; you&apos;re matching the pseudo-class against them, rather than selecting them
&gt; directly.

s/before/past/ s/after/future/

AFAICT that is the comment 0 proposal. I explained in comment 10 why I think it&apos;s a bad idea.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76746</commentid>
    <comment_count>19</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-10-19 19:54:35 +0000</bug_when>
    <thetext>I really meant more like pseudo-elements than that; I meant these things wouldn&apos;t match &quot;*&quot;. They&apos;d _only_ match selectors that contained :past and :future and no explicit element type selector (other than the universal selector).

I think essentially requiring timestamps to only occur at the top level is really ugly. It means taking an existing well-marked-up cue and adding timings would be a really invasive procedure.

Maybe we should in fact make :past and :future really be only pseudo-elements. Are there many effects you couldn&apos;t do if we did that, that you&apos;d plausibly want to do? Since they can only change things like colour anyway...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78584</commentid>
    <comment_count>20</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-11-21 19:11:26 +0000</bug_when>
    <thetext>Ok my new plan is to make ::past and ::future be pseudo-elements that wrap innermost as if they were elements in the tree at the leaf level, and to disallow ::first-letter and ::first-line to match anything in cues. Any objections?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78602</commentid>
    <comment_count>21</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2012-11-21 20:22:17 +0000</bug_when>
    <thetext>Hmm... ::first-line could be useful, but really, :nth-child would be even more useful for line-based styling if each line was a selectable child.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78640</commentid>
    <comment_count>22</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-11-22 09:31:24 +0000</bug_when>
    <thetext>Real pseudo-elements sounds OK to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91683</commentid>
    <comment_count>23</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-08-06 11:49:14 +0000</bug_when>
    <thetext>This might become somewhat moot if http://lists.w3.org/Archives/Public/www-style/2013Jul/0547.html gets adopted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91685</commentid>
    <comment_count>24</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2013-08-06 12:28:54 +0000</bug_when>
    <thetext>Hmm... how does that deal with the element selection problem?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91779</commentid>
    <comment_count>25</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-08-08 08:26:34 +0000</bug_when>
    <thetext>What problem do you mean?

The original example in comment 0 would be video::cue(::text:past) { ... }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110793</commentid>
    <comment_count>26</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2014-08-30 03:17:10 +0000</bug_when>
    <thetext>(In reply to Simon Pieters from comment #23)
&gt; This might become somewhat moot if
&gt; http://lists.w3.org/Archives/Public/www-style/2013Jul/0547.html gets adopted.

I see that thread ended at http://lists.w3.org/Archives/Public/www-style/2013Jul/0588.html . Has there been any progress with a ::text pseudo-element?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110816</commentid>
    <comment_count>27</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-09-01 08:24:32 +0000</bug_when>
    <thetext>No. Feel free to bring it up again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111118</commentid>
    <comment_count>28</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2014-09-06 03:25:02 +0000</bug_when>
    <thetext>Note to self: analyse how Chrome, Safari and Opera are supporting :past in http://src.chromium.org/blink/trunk/LayoutTests/media/track/track-css-matching-timestamps.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118680</commentid>
    <comment_count>29</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2015-03-19 12:13:45 +0000</bug_when>
    <thetext>(In reply to Silvia Pfeiffer from comment #28)
&gt; Note to self: analyse how Chrome, Safari and Opera are supporting :past in
&gt; http://src.chromium.org/blink/trunk/LayoutTests/media/track/track-css-
&gt; matching-timestamps.html

Maybe bug 28237 can answer this. In Blink/WebKit, every node is :past unless it is :future. Spec says otherwise.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124050</commentid>
    <comment_count>30</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2015-11-03 09:18:24 +0000</bug_when>
    <thetext>Some kind of fix for this would be nice, Loretta has stumbled on this as well:
https://code.google.com/p/chromium/issues/detail?id=342592</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124079</commentid>
    <comment_count>31</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2015-11-04 15:14:43 +0000</bug_when>
    <thetext>I can&apos;t access that bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124084</commentid>
    <comment_count>32</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2015-11-04 23:26:28 +0000</bug_when>
    <thetext>(In reply to Simon Pieters from comment #31)
&gt; I can&apos;t access that bug.

&quot;WebVTT: paint-on captions are not supported&quot; is the title of the bug... rest is obvious ;-)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>