object-view-box-fit-cover-video-ref.html (1526B)
1 <!-- This is an autogen file. Run support/generate_object_view_box_tests.py to update --> 2 <!DOCTYPE html> 3 <title>CSS object-view-box with object-fit:contain (ref)</title> 4 <link rel="author" href="mailto:khushalsagar@chromium.org"> 5 <script src="support/testHelper.js"></script> 6 <link rel="help" href="https://drafts.csswg.org/css-images-4/#the-object-view-box"> 7 8 <body> 9 <style> 10 div { 11 margin: 5px; 12 } 13 14 video { 15 object-fit: fill; 16 } 17 18 .container_view_box_subset { 19 width: 40px; 20 height: 50px; 21 overflow: hidden; 22 display: inline-block; 23 } 24 .view_box_subset { 25 width: 50px; 26 height: 100px; 27 position: relative; 28 left: -5px; 29 top: -50px; 30 } 31 32 .container_view_box_subset_with_position { 33 width: 40px; 34 height: 50px; 35 overflow: hidden; 36 display: inline-block; 37 } 38 .view_box_subset_with_position { 39 width: 50px; 40 height: 100px; 41 position: relative; 42 top: -50px; 43 } 44 45 .container_view_box_subset_with_scaling { 46 width: 50px; 47 height: 100px; 48 overflow: hidden; 49 display: inline-block; 50 clip-path: inset(1px 0px 0px 0px); 51 } 52 .view_box_subset_with_scaling { 53 width: 100px; 54 height: 200px; 55 position: relative; 56 left: -25px; 57 top: -100px; 58 } 59 </style> 60 <div class="container_view_box_subset"> 61 <video class="view_box_subset"></video> 62 </div> 63 <div class="container_view_box_subset_with_position"> 64 <video class="view_box_subset_with_position"></video> 65 </div> 66 <div class="container_view_box_subset_with_scaling"> 67 <video class="view_box_subset_with_scaling"></video> 68 </div> 69 </body> 70 <script> 71 populateElements(""); 72 </script>