OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Test that cues are being matched properly by various CSS Selectors.</titl
e> | 2 <title>Test that cues are being matched properly by various CSS Selectors.</titl
e> |
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::cue(c) {color: purple} | 8 video::cue(c) {color: purple} |
9 video::cue(v) {color: yellow} | 9 video::cue(v) {color: yellow} |
10 video::cue(v[voice="Mark"]) {color: red} | 10 video::cue(v[voice="Mark"]) {color: red} |
(...skipping 22 matching lines...) Expand all Loading... |
33 video.src = findMediaFile("video", "../content/test"); | 33 video.src = findMediaFile("video", "../content/test"); |
34 | 34 |
35 var track = document.createElement("track"); | 35 var track = document.createElement("track"); |
36 track.src = "captions-webvtt/styling.vtt"; | 36 track.src = "captions-webvtt/styling.vtt"; |
37 track.kind = "captions"; | 37 track.kind = "captions"; |
38 track.default = true; | 38 track.default = true; |
39 video.appendChild(track); | 39 video.appendChild(track); |
40 | 40 |
41 video.onseeked = t.step_func(function() { | 41 video.onseeked = t.step_func(function() { |
42 assert_equals(video.currentTime, seekTimes[seekTimeIndex]); | 42 assert_equals(video.currentTime, seekTimes[seekTimeIndex]); |
43 var cueNode = textTrackDisplayElement(video, "cue").firstElementChild; | 43 var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstEleme
ntChild; |
44 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][0]); | 44 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][0]); |
45 cueNode = cueNode.nextElementSibling; | 45 cueNode = cueNode.nextElementSibling; |
46 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][1]); | 46 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][1]); |
47 cueNode = cueNode.nextElementSibling; | 47 cueNode = cueNode.nextElementSibling; |
48 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][2]); | 48 assert_equals(getComputedStyle(cueNode).color, info[seekTimeIndex][2]); |
49 | 49 |
50 if (++seekTimeIndex == info.length) | 50 if (++seekTimeIndex == info.length) |
51 t.done(); | 51 t.done(); |
52 else | 52 else |
53 video.currentTime = seekTimes[seekTimeIndex]; | 53 video.currentTime = seekTimes[seekTimeIndex]; |
54 }); | 54 }); |
55 | 55 |
56 video.currentTime = seekTimes[seekTimeIndex]; | 56 video.currentTime = seekTimes[seekTimeIndex]; |
57 }); | 57 }); |
58 </script> | 58 </script> |
OLD | NEW |