| <!DOCTYPE html> |
| <html> |
| <title>View transitions: check pseudo element's default styles with clean style</title> |
| <link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> |
| <link rel="author" href="mailto:vmpstr@chromium.org"> |
| |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src="/dom/events/scrolling/scroll_support.js"></script> |
| |
| <style> |
| #target { |
| width: 100px; |
| height: 100px; |
| view-transition-name: target; |
| mix-blend-mode: multiply; |
| } |
| ::view-transition-image-pair(target) { |
| position: fixed; |
| } |
| </style> |
| |
| <div id=target></div> |
| |
| <script> |
| promise_test(async () => { |
| assert_implements(document.startViewTransition, "Missing document.startViewTransition"); |
| await waitForCompositorReady(); |
| |
| let transition = document.startViewTransition(() => { |
| // Ensure our style & layout are clean. |
| document.documentElement.getBoundingClientRect(); |
| |
| assert_equals(getComputedStyle(document.documentElement, "::view-transition").position, "fixed", "::view-transition"); |
| assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").mixBlendMode, "normal", "container(target)"); |
| }); |
| |
| // When transition is ready, the activation of the view transition should be done, so |
| // we have updated the pseudo-element styles. |
| await transition.ready; |
| |
| // Ensure our style & layout are clean. |
| document.documentElement.getBoundingClientRect(); |
| |
| assert_equals(getComputedStyle(document.documentElement, "::view-transition").position, "fixed", "::view-transition"); |
| assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").mixBlendMode, "multiply", "container(target)"); |
| |
| await transition.finished; |
| }, "properties of pseudo elements in update callback"); |
| |
| </script> |