OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>object-fit, video</title> | 4 <title>object-fit, video</title> |
5 <style> | 5 <style> |
6 .group > div { | 6 .group > div { |
7 display: inline-block; | 7 display: inline-block; |
8 overflow: hidden; | 8 overflow: hidden; |
9 width: 120px; | 9 width: 120px; |
10 height: 120px; | 10 height: 120px; |
11 border: 1px solid blue; | 11 border: 1px solid blue; |
12 background-color: gray; | 12 background-color: gray; |
13 margin: 10px; | 13 margin: 10px; |
14 } | 14 } |
15 | 15 |
16 .group > * > * { display: block; } | 16 .group > * > * { display: block; } |
17 .group > *:nth-child(1) > * { width:100%; margin-top:15px; } | 17 .group > *:nth-child(1) > * { width:100%; height:100%; } |
18 .group > *:nth-child(2) > * { width:100%; margin-top:15px; } | 18 .group > *:nth-child(2) > * { width:100%; margin-top:15px; } |
19 .group > *:nth-child(3) > * { width:100%; margin-top:15px; } | 19 .group > *:nth-child(3) > * { height:100%; margin-left:-20px; } |
20 .group > *:nth-child(4) > * { width:100%; margin-top:15px; } | 20 .group > *:nth-child(4) > * { margin-left:-100px; margin-top:-60px; } |
21 .group > *:nth-child(5) > * { width:100%; margin-top:15px; } | 21 .group > *:nth-child(5) > * { width:100%; margin-top:15px; } |
22 </style> | 22 </style> |
23 <script src=../media-file.js></script> | 23 <script src=../media-file.js></script> |
24 <script> | 24 <script> |
25 if (window.testRunner) | 25 if (window.testRunner) |
26 testRunner.waitUntilDone(); | 26 testRunner.waitUntilDone(); |
27 | 27 |
28 function init() | 28 function init() |
29 { | 29 { |
30 setSrcByTagName("video", findMediaFile("video", "../content/test")); | 30 setSrcByTagName("video", findMediaFile("video", "../content/test")); |
31 | 31 |
32 var totalCount = document.getElementsByTagName('video').length; | 32 var totalCount = document.getElementsByTagName('video').length; |
33 var count = totalCount; | 33 var count = totalCount; |
34 document.addEventListener("canplaythrough", function () { | 34 document.addEventListener("canplaythrough", function () { |
35 if (!--count) { | 35 if (!--count) { |
36 if (window.testRunner) | 36 if (window.testRunner) |
37 setTimeout(function() { testRunner.notifyDone(); }, tota
lCount * 150); | 37 setTimeout(function() { testRunner.notifyDone(); }, tota
lCount * 150); |
38 } | 38 } |
39 }, true); | 39 }, true); |
40 } | 40 } |
41 </script> | 41 </script> |
42 | 42 |
43 </head> | 43 </head> |
44 <body onload="init();"> | 44 <body onload="init();"> |
45 <div class="group"> | 45 <div class="group"> |
| 46 <!-- Note about the first video here: There's no way to unlock a video fro
m its |
| 47 aspect ratio without using object-fit:fill, so we have to use it here
as well |
| 48 as in the test file. In order to actually being able to detect failur
es, use a |
| 49 different background color. --> |
| 50 <div style="background:salmon;"><video style="object-fit:fill;"></video></
div> |
46 <div><video></video></div> | 51 <div><video></video></div> |
47 <div><video></video></div> | 52 <div><video></video></div> |
48 <div><video></video></div> | 53 <div><video></video></div> |
49 <div><video></video></div> | |
50 <div><video></video></div> | 54 <div><video></video></div> |
51 </div> | 55 </div> |
52 </body> | 56 </body> |
53 </html> | 57 </html> |
OLD | NEW |