OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Text track cue layout after controls are added</title> | 2 <title>Text track cue layout after controls are added</title> |
3 <style> | 3 <style> |
4 ::cue { | 4 ::cue { |
5 font-size: 50px; | 5 font-size: 50px; |
6 } | 6 } |
7 </style> | 7 </style> |
8 <video style="border:1px solid gray"> | 8 <video style="border:1px solid gray; width: 500px;"> |
whywhat
2016/09/15 18:29:48
nit: ditto
kdsilva
2016/09/16 11:28:58
Done.
| |
9 <source src="opera/track/webvtt/rendering/reftest/media/white.webm" type="vide o/webm"> | 9 <source src="opera/track/webvtt/rendering/reftest/media/white.webm" type="vide o/webm"> |
10 <source src="opera/track/webvtt/rendering/reftest/media/white.mp4" type="video /mp4"> | 10 <source src="opera/track/webvtt/rendering/reftest/media/white.mp4" type="video /mp4"> |
11 </video> | 11 </video> |
12 <script> | 12 <script> |
13 // Without testRunner.layoutAndPaintAsyncThen there is no guarantee for when the first | 13 // Without testRunner.layoutAndPaintAsyncThen there is no guarantee for when the first |
14 // cue layout is done, so make no attempt to work without testRunner. | 14 // cue layout is done, so make no attempt to work without testRunner. |
15 testRunner.waitUntilDone(); | 15 testRunner.waitUntilDone(); |
16 | 16 |
17 // Add a cue that will overlap with the video controls. | 17 // Add a cue that will overlap with the video controls. |
18 var video = document.querySelector("video"); | 18 var video = document.querySelector("video"); |
19 var track = video.addTextTrack("captions"); | 19 var track = video.addTextTrack("captions"); |
20 track.addCue(new VTTCue(0, 1, "text")); | 20 track.addCue(new VTTCue(0, 1, "text")); |
21 track.mode = "showing"; | 21 track.mode = "showing"; |
22 | 22 |
23 video.onloadeddata = function() { | 23 video.onloadeddata = function() { |
24 testRunner.layoutAndPaintAsyncThen(function() { | 24 testRunner.layoutAndPaintAsyncThen(function() { |
25 // Add the controls. The cue should move to avoid overlap. Defer this | 25 // Add the controls. The cue should move to avoid overlap. Defer this |
26 // until the controls resize. | 26 // until the controls resize. |
27 video.controls = true; | 27 video.controls = true; |
28 // Wait for the relayout to happen. | 28 // Wait for the relayout to happen. |
29 window.requestAnimationFrame(function() { | 29 window.requestAnimationFrame(function() { |
30 testRunner.notifyDone(); | 30 testRunner.notifyDone(); |
31 }); | 31 }); |
32 }); | 32 }); |
33 }; | 33 }; |
34 </script> | 34 </script> |
OLD | NEW |