pseudo-get-computed-style-clean-style.html (1830B)
1 <!DOCTYPE html> 2 <html> 3 <title>View transitions: check pseudo element's default styles with clean style</title> 4 <link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> 5 <link rel="author" href="mailto:vmpstr@chromium.org"> 6 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <script src="/dom/events/scrolling/scroll_support.js"></script> 10 11 <style> 12 #target { 13 width: 100px; 14 height: 100px; 15 view-transition-name: target; 16 mix-blend-mode: multiply; 17 } 18 ::view-transition-image-pair(target) { 19 position: fixed; 20 } 21 </style> 22 23 <div id=target></div> 24 25 <script> 26 promise_test(async () => { 27 assert_implements(document.startViewTransition, "Missing document.startViewTransition"); 28 await waitForCompositorReady(); 29 30 let transition = document.startViewTransition(() => { 31 // Ensure our style & layout are clean. 32 document.documentElement.getBoundingClientRect(); 33 34 assert_equals(getComputedStyle(document.documentElement, "::view-transition").position, "absolute", "::view-transition"); 35 assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").mixBlendMode, "normal", "container(target)"); 36 }); 37 38 // When transition is ready, the activation of the view transition should be done, so 39 // we have updated the pseudo-element styles. 40 await transition.ready; 41 42 // Ensure our style & layout are clean. 43 document.documentElement.getBoundingClientRect(); 44 45 assert_equals(getComputedStyle(document.documentElement, "::view-transition").position, "absolute", "::view-transition"); 46 assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").mixBlendMode, "multiply", "container(target)"); 47 48 await transition.finished; 49 }, "properties of pseudo elements in update callback"); 50 51 </script>