OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Test that u, b, i WebVTT objects are being styled correctly.</title> | 2 <title>Test that u, b, i WebVTT objects are being styled correctly.</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 <video></video> | 7 <video></video> |
8 <script> | 8 <script> |
9 async_test(function(t) { | 9 async_test(function(t) { |
10 var video = document.querySelector('video'); | 10 var video = document.querySelector('video'); |
11 video.src = findMediaFile('video', '../content/test'); | 11 video.src = findMediaFile('video', '../content/test'); |
12 | 12 |
13 var track = document.createElement('track'); | 13 var track = document.createElement('track'); |
14 track.src = 'captions-webvtt/styling-default.vtt'; | 14 track.src = 'captions-webvtt/styling-default.vtt'; |
15 track.kind = 'captions'; | 15 track.kind = 'captions'; |
16 track.default = true; | 16 track.default = true; |
17 video.appendChild(track); | 17 video.appendChild(track); |
18 | 18 |
19 video.onseeked = t.step_func_done(function() { | 19 video.onseeked = t.step_func_done(function() { |
20 var cueNode = textTrackDisplayElement(video, 'cue').firstElementChild; | 20 var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstEleme
ntChild; |
21 assert_equals(getComputedStyle(cueNode).fontWeight, 'bold'); | 21 assert_equals(getComputedStyle(cueNode).fontWeight, 'bold'); |
22 cueNode = cueNode.nextElementSibling; | 22 cueNode = cueNode.nextElementSibling; |
23 assert_equals(getComputedStyle(cueNode).fontStyle, 'italic'); | 23 assert_equals(getComputedStyle(cueNode).fontStyle, 'italic'); |
24 cueNode = cueNode.nextElementSibling; | 24 cueNode = cueNode.nextElementSibling; |
25 assert_equals(getComputedStyle(cueNode).textDecoration, 'underline solid
rgb(255, 255, 255)'); | 25 assert_equals(getComputedStyle(cueNode).textDecoration, 'underline solid
rgb(255, 255, 255)'); |
26 }); | 26 }); |
27 | 27 |
28 video.currentTime = 0.1; | 28 video.currentTime = 0.1; |
29 }); | 29 }); |
30 </script> | 30 </script> |
OLD | NEW |