view-transition-name-on-removed-element.html (1235B)
1 <!DOCTYPE html> 2 <html> 3 <title>View transitions: ensures view-transition-name is not tracked on element removed by script</title> 4 <link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> 5 <link rel="author" href="mailto:khushalsagar@chromium.org"> 6 7 <script src="/dom/events/scrolling/scroll_support.js"></script> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 11 <style> 12 #first { 13 width: 100px; 14 height: 100px; 15 background: blue; 16 view-transition-name: first; 17 } 18 </style> 19 <body> 20 <div> 21 <div id=first></div> 22 </div> 23 </body> 24 <script> 25 promise_test(async t => { 26 assert_implements(document.startViewTransition, "Missing document.startViewTransition"); 27 await waitForCompositorReady(); 28 return new Promise(async (resolve, reject) => { 29 // Remove an uncontained element. Because this element is not visited when 30 // discovering named elements, the transition is not skipped. 31 first.remove(); 32 33 let transition = document.startViewTransition(); 34 await transition.ready; 35 transition.finished.then(resolve, reject); 36 }); 37 }, "view-transition-name on an element removed by script should not be visited when discovering named elements"); 38 </script>