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

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

Issue 747363003: Ignore <rt> children when determining WebVTT text direction (LTR/RTL) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 5
6 <script src=../media-file.js></script> 6 <script src=../media-file.js></script>
7 <script src=../video-test.js></script> 7 <script src=../video-test.js></script>
8 <script src=../media-controls.js></script> 8 <script src=../media-controls.js></script>
9 9
10 <script> 10 <script>
11 11
12 var testTrack; 12 var testTrack;
13 var testCueDisplayBox; 13 var testCueDisplayBox;
14 var seekedCount = 0; 14 var seekedCount = 0;
15 var direction; 15 var direction;
16 16
17 var info = ["تجربة", 17 var info = ["تجربة",
18 "\t1234", 18 "\t1234",
19 "تجربة\nLTR new line, but cue should be RTL", 19 "تجربة\nLTR new line, but cue should be RTL",
20 "LTR cue تجربة", 20 "LTR cue تجربة",
21 ";1234تجربة", 21 ";1234تجربة",
22 "\t०१२३४५६७८९ \t", 22 "\t०१२३४५६७८९ \t",
23 "𐡘 (Imperial Aramaic number one, U+10858) strong RTL, non-BM P", 23 "𐡘 (Imperial Aramaic number one, U+10858) strong RTL, non-BM P",
24 "𝅘𝅥 (Musical symbol quarter note, U+1D15F) strong LTR, non-BM P"]; 24 "𝅘𝅥 (Musical symbol quarter note, U+1D15F) strong LTR, non-BM P",
25 "<ruby><rt>𝅘𝅥</rt>تجربة</ruby>",
26 "<ruby>1234<rt>تجربة</rt></ruby>"];
25 27
26 function testCueStyle() 28 function testCueStyle()
27 { 29 {
28 endTest(); 30 endTest();
29 } 31 }
30 32
31 function seeked() 33 function seeked()
32 { 34 {
33 testCueDisplayBox = textTrackDisplayElement(video, 'display'); 35 testCueDisplayBox = textTrackDisplayElement(video, 'display');
34 36
35 consoleWrite(""); 37 consoleWrite("");
36 consoleWrite("** Jump to next cue **"); 38 consoleWrite("** Jump to next cue **");
37 testExpected("video.currentTime", (seekedCount / 2) + .25); 39 testExpected("video.currentTime", (seekedCount / 2) + .25);
38 testExpected("testTrack.track.activeCues.length", 1); 40 testExpected("testTrack.track.activeCues.length", 1);
39 testExpected("testTrack.track.activeCues[0].text", info[seekedCount] ); 41 testExpected("testTrack.track.activeCues[0].text", info[seekedCount] );
40 testExpected("testCueDisplayBox.innerText", info[seekedCount]); 42 testExpected("testCueDisplayBox.innerText", info[seekedCount].replac e(/<[^>]+>/g, ""));
41 43
42 direction = seekedCount % 2 ? "ltr" : "rtl"; 44 direction = seekedCount % 2 ? "ltr" : "rtl";
43 45
44 consoleWrite(""); 46 consoleWrite("");
45 consoleWrite("** The position should be default and CSS direction se t to " + direction + " **"); 47 consoleWrite("** The position should be default and CSS direction se t to " + direction + " **");
46 testExpected("2 * testCueDisplayBox.offsetLeft == video.videoWidth - testCueDisplayBox.offsetWidth", true); 48 testExpected("2 * testCueDisplayBox.offsetLeft == video.videoWidth - testCueDisplayBox.offsetWidth", true);
47 49
48 testExpected("getComputedStyle(testCueDisplayBox).direction", direct ion); 50 testExpected("getComputedStyle(testCueDisplayBox).direction", direct ion);
49 51
50 if (++seekedCount == info.length) 52 if (++seekedCount == info.length)
(...skipping 19 matching lines...) Expand all
70 waitForEventOnce('canplaythrough', function() { video.currentTime = .25; }); 72 waitForEventOnce('canplaythrough', function() { video.currentTime = .25; });
71 } 73 }
72 </script> 74 </script>
73 </head> 75 </head>
74 <body onload="loaded()"> 76 <body onload="loaded()">
75 <video controls > 77 <video controls >
76 <track src="captions-webvtt/captions-rtl.vtt" kind="captions" defaul t> 78 <track src="captions-webvtt/captions-rtl.vtt" kind="captions" defaul t>
77 </video> 79 </video>
78 </body> 80 </body>
79 </html> 81 </html>
OLDNEW
« no previous file with comments | « LayoutTests/media/track/captions-webvtt/captions-rtl.vtt ('k') | LayoutTests/media/track/track-cue-rendering-rtl-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698