object-view-box-property-changed.html (987B)
1 <!DOCTYPE html> 2 <html class=reftest-wait> 3 <title>Changing CSS object-view-box should trigger relayout</title> 4 <link rel="author" href="mailto:khushalsagar@chromium.org"> 5 <link rel="match" href="object-view-box-property-changed-ref.html"> 6 <link rel="help" href="https://drafts.csswg.org/css-images-4/#the-object-view-box"> 7 8 <script src="/common/reftest-wait.js"></script> 9 <script src="/common/rendering-utils.js"></script> 10 11 <style> 12 .view_box_subset { 13 object-fit: fill; 14 margin: 5px; 15 } 16 </style> 17 18 <body> 19 <img class="view_box_subset" src="support/exif-orientation-6-ru.jpg"></img> 20 </body> 21 22 <script> 23 async function runTest(image) { 24 // Wait for at least one frame to ensure changing object-view-box triggers a 25 // relayout. 26 await waitForAtLeastOneFrame(); 27 image.style.objectViewBox = "inset(50px 0px 0px 0px)"; 28 await waitForAtLeastOneFrame(); 29 requestAnimationFrame(takeScreenshot); 30 } 31 32 let image = document.getElementsByTagName("img")[0]; 33 image.onload = runTest(image); 34 </script>