Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: LayoutTests/media/track/track-cue-rendering-best-position.html

Issue 880873002: WebVTT: Implement 'best position' from the rendering section (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make computePositionScore impl. more clear. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/media/track/track-cue-rendering-best-position-expected.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../media-file.js"></script> 2 <script src="../media-file.js"></script>
3 <script> 3 <script>
4 var mediaFile = findMediaFile('video', '../content/test'); 4 var mediaFile = findMediaFile('video', '../content/test');
5 5
6 function addTrackWithCueData(video, cueData) { 6 function addCue(track, cueData) {
7 var track = video.addTextTrack('subtitles');
8 var cue = new VTTCue(0, 10, 'XXX'); 7 var cue = new VTTCue(0, 10, 'XXX');
9 for (var prop in cueData) 8 for (var prop in cueData)
10 cue[prop] = cueData[prop]; 9 cue[prop] = cueData[prop];
11 track.addCue(cue); 10 track.addCue(cue);
12 track.mode = 'showing';
13 } 11 }
14 </script> 12 </script>
15 <style> 13 <style>
16 video::cue { 14 video::cue {
17 font-size: 50px; 15 font-size: 120px;
18 color: green; 16 color: green;
19 background-color: green; 17 background-color: green;
20 } 18 }
21 </style> 19 </style>
22 <video> 20 <video>
23 <script> 21 <script>
24 var video = document.currentScript.parentNode; 22 var video = document.currentScript.parentNode;
25 addTrackWithCueData(video, { align: 'start', line: 0 }); 23 var track = video.addTextTrack('subtitles');
24 addCue(track, { line: 0, align: 'start' });
25 addCue(track, { line: 1, align: 'start' });
26 track.mode = 'showing';
26 video.src = mediaFile; 27 video.src = mediaFile;
27 </script> 28 </script>
28 </video> 29 </video>
29 <video>
30 <script>
31 var video = document.currentScript.parentNode;
32 addTrackWithCueData(video, { align: 'middle', line: 0 });
33 video.src = mediaFile;
34 </script>
35 </video>
36 <video>
37 <script>
38 var video = document.currentScript.parentNode;
39 addTrackWithCueData(video, { align: 'end', line: 0 });
40 video.src = mediaFile;
41 </script>
42 </video>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/media/track/track-cue-rendering-best-position-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698