OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Tests rendering text track cue line with padding set.</title> | 2 <title>Tests rendering text track cue line with padding set.</title> |
3 <script src="../media-file.js"></script> | 3 <script src="../media-file.js"></script> |
4 <script src="../media-controls.js"></script> | 4 <script src="../media-controls.js"></script> |
5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
7 <style> | 7 <style> |
8 video::-webkit-media-text-track-display { | 8 video::-webkit-media-text-track-display { |
9 padding: 15px; | 9 padding: 15px; |
10 } | 10 } |
11 </style> | 11 </style> |
12 <video> | 12 <video> |
13 <track src="captions-webvtt/captions-fast.vtt" kind="captions" default> | 13 <track src="captions-webvtt/captions-fast.vtt" kind="captions" default> |
14 </video> | 14 </video> |
15 <script> | 15 <script> |
16 async_test(function(t) { | 16 async_test(function(t) { |
17 var video = document.querySelector("video"); | 17 var video = document.querySelector("video"); |
18 video.src = findMediaFile("video", "../content/test"); | 18 video.src = findMediaFile("video", "../content/test"); |
19 | 19 |
20 video.onseeked = t.step_func_done(function() { | 20 video.onseeked = t.step_func_done(function() { |
21 var cueContainerElement = textTrackDisplayElement(video); | 21 var cueContainerElement = textTrackContainerElement(video); |
22 var cueDisplayElement = textTrackDisplayElement(video, "display", 0); | 22 var cueDisplayElement = textTrackDisplayElement(video); |
23 | 23 |
24 var cueDisplayBottomPoint = cueDisplayElement.offsetTop + cueDisplayElem
ent.offsetHeight; | 24 var cueDisplayBottomPoint = cueDisplayElement.offsetTop + cueDisplayElem
ent.offsetHeight; |
25 var cueContainerBottomPoint = cueContainerElement.offsetTop + cueContain
erElement.offsetHeight; | 25 var cueContainerBottomPoint = cueContainerElement.offsetTop + cueContain
erElement.offsetHeight; |
26 | 26 |
27 // Cue should be displayed entirely within the container. | 27 // Cue should be displayed entirely within the container. |
28 assert_true(cueDisplayBottomPoint <= cueContainerBottomPoint); | 28 assert_true(cueDisplayBottomPoint <= cueContainerBottomPoint); |
29 }); | 29 }); |
30 | 30 |
31 video.currentTime = 0.25; | 31 video.currentTime = 0.25; |
32 }); | 32 }); |
33 </script> | 33 </script> |
OLD | NEW |