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"> |
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. | 25 // Add the controls. The cue should move to avoid overlap. Defer this |
| 26 // until the controls resize. |
26 video.controls = true; | 27 video.controls = true; |
27 testRunner.notifyDone(); | 28 // Wait for the relayout event to happen. |
| 29 setTimeout(function() |
| 30 { |
| 31 testRunner.notifyDone(); |
| 32 }, 0); |
28 }); | 33 }); |
29 }; | 34 }; |
30 </script> | 35 </script> |
OLD | NEW |