group-animation-for-root-transition.html (1726B)
1 <!DOCTYPE html> 2 <html> 3 <title>View transitions: group pseudo for the root transition has animation</title> 4 <link rel="help" href="https://drafts.csswg.org/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 <body> 12 <script> 13 promise_test(async () => { 14 assert_implements(document.startViewTransition, "Missing document.startViewTransition"); 15 await waitForCompositorReady(); 16 return new Promise(async (resolve, reject) => { 17 let transition = document.startViewTransition(); 18 transition.ready.then(() => { 19 let groupAnimationCount = 0; 20 let oldAnimationCount = 0; 21 let newAnimationCount = 0; 22 23 document.getAnimations().forEach((animation) => { 24 let pseudo = animation.effect.pseudoElement; 25 if (pseudo == "::view-transition-group(root)") { 26 groupAnimationCount++; 27 } else if (pseudo == "::view-transition-new(root)") { 28 newAnimationCount++; 29 } else if (pseudo == "::view-transition-old(root)") { 30 oldAnimationCount++; 31 } else { 32 reject(); 33 } 34 }); 35 36 let total = 37 groupAnimationCount + oldAnimationCount + newAnimationCount; 38 // Old/new images have 2 animations : opacity and mix-blend-mode. 39 if (total == 5) { 40 assert_equals(groupAnimationCount, 1); 41 assert_equals(oldAnimationCount, 2); 42 assert_equals(newAnimationCount, 2); 43 resolve(); 44 } else { 45 reject(); 46 } 47 }); 48 }); 49 }, "incorrect UA animations for root transition"); 50 </script> 51 </body>