rtl-with-scrollbar.html (1458B)
1 <!DOCTYPE html> 2 <html dir="rtl" class=reftest-wait> 3 <title>Transition is correctly positioned on RTL page</title> 4 <link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> 5 <link rel="author" href="mailto:bokan@chromium.org"> 6 <link rel="match" href="rtl-with-scrollbar-ref.html"> 7 8 <script src="/common/rendering-utils.js"></script> 9 <script src="/common/reftest-wait.js"></script> 10 11 <style> 12 #target { 13 position: absolute; 14 top: 100px; 15 left: 100px; 16 width: 100px; 17 height: 200px; 18 background: dodgerblue; 19 contain: paint; 20 view-transition-name: target; 21 } 22 23 #inroot { 24 position: absolute; 25 top: 300px; 26 left: 200px; 27 width: 100px; 28 height: 200px; 29 background: rebeccapurple; 30 contain: paint; 31 } 32 33 body { 34 margin: 0px; 35 padding: 0px; 36 /* add overflow for scrollbar */ 37 height: 200vh; 38 } 39 40 /* Show the old snapshot for 300s */ 41 html::view-transition-group(*) { 42 animation-duration: 300s; 43 opacity: 1; 44 } 45 html::view-transition-new(*) { 46 animation: unset; 47 opacity: 0; 48 } 49 html::view-transition-old(*) { 50 animation: unset; 51 opacity: 1; 52 } 53 </style> 54 55 <div id=target></div> 56 <div id="inroot"></div> 57 58 <script> 59 failIfNot(document.startViewTransition, "Missing document.startViewTransition"); 60 61 async function runTest() { 62 await waitForAtLeastOneFrame(); 63 64 document.startViewTransition(() => { 65 requestAnimationFrame(() => requestAnimationFrame(takeScreenshot)); 66 }); 67 } 68 69 onload = () => requestAnimationFrame(runTest); 70 </script> 71 72 </html>